9srv Manual Collection/plan9/color(2) | 9srv Manual Collection/plan9/color(2) |
---|
int rgb2cmap(int red, int green, int blue)
int cmap2rgb(int col)
int cmap2rgba(int col)
Rgb2cmap takes a trio of color values, scaled from 0 (no intensity) to 255 (full intensity), and returns the index of the color in RGBV closest to that represented by those values.
Cmap2rgb decomposes the color of RGBV index col and returns a 24-bit integer with the low 8 bits representing the blue value, the next 8 representing green, and the next 8 representing red. Cmap2rgba decomposes the color of RGBV index col and returns a 32-bit integer with the low 8 bits representing an alpha value, defined to be 255, and the next 8 representing blue, then green, then red, as for cmap2rgba shifted up 8 bits. This 32-bit representation is the format used by draw(2) and memdraw(2) library routines that take colors as arguments.
9srv Manual Collection/plan9/color(2) | Rev: Sun Dec 02 23:42:20 GMT 2007 |