POV-Ray : Newsgroups : povray.newusers : Dealing with colours : Re: Dealing with colours Server Time
29 Jul 2024 10:26:34 EDT (-0400)
  Re: Dealing with colours  
From: Mike Williams
Date: 15 Mar 2006 03:23:13
Message: <77NdBCAc68FEFwG+@econym.demon.co.uk>
Wasn't it ChaoZ who wrote:
>As much as I try, I find it so difficult to deal with RGB colors in a 0 to 1
>scale.

Most 2d paint programs work with integer values for the colour
components, which range from 0 to 255. To convert values like that to
POV floating point components, divide by 256.

So if you find a colour you like in your favourite 2d paint program and
make a note of the RGB values. Then write something like

        rgb <23,46,230>/256 

To interpret "rgb <0.1, 0.2, 1>*0.9" perform the specified
multiplication and then further multiply by 256 and round to an integer

"rgb <0.1, 0.2, 1>*0.9" = "rgb <0.09, 0.18, 0.9>" = RGB[23,46,230]

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.