Re: RGB values for visible spectrum? [message #18988] |
Tue, 22 February 2000 00:00 |
Struan Gray
Messages: 178 Registered: December 1995
|
Senior Member |
|
|
Kenneth P. Bowman, kbowman@null.net writes:
> I wrote:
>>
>> Does anyone have a set of RGB values matched to
>> the colours of the visible spectrum?
>
> As a start you can do something like:
>
> [ramp the hue coordinate in a HSL array]
That's where I am at present. My next step will be to scan one of
those wallchart spectra, but I was hoping someone would have someting
more respectable. Thanks for the tip.
Struan
|
|
|
Re: RGB values for visible spectrum? [message #18996 is a reply to message #18988] |
Mon, 21 February 2000 00:00  |
kbowman
Messages: 5 Registered: February 2000
|
Junior Member |
|
|
In article <88rkt3$f2r$1@news.lth.se>, Struan Gray
<struan.gray@sljus.lu.se> wrote:
> Does anyone have a set of RGB values matched to the colours of the
> visible spectrum? It doesn't have to be tied to a well-defined colour
> space, although that would be nice. I want to construct a 'photon
> energy' object that can convert between different units (cm-1, eV, nm,
> kJMol) and give the user an RGB triple that is a reasonably close
> match to the specified wavelength.
As a start you can do something like:
n = 200L ;Number of colors
h = 240.0*FINDGEN(n)/n ;Generate rainbow in hsv space
s = REPLICATE(1.0, n) ;Saturation = 1
v = REPLICATE(1.0, n) ;Value = 1
COLOR_CONVERT, h, s, v, r, g, b, /HSV_RGB ;Convert to RGB
TV, REPLICATE(1.0, n) # r, 0, 0, 1 ;Load red 2-D image
TV, REPLICATE(1.0, n) # g, 0, 0, 2 ;Load green 2-D image
TV, REPLICATE(1.0, n) # b, 0, 0, 3 ;Load blue 2-D image
Ken
|
|
|