color man page on Plan9

Man page or keyword search:  
man Server   549 pages
apropos Keyword Search (all sections)
Output format
Plan9 logo
[printable version]

COLOR(2)							      COLOR(2)

NAME
       cmap2rgb, cmap2rgba, rgb2cmap - colors and color maps

SYNOPSIS
       #include <u.h>
       #include <libc.h>
       #include <draw.h>

       int  rgb2cmap(int red, int green, int blue)

       int  cmap2rgb(int col)

       int  cmap2rgba(int col)

DESCRIPTION
       These  routines convert between `true color' red/green/blue triples and
       the Plan 9 color map.  See color(6) for	a  description	of  RGBV,  the
       standard color map.

       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	 clos‐
       est 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 decom‐
       poses 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.

SOURCE
       /sys/src/libdraw

SEE ALSO
       graphics(2), allocimage(2), draw(2), image(6), color(6)

								      COLOR(2)
[top]
                             _         _         _ 
                            | |       | |       | |     
                            | |       | |       | |     
                         __ | | __ __ | | __ __ | | __  
                         \ \| |/ / \ \| |/ / \ \| |/ /  
                          \ \ / /   \ \ / /   \ \ / /   
                           \   /     \   /     \   /    
                            \_/       \_/       \_/ 
More information is available in HTML format for server Plan9

List of man pages available for Plan9

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net