3 cmap2rgb, cmap2rgba, rgb2cmap \- colors and color maps
12 int rgb2cmap(int red, int green, int blue)
18 int cmap2rgba(int col)
20 These routines convert between `true color' red/green/blue triples and the Plan 9 color map.
23 for a description of RGBV, the standard color map.
26 takes a trio of color values, scaled from 0 (no intensity) to 255 (full intensity),
27 and returns the index of the color in RGBV closest to that represented
31 decomposes the color of RGBV index
33 and returns a 24-bit integer with the low 8 bits representing the blue value,
34 the next 8 representing green, and the next 8 representing red.
36 decomposes the color of RGBV index
38 and returns a 32-bit integer with the low 8 bits representing an alpha value,
40 and the next 8 representing blue, then green, then red, as for
43 This 32-bit representation is the format used by
48 take colors as arguments.