Re: Using the most colors in tvscl [message #6710] |
Thu, 08 August 1996 00:00  |
Peter Mason
Messages: 145 Registered: June 1996
|
Senior Member |
|
|
Sorry, I got something wrong in my previous posting:
> Plotting with many colours:
> You've probably noticed that some IDL graphics commands - like PLOT - appear
> to work strangely on Windows hi-color displays - they plot in red, if at all.
> This is because these commands don't put the specified colour index through
> the LUT, they just blast it out to the screen. As a colour index is normally
> 8-bit, it normally affects only the red plane.
> To get proper colours, use a 24-bit colour value instead of an 8-bit colour
> index.
> e.g.,
> tvlct,r,g,b,/get ;load the current LUT
> mylut=long(r)+long(g)*256L+long(b)*65536L
> plot,my_x,my_y,color=mylut(my_intended_color),...
> Since you're using a 24-bit colour value here, you can plot in as many colours
> as you like. (I've just used LUTs here to show how to get the plot to work
> as it does in 8-bit mode.)
Apparently the PLOT and PLOTS (etc) commands DO go through the LUT in Windows
hi-color modes, but they do so in a similar fashion to the TV command. That
is, the 24-bit colour value you specify is put through the current LUT (the low
8 bits through the red part, the middle 8 thru green etc) and the 24-bit output
is sent to the screen.
So if you want a plot to work as it does in 8-bit mode, all you have to do is:
plot,my_x,my_y,color=c+c*256L+c*65536L ;c being your 8-bit colour index
Peter Mason
|
|
|