Set Color Map
Purpose
The Set Color Map function sets up a list of colors (a map) to be used when displaying images or when selected by the Set Color opcode.
Syntax
Opcode format | Opcode | Operand Format | Comments |
Extended ASCII | (ColorMap | <ws><ICount>[<ws><IRi>,<IGi>,<IBi>,<IAi>]+[<ws>]) | Defines a Color Map of RGBA colors |
Extended Binary | 0x0001 | <Bcount>[<BRi><BGi><BBi><BAi>]+} | Defines a Color Map of RGBA colors |
Count The number of colors to be defined in this Color Map. Legal values range from 1 to 256, when using the ASCII version, or 0 to 255 when using the binary form, with zero indicating a colormap of size 256.
Ri, Gi, Bi, Ai The definition of the ith color (the red, green, blue, and alpha components) in the Color Map.
Details
A color map is a list of colors which are not used directly, but are indirectly selected by either the Draw Image or the Set Color opcodes.
Notes
A count of zero indicates that a color map with 256 entries is being defined (since the number 256 can not be encoded in a single byte count).
Note that the minimum allowed colormap size is one color (not zero).
Generally the Set Color Map opcode is used a maximum of one time in a .dwf file, and normally it is used before any Set Color opcodes.
Although it is legal to specify multiple color maps in a .dwf file, this should be avoided. On many systems and with many .dwf file reading applications, the color map is a limited global resource such that subsequent color map changes may affect previously drawn primitives.
On sufficiently advanced systems and with proper DWF reading applications, changing the color map attribute should affect only drawing primitives that follow, not drawings that are performed prior to the color map change.
Default
The default value for the color map attribute is a 256 color map as defined by the following opcode:
(ColorMap 256 0,0,0,255 255,0,0,255 255,255,0,255 0,255,0,255 0,255,255,255
0,0,255,255 255,0,255,255 0,0,0,255 128,128,128,255 220,220,220,255
255,0,0,255 255,127,127,255 221,0,0,255 221,110,110,255 184,0,0,255
184,92,92,255 149,0,0,255 149,74,74,255 114,0,0,255 114,57,57,255
255,63,0,255 255,159,127,255 221,55,0,255 221,138,110,255 184,46,0,255
184,115,92,255 149,37,0,255 149,93,74,255 114,28,0,255 114,71,57,255
255,127,0,255 255,191,127,255 221,110,0,255 221,165,110,255 184,92,0,255
184,138,92,255 149,74,0,255 149,112,74,255 114,57,0,255 114,86,57,255
255,191,0,255 255,223,127,255 221,165,0,255 221,193,110,255 184,138,0,255
184,161,92,255 149,112,0,255 149,131,74,255 114,86,0,255 114,100,57,255
255,255,0,255 255,255,127,255 221,221,0,255 221,221,110,255 184,184,0,255
184,184,92,255 149,149,0,255 149,149,74,255 114,114,0,255 114,114,57,255
191,255,0,255 223,255,127,255 165,221,0,255 193,221,110,255 138,184,0,255
161,184,92,255 112,149,0,255 131,149,74,255 86,114,0,255 100,114,57,255
127,255,0,255 191,255,127,255 110,221,0,255 165,221,110,255 92,184,0,255
138,184,92,255 74,149,0,255 112,149,74,255 57,114,0,255 86,114,57,255
63,255,0,255 159,255,127,255 55,221,0,255 138,221,110,255 46,184,0,255
115,184,92,255 37,149,0,255 93,149,74,255 28,114,0,255 71,114,57,255
0,255,0,255 127,255,127,255 0,221,0,255 110,221,110,255 0,184,0,255
92,184,92,255 0,149,0,255 74,149,74,255 0,114,0,255 57,114,57,255
0,255,63,255 127,255,159,255 0,221,55,255 110,221,138,255 0,184,46,255
92,184,115,255 0,149,37,255 74,149,93,255 0,114,28,255 57,114,71,255
0,255,127,255 127,255,191,255 0,221,110,255 110,221,165,255 0,184,92,255
92,184,138,255 0,149,74,255 74,149,112,255 0,114,57,255 57,114,86,255
0,255,191,255 127,255,223,255 0,221,165,255 110,221,193,255 0,184,138,255
92,184,161,255 0,149,112,255 74,149,131,255 0,114,86,255 57,114,100,255
0,255,255,255 127,255,255,255 0,221,221,255 110,221,221,255 0,184,184,255
92,184,184,255 0,149,149,255 74,149,149,255 0,114,114,255 57,114,114,255
0,191,255,255 127,223,255,255 0,165,221,255 110,193,221,255 0,138,184,255
92,161,184,255 0,112,149,255 74,131,149,255 0,86,114,255 57,100,114,255
0,127,255,255 127,191,255,255 0,110,221,255 110,165,221,255 0,92,184,255
92,138,184,255 0,74,149,255 74,112,149,255 0,57,114,255 57,86,114,255
0,63,255,255 127,159,255,255 0,55,221,255 110,138,221,255 0,46,184,255
92,115,184,255 0,37,149,255 74,93,149,255 0,28,114,255 57,71,114,255
0,0,255,255 127,127,255,255 0,0,221,255 110,110,221,255 0,0,184,255
92,92,184,255 0,0,149,255 74,74,149,255 0,0,114,255 57,57,114,255
63,0,255,255 159,127,255,255 55,0,221,255 138,110,221,255 46,0,184,255
115,92,184,255 37,0,149,255 93,74,149,255 28,0,114,255 71,57,114,255
127,0,255,255 191,127,255,255 110,0,221,255 165,110,221,255 92,0,184,255
138,92,184,255 74,0,149,255 112,74,149,255 57,0,114,255 86,57,114,255
191,0,255,255 223,127,255,255 165,0,221,255 193,110,221,255 138,0,184,255
161,92,184,255 112,0,149,255 131,74,149,255 86,0,114,255 100,57,114,255
255,0,255,255 255,127,255,255 221,0,221,255 221,110,221,255 184,0,184,255
184,92,184,255 149,0,149,255 149,74,149,255 114,0,114,255 114,57,114,255
255,0,191,255 255,127,223,255 221,0,165,255 221,110,193,255 184,0,138,255
184,92,161,255 149,0,112,255 149,74,131,255 114,0,86,255 114,57,100,255
255,0,127,255 255,127,191,255 221,0,110,255 221,110,165,255 184,0,92,255
184,92,138,255 149,0,74,255 149,74,112,255 114,0,57,255 114,57,86,255
255,0,63,255 255,127,159,255 221,0,55,255 221,110,138,255 184,0,46,255
184,92,115,255 149,0,37,255 149,74,93,255 114,0,28,255 114,57,71,255
84,84,84,255 118,118,118,255 152,152,152,255 186,186,186,255 220,220,220,255
255,255,255,255)
Implementation in WHIP! Versions
Toolkit Function |
TBD |
Partial |
Full |
Revised in |
Set Color Map |
- |
0.2x, 0.5x |
1.03 |
- |
See Also
Set Color, and Draw Image