Archived

This topic is now archived and is closed to further replies.

some_guy

A Palette for the Visible Spectrum?

Recommended Posts

some_guy    122
I want to create a lookup table of an undetermined number of elements in which the elements correspond to colors in the visible spectrum. The only way I can figure is to just create 8 separate sections of colors - red, orange, yellow, green, blue, indigo, violet, and then greyscale. I figure, though, that it wouldn''t be accurate...the colors would sort of jump from one to another between sections. What would be a good way to set it up? (Or if someone has a table of about 64-256 elements in RGB form of the spectrum, that would do also do nicely.)

Share this post


Link to post
Share on other sites
ZealousElixir    256
Let's think. Here's a look at the default pallette from Paint Shop Pro, a total of 3908 colors when it's stored losslessly:


As you can see, each row can be considered a "color", with all its hues progressively becoming lighter (left->right). Therefore, you decide how many elements you want, and you create an array, sampling from a table like this by determining what color you want (a periodic function) and multiplying it by the current luminance (an incrementing value).

Something like that.

Later,
ZE.

//email me.//zealouselixir software.//msdn.//n00biez.//
miscellaneous links

[if you have a link proposal, email me.]

[edited by - zealouselixir on March 19, 2002 2:12:36 AM]

Share this post


Link to post
Share on other sites
a person    118
simple use hue sat luminece instead of rgb values. this way when you are going through your grid you just need to update the hue/sat/lum and you will get the colors you want.

for an image like below, just make the x direction lum. y direction hue, and sat can be left at some predetermined value.

Share this post


Link to post
Share on other sites
LessBread    1415
The rgb color model has limitations viz "the entire visible spectrum". I like HSL better (even though it has to be rendered in rgb). sat and lum are much easier to use intuitively, imo.

Share this post


Link to post
Share on other sites