comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: RGB values for visible spectrum?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: RGB values for visible spectrum? [message #18996 is a reply to message #18988] Mon, 21 February 2000 00:00 Go to previous message
kbowman is currently offline  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
[Message index]
 
Read Message
Read Message
Previous Topic: Re: object theoretical question
Next Topic: Cholesky factorisation

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Thu Oct 30 01:02:25 PDT 2025

Total time taken to generate the page: 0.72166 seconds