POV-Ray : Newsgroups : povray.newusers : Dealing with colours Server Time
25 Nov 2024 09:58:51 EST (-0500)
  Dealing with colours (Message 1 to 7 of 7)  
From: ChaoZ
Subject: Dealing with colours
Date: 14 Mar 2006 17:20:00
Message: <web.44174154bedb9510f039f4f00@news.povray.org>
As much as I try, I find it so difficult to deal with RGB colors in a 0 to 1
scale. When it comes with dealing with colour maps (such as those used to
create a sky for example) my confusion is compounded.

For example, what does this

0.50 rgb <0.1, 0.2, 1>*0.9

mean? It is used within a color map statement, so I assume a portion of the
map will have that colour.

I have read the POV-Ray manual and I am no clearer. Are there tools out
there to help determine the RGB values? Perhaps there is something within
POV-Ray itself that I have overlooked?


Post a reply to this message

From: Ross
Subject: Re: Dealing with colours
Date: 14 Mar 2006 17:31:22
Message: <4417443a@news.povray.org>
"ChaoZ" <nomail@nomail> wrote in message
news:web.44174154bedb9510f039f4f00@news.povray.org...
> As much as I try, I find it so difficult to deal with RGB colors in a 0 to
1
> scale. When it comes with dealing with colour maps (such as those used to
> create a sky for example) my confusion is compounded.
>
> For example, what does this
>
> 0.50 rgb <0.1, 0.2, 1>*0.9
>
> mean? It is used within a color map statement, so I assume a portion of
the
> map will have that colour.
>
> I have read the POV-Ray manual and I am no clearer. Are there tools out
> there to help determine the RGB values? Perhaps there is something within
> POV-Ray itself that I have overlooked?
>
>

You are correct, the 0.50 does tell you that part of the map will have this
color.

If it's really the 0..1 scale that you don't like, you can use anything as
an upper bound really and then divide the vector by that number. <124, 255,
40>/255

But if visualizing what color this will make is the problem, you could use
something like the GIMP (http://www.gimp.org/) which has a color picker that
displays the RGB componants. There are other standalone tools as well.
Someone in these groups has developed a tool called POVColor that might be
usefull: http://www.sourceforge.net/projects/povcolor

-r


Post a reply to this message

From: helge h
Subject: Re: Dealing with colours
Date: 14 Mar 2006 21:15:00
Message: <web.441777ae2ff0c10f1c6902970@news.povray.org>
"ChaoZ" <nomail@nomail> wrote:
> As much as I try, I find it so difficult to deal with RGB colors in a 0 to 1
> scale. When it comes with dealing with colour maps (such as those used to
> create a sky for example) my confusion is compounded.
>
> For example, what does this
>
> 0.50 rgb <0.1, 0.2, 1>*0.9
>
> mean? It is used within a color map statement, so I assume a portion of the
> map will have that colour.
>
> I have read the POV-Ray manual and I am no clearer. Are there tools out
> there to help determine the RGB values? Perhaps there is something within
> POV-Ray itself that I have overlooked?

At the end of colors.inc (in the include folder in the POV-Ray main folder)
there are some macros that convert colors in different formats (HSB to RGB
etc.).

H


Post a reply to this message

From: Mike Williams
Subject: Re: Dealing with colours
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

From: helge h
Subject: Re: Dealing with colours
Date: 15 Mar 2006 07:40:00
Message: <web.44180a532ff0c10f1c6902970@news.povray.org>
Mike Williams <nos### [at] econymdemoncouk> wrote:

> 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.

A tiny correction: you must divide by 255, not 256. The highest value is
255, and that corresponds to 1.0.

H


Post a reply to this message

From: ChaoZ
Subject: Re: Dealing with colours
Date: 16 Mar 2006 10:05:01
Message: <web.44197dce2ff0c10ff039f4f00@news.povray.org>
"helge_h" <nomail@nomail> wrote:
> Mike Williams <nos### [at] econymdemoncouk> wrote:
>
> > 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.
>
> A tiny correction: you must divide by 255, not 256. The highest value is
> 255, and that corresponds to 1.0.
>
> H

Thanks all. These tips helped a lot (especially that colour tool).

One final thing, is it possible to use CMYK values in POVRay? The biggest
problem I was having was controlling the lightness and darkness of a
colour.


Post a reply to this message

From: kurtz le pirate
Subject: Re: Dealing with colours
Date: 16 Mar 2006 14:53:22
Message: <kurtzlepirate-DE95B4.20532216032006@news.povray.org>
In article <web.44197dce2ff0c10ff039f4f00@news.povray.org>,
 "ChaoZ" <nomail@nomail> wrote:

> One final thing, is it possible to use CMYK values in POVRay? The biggest
> problem I was having was controlling the lightness and darkness of a
> colour.


strange thing... cmyk space is for print. of corse you can always use 
any space colors en pov in writing small macro to switch for one space 
to an other.


from <http://en.wikipedia.org/wiki/CMYK> Converting CMYK to RGB

To convert, we first convert CMYK to CMY, then convert the CMY value to 
RGB. Converting now tCMYK = {C,M,Y,K}

then
  tCMY = {C',M',Y'} = {C(1 - K) + K,M(1 - K) + K,Y(1 - K) + K}
and
  tRGB = {R,G,B} = {1 - C',1 - M',1 - Y'}
or substituting in
  tRGB = {1 - (C(1 - K) + K),1 - (M(1 - K) + K),1 - (Y(1 - K) + K)}
       = {1 - C(1 - K) - K, 1 - M(1 - K) - K, 1 - Y(1 - K) - K} 

suppose you declare your macro like that :
#macro cmyk2rgb(cc,mm,yy,kk)
  ...hard compute here...
  rgb<rr,gg,bb>
#end

you can now use cmyk space in pigment : 





-- 
klp


Post a reply to this message

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