pro MYCOLORS, invbaw=invbaw ;+ ; NAME: ; MYCOLORS ; ; PURPOSE: ; Set up a few colors into low numbers on the LUT for use in graphs ; ; NB : Black & White change roles when writing to PS!!! ; ; Resulting colors ; 0: Black ( White if \INVBAW ) ; 1: White ( Black if \INVBAW ) ; 2: Red ; 3: Green ; 4: Blue ; 5: Yellow ; 6: Cyan ; 7: Magenta ; 8: Pink ; 9: Light Green ; 10: Blue-ish ; 11: Cyan-ish ; 12: Magenta-ish ; 13: Green-ish ; 14: Yellow-ish ; 15: Cyan-ish ; 16-253: Unchanged ; 254: Black ( White if \INVBAW ) ; 255: White ( Black if \INVBAW ) ; ; CATEGORY: ; Graphics - Color Handling ; ; CALLING SEQUENCE: ; MYCOLORS ; ; KEYWORDS: ; INVBAW (BIT) : Invert Black & White (i.e. Background & Foreground Colors) in Colormap ; ; COMMON BLOCKS: ; COLORS ; ; SIDE EFFECTS: ; Changes LUT ; ; MODIFICATION HISTORY: ; 01 Jan 2001 Adapted from Seb Oliver's COLOURS by Mattia Vaccari ; 30 Oct 2004 Set color index 255 to white (Mattia Vaccari) ; 26 Jan 2006 Tinkered with 254 & 255 White/Black coloring (Mattia Vaccari) ; 05 Mar 2006 Tinkered with 254 & 255 White/Black coloring (Mattia Vaccari) ; 02 Jun 2008 Reworked (old and new) colors and \INVBAW added (Mattia Vaccari) ;- COMMON colors,r_orig,g_orig,b_orig,r_cur,g_cur,b_cur on_error,2 ; if a lookup table is not set load the black and white one if n_elements(r_orig) eq 0 then loadct,0 if not(keyword_set(invbaw)) then bw=[ 0B,255B] else bw=[255B, 0B] red= [ bw ,255B, 0B, 0B,255B, 0B,255B,255B,128B,128B, 0B,128B,128B,192B, 64B,192B] green=[ bw , 0B,255B, 0B,255B,255B, 0B,128B,255B,128B,128B, 0B,128B,192B,192B, 64B] blue= [ bw , 0B, 0B,255B, 0B,255B,255B,128B,128B,255B,128B,128B, 0B, 64B,192B,192B] if n_params() eq 0 then cmax=n_elements(red) ; print,cmax ; setting current (!new!) color table to have chosen colors (above) as first cmax elements and original colors thereafter r_cur=[ red[0:cmax-1],r_orig[cmax:*]] g_cur=[green[0:cmax-1],g_orig[cmax:*]] b_cur=[ blue[0:cmax-1],b_orig[cmax:*]] ; Black if not(keyword_set(invbaw)) then begin &$ r_cur[254]= 0B & g_cur[254]= 0B & b_cur[254]= 0B &$ ; r_cur[255]= 0B & g_cur[255]= 0B & b_cur[255]= 0B &$ endif else begin & r_cur[254]=255B & g_cur[254]=255B & b_cur[254]=255B &$ ; r_cur[255]=255B & g_cur[255]=255B & b_cur[255]=255B &$ endelse ; White if not(keyword_set(invbaw)) then begin &$ ; r_cur[254]=255B & g_cur[254]=255B & b_cur[254]=255B &$ r_cur[255]=255B & g_cur[255]=255B & b_cur[255]=255B &$ endif else begin & ; r_cur[254]= 0B & g_cur[254]= 0B & b_cur[254]= 0B &$ r_cur[255]= 0B & g_cur[255]= 0B & b_cur[255]= 0B &$ endelse TVLCT,r_cur,g_cur,b_cur ; setting original to current ; NB : No, I don't understand this either but it is the IDL standard way of doing things r_orig=r_cur g_orig=g_cur b_orig=b_cur end