1 Author: Ole Streicher <olebole@debian.org>
2 Description: Use loadct in cgloadct if no file is specified.
3 GDL does not shipt with a color table "colors1.tbl", so in the case
4 that no file name is specified, fall back to loadct instead of trying to
9 ; If this keyword is set to a named variable, the color table is returned as an
\r
10 ; [NCOLORS,3] array and no colors are loaded in the display.
\r
11 ; filename: in, optional, type='string'
\r
12 -; The name of a color table file to open. By default colors1.tbl in the IDL
\r
13 -; resource directory.
\r
14 +; The name of a color table file to open. By default the gdl standard
16 ; get_names: out, optional, type='string'
\r
17 ; If set to a named variable, the names of the color tables are returned
\r
18 ; and no colors are loaded in the display. Note that RGB_TABLE cannot be
\r
21 Help, LAST_MESSAGE=1, OUTPUT=traceback
\r
22 Help, Calls=callStack
\r
23 - callingRoutine = (StrSplit(StrCompress(callStack[1])," ", /Extract))[0]
\r
25 - Print, 'Traceback Report from ' + StrUpCase(callingRoutine) + ':'
\r
26 + Print,''+callStack
\r
27 + Print, 'Traceback Report from:'
\r
29 FOR j=0,N_Elements(traceback)-1 DO Print, " " + traceback[j]
\r
30 void = Dialog_Message(traceback[0], /Error, TITLE='Trapped Error')
\r
32 IF N_Elements(clip) EQ 0 THEN clip = [0,255]
\r
33 IF N_Elements(clip) EQ 1 THEN clip = [clip, 255]
\r
34 clip = 0 > clip < 255
\r
35 - IF N_Elements(file) EQ 0 THEN file = Filepath('colors1.tbl', SUBDIRECTORY=['resource', 'colors'])
\r
37 ; Try to locate the brewer file.
\r
38 IF Keyword_Set(brewer) THEN BEGIN
\r
39 - brewerfilepath = Filepath( ROOT_DIR=cgSourceDir(), 'fsc_brewer.tbl')
\r
40 + brewerfilepath = Filepath( ROOT_DIR='/usr/share/gnudatalanguage/coyote', 'fsc_brewer.tbl')
\r
41 brewerFile = File_Search(brewerfilepath, Count=count)
\r
42 IF count EQ 0 THEN BEGIN
\r
43 Message, 'Cannot find the Brewer color table file "fsc_brewer.tbl."' + $
\r
45 IF N_Elements(ncolors) EQ 0 THEN ncolors = !D.TABLE_SIZE - bottom
\r
46 reverse = KEYWORD_SET(reverse)
\r
48 + IF N_Elements(file) EQ 0 THEN BEGIN
49 + loadct, table, get_names=get_names, ncolors=ncolors, bottom=bottom, $
50 + silent=silent, rgb_table=ltable
51 + len = N_Elements(ltable)/3
53 + g = ltable[len:2*len-1]
54 + b = ltable[2*len:3*len-1]
56 ; Open and read the color table files.
\r
57 OPENR, lun, file, /GET_LUN
\r
66 r = r[clip[0]:clip[1]]
\r
73 - info.file = cgFindPathTo('fsc_brewer.tbl')
\r
74 + info.file = '/usr/share/gnudatalanguage/fsc_brewer.tbl'
\r