1 | ;+ |
---|
2 | ; |
---|
3 | ; @file_comments |
---|
4 | ; Fastest than type loadct, file = 'palette.tbl' |
---|
5 | ; |
---|
6 | ; @categories |
---|
7 | ; Graphics, Color |
---|
8 | ; |
---|
9 | ; @param numpal {in}{optional} |
---|
10 | ; number of the color palette we want to select in the file palette.tbl |
---|
11 | ; |
---|
12 | ; @keyword LIGHTNESS |
---|
13 | ; a scalar used to change the Lightness of the color |
---|
14 | ; palette to be able to adjust according to the printer we use, |
---|
15 | ; the media (paper or slide)... |
---|
16 | ; lightness < 1 to get lighter colors |
---|
17 | ; > 1 to get darker colors |
---|
18 | ; |
---|
19 | ; @keyword FILE {default='palette.tbl'} |
---|
20 | ; The file containing the color palette. It can be in any directory of the !path |
---|
21 | ; |
---|
22 | ; @keyword GET_NAME |
---|
23 | ; Set this keyword to a named variable in which the names of the color tables |
---|
24 | ; are returned as a string array. No changes are made to the color table. |
---|
25 | ; |
---|
26 | ; @keyword _EXTRA |
---|
27 | ; Used to pass keywords to <proidl>LOADCT</proidl> |
---|
28 | ; |
---|
29 | ; @history |
---|
30 | ; |
---|
31 | ; - pinsardf 20120814T142936Z curie51.c-curie.tgcc.ccc.cea.fr (Linux) |
---|
32 | ; |
---|
33 | ; * not anymore set_plot, 'x' when !d.name = 'z' |
---|
34 | ; |
---|
35 | ; Sebastien Masson (smasson\@lodyc.jussieu.fr) |
---|
36 | ; 30/3/1999: add extra |
---|
37 | ; 6/7/1999: mac/windows compatibility |
---|
38 | ; |
---|
39 | ; @version |
---|
40 | ; $Id$ |
---|
41 | ; |
---|
42 | ;- |
---|
43 | PRO lct, numpal, FILE=file, GET_NAME=get_name, LIGHTNESS=lightness, _EXTRA=ex |
---|
44 | ; |
---|
45 | compile_opt idl2, strictarrsubs |
---|
46 | ; |
---|
47 | ; definition of the name of the file containing colors palettes. |
---|
48 | if keyword_set(file) then nametbl = file ELSE nametbl = 'palette.tbl' |
---|
49 | ; look for nametbl file |
---|
50 | nametbl = find(nametbl, /firstfound, /nopro) |
---|
51 | if nametbl NE 'NOT FOUND' then BEGIN |
---|
52 | if n_elements(ex) NE 0 then $ |
---|
53 | if (where(tag_names(ex) EQ 'FILE'))[0] NE -1 then ex.FILE = nametbl |
---|
54 | ; |
---|
55 | if arg_present(get_name) then begin |
---|
56 | if n_elements(numpal) EQ 0 then $ |
---|
57 | loadct, file = nametbl, GET_NAME = get_name, _EXTRA = ex $ |
---|
58 | ELSE loadct, numpal, file = nametbl, /silent, GET_NAME = get_name, _EXTRA = ex |
---|
59 | ENDIF ELSE BEGIN |
---|
60 | if n_elements(numpal) EQ 0 then loadct, file = nametbl, _EXTRA = ex $ |
---|
61 | ELSE loadct, numpal, file = nametbl, /silent, _EXTRA = ex |
---|
62 | ENDELSE |
---|
63 | ; |
---|
64 | if !d.name EQ 'PS' AND keyword_set(lightness) then palit, lightness |
---|
65 | ; |
---|
66 | ENDIF ELSE ras = report('The file containing the color palettes doesn''t exist...') |
---|
67 | |
---|
68 | return |
---|
69 | end |
---|