SamuelT wrote:
>
> It's for the eval_pigment stuff I've been using. I needed to convert a color
> vector into a float value so I could use it for elevation. The best way I
> could think of doing this would be averaging the components of the color
> vector. I'm now using a macro instead of vlength, and it works great.
I see that Ron Parker and Warp already have suggested some conversion
formulas for your problem.
Here are links to some more info about such formulas:
http://www.neuro.sfc.keio.ac.jp/~aly/polygon/info/color-space-faq.html
(Look at the end of item 5.2 - HSL, HSV)
(Rewritten html version of above page ?)
http://members.xoom.fr/scorpion/docs/txt/color_faq.html
(9.2 - Color look-up table to a gray scales)
http://www.inforamp.net/~poynton/notes/colour_and_gamma/ColorFAQ.html#RTFToC9
Tor Olav
--
mailto:tor### [at] hotmail com
http://www.crosswinds.net/~tok/tokrays.html
Post a reply to this message
|