A Palette for the Visible Spectrum?

Started by
3 comments, last by some_guy 22 years, 1 month ago
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.)
Advertisement
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]

[twitter]warrenm[/twitter]

The above method is totally messed-up. Forgive me, but maybe it will have some value...I just need sleep.

Later,
ZE.

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

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

[twitter]warrenm[/twitter]

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.
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.
"I thought what I'd do was, I'd pretend I was one of those deaf-mutes." - the Laughing Man

This topic is closed to new replies.

Advertisement