1RAS_PALETTE(5NCARG) NCAR GRAPHICS RAS_PALETTE(5NCARG)
2
3
4
6 ras_palette - format descriptions for palette files for NCAR View
7
9 palette_file.pal
10 palette_file.txt
11
13 NCAR View supports a binary as well as a textual format for color pal‐
14 ettes.
15
16 The binary format is compatible with NCSA HDF and must have a file
17 extension of ".pal". The palette has a red, a green, and a blue table,
18 each with 256 single unsigned byte entries. A 0 represents no intensity
19 for a given color, and a 255 full intensity. In the file, the palette
20 is stored as:
21
22 R0 R1 ... R255 G0 G1 ... G255 B0 B1 ... B255
23
24 for a total of 768 bytes.
25
26 The textual format can be created by a program or manually with a text
27 editor. It provides for 256 RGB entries but also allows for a sparse
28 color table. In the latter case, missing values are calculated from
29 those provided using linear interpolation. If unspecified, the 0 entry
30 defaults to black and the 255 entry to white. Each color palette entry
31 has the following format:
32
33 index_number red green blue
34
35 where index_number, red, green, and blue are all integers in the range
36 0 to 255.
37
39 All of the examples below deal with textual color palettes.
40
41 Setting Entries
42
43 Set color index 0 to black.
44 0 0 0 0
45
46 Set color index 255 to white
47 255 255 255 255
48
49 Grayscale Ramp
50
51 Let's suppose you have a file named "my.txt" and it has just two
52 lines in it: the black entry and the white entry from above.
53 This will produce a grayscale color palette, where the table
54 starts at black and ramps up to white; since only entries 0 and
55 255 are specified, the remaining indicies are interpolated.
56 0 0 0 0
57 255 255 255 255
58
59 (Note: An empty palette file (e.g. "empty.txt") is legal and,
60 since the 0 index defaults to black and the 255 index to white,
61 produces a grayscale ramp just as in the above example.)
62
63 Temperature Color Scale
64
65 Let's suppose you want entry 0 to be black, and the remaining
66 indices to start at 1 with a fully-saturated blue and shift lin‐
67 early to 255 with a fully-saturated red. Only three entries are
68 required in your file, "temp.txt".
69 0 0 0 0
70 1 0 0 255
71 255 255 0 0
72
74 rasview(1NCARG),rascat(1NCARG),rasgetpal(1NCARG), rass‐
75 plit(1NCARG),rasls(1NCARG),ras_formats(5NCARG)
76
78 Color palettes are only useful with indexed-color imagery.
79
81 Copyright (C) 1987-2009
82 University Corporation for Atmospheric Research
83
84 The use of this Software is governed by a License Agreement.
85
86
87
88NCARG January 1993 RAS_PALETTE(5NCARG)