section of routines in torgb.i

functions in torgb.i -

 
 
 
torgb


             rgb = torgb(name)  
            name = torgb(rgb)  
 
    returns [r,g,b] corresponding to color NAME.  If NAME is an array of  
    strings, return value will be 3-by-dimsof(NAME).  The color names are  
    the colors defined in the W3C standard for SVG and CSS level 3, which  
    are supported by nearly all Web browsers.  With four exceptions, they  
    match the X11 colors contained in rgb.txt: Gray, Green, Maroon, and  
    Purple are substantially darker in W3C than in X11.  W3C also defines  
    the colors Lime and Silver, which are not in the X11 rgb.txt (although  
    Lime in W3C is the same color as Green in X11).  You can specify the  
    x11=1 keyword to get the X11 values for the four disputed defintions.  
    You can also specify hex=1 to return rgb packed as 0xrrggbb into a  
    single value of type long.  There are 140 color names (but only 138  
    unique colors, see quirk 2 below).  
    
    The name lookup is case insensitive, and you may spell any color  
    containing "gray" as "grey".  
    
    The torgb function also performs approximate "inverse lookup" if you  
    specify rgb (either as [r,g,b] or as 0xrrggbb), returning the nearest  
    named color in CIE LUV space.  
    
    See http://en.wikipedia.org/wiki/X11_color_names for color patches;  
    http://www.centerkey.com/colors/ is a nice selection tool.  
    
    Quirks:  
    1. W3C's DarkGray is significantly lighter than it's Gray, because  
       DarkGray matches the X11 color while Gray does not.  
    2. Aqua is identical to Cyan and Fuchsia is identical to Magenta.  
    3. The following 16 colors are the original pre-HTML 4 colors,  
       also the oldest VGA/CGA colors: White Silver Gray Black Red Maroon  
       Yellow Olive Lime Green Aqua Teal Blue Navy Fuchsia Purple  
    
SEE ALSO: color,   cmap