[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

colors... again

I thought I understood colors in IDL. If I create a color plot in a direct
graphics window
then tvrd() and immediately tv it back, how come the colors are not right?

device, decomposed=0 & loadct, 13 & window
map_set,  30, -89, LIMIT=[27, -92, 33, -86], GRID=1
map_continents, /coasts, color=155, HIRES=hires ;GREEN
map_continents, /rivers, color=200, HIRES=hires ;YELLOW

;store the window's image
mapImage = tvrd()

;print the unique color indices that are in this image.
;should print 0 155 200 255 for black, green, yellow, and red in this color
IDL> print, mapImage[UNIQ(mapImage, SORT(mapImage))]
   0 255

Why only the 2 colors black and red??

tv, mapImage

shows it's true.