RGB Color Codes
[Previous] [Main] [Next]

 
Color values take the form of hexadecimal red-green-blue (RGB) triplets. HTML allows documents to customize the color of various page elements, including background color, text color, link color, active link color, and visited link color.  
 
The table below lists commonly used RGB codes as defined in the html++ header files, but you may define any desired color or shade by tailoring the individual values.  

html++ #define      RGB code  
COLOR_DEFAULT      ff000000 (special case)  
COLOR_BLACK      000000  
COLOR_WHITE      ffffff  
COLOR_RED         ff0000  
COLOR_BLUE         0000ff  
COLOR_GREEN      00ff00  
COLOR_YELLOW      ffff00  
COLOR_MAGENTA      ff00ff  
COLOR_CYAN         00ffff  
COLOR_BRASS      b5a642  
COLOR_BRONZE      a62a2a  
COLOR_COPPER      b87333  
COLOR_DARK_BROWN      5c4033  
COLOR_DARK_GREEN      2f4f2f  
COLOR_DARK_PURPLE      871f78  
COLOR_DARK_BLUE      6b238e  
COLOR_DARK_GREY      2f4f4f  
COLOR_DARK_TAN      97694f  
COLOR_DIM_GREY      545454  
COLOR_FOREST_GREEN   238e23  
COLOR_GOLD         cd7f32  
COLOR_GREY         c0c0c0  
COLOR_INDIAN_RED      4e2f2f  
COLOR_KHAKI      9f9f5f  
COLOR_LIGHT_BLUE      c0d9d9  
COLOR_LIGHT_GREY      a8a8a8  
COLOR_LIGHT_GREEN      32cd32  
COLOR_MAROON      8e236b  
COLOR_NAVY_BLUE      23238e  
COLOR_NEON_BLUE      4d4dff  
COLOR_NEON_PINK      ff6ec7  
COLOR_ORANGE      ff7f00  
COLOR_PINK         bc8f8f  
COLOR_SEA_GREEN      238e68  
COLOR_SILVER      e6e8fa  
COLOR_SKY_BLUE      3299cc  
COLOR_STEEL_BLUE      236b8e  
COLOR_TURQUOISE      adeaea  
COLOR_VIOLET      4f2f4f  
 
Some browsers, including Netscape Navigator and Microsoft Internet Explorer, recognize text versions of certain color names. All color-related methods in html++ require a ColorType argument. You can, however, specify the text versions of color names using the htmlObject::SetAttribute() base-class method with the particular attribute name. For example:  
   htmlTableRow  row ;  
   row.SetAttribute( "BGCOLOR", "red" ) ;  
 
is equivalent to:  
   htmlTableRow  row ;  
   row.BackgroundColor( COLOR_RED ) ;  
 
The table below lists commonly used color names as recognized by Netscape Navigator and Microsoft Internet Explorer. To see the actual colors using a browser, visit the web site:  
http://developer.netscape.com/library/documentation/htmlguid/colortab.htm  
 
antiquewhite        green           orchid  
aqua           greenyellow        palegoldenrod  
aquamarine        honeydew        palegreen  
azure        hotpink           paleturquoise  
beige        indianred        palevioletred  
bisque        indigo           papayawhip  
black        ivory           peachpuff  
blanchedalmond     khaki           peru  
blue           lavender           pink  
blueviolet       lavenderblush        plum  
brown        lawngreen        powderblue  
burlywood        lemonchiffon        purple  
cadetblue        lightblue           red  
chartreuse        lightcoral        rosybrown  
chocolate        lightcyan        royalblue  
coral           lightgoldenrodyellow    saddlebrown  
cornflowerblue        lightgreen        salmon  
cornsilk        lightgrey           sandybrown  
crimson        lightpink           seagreen  
cyan           lightsalmon        seashell  
darkblue        lightseagreen        sienna  
darkcyan        lightskyblue        silver  
darkgoldenrod        lightslategray        skyblue  
darkgray        lightsteelblue        slateblue  
darkgreen        lightyellow        slategray  
darkkhaki        lime           snow  
darkmagenta        limegreen        springgreen  
darkolivegreen        linen           steelblue  
darkorange        magenta           tan  
darkorchid        maroon           teal  
darkred        mediumaquamarine     thistle  
darksalmon        mediumblue        tomato  
darkseagreen        mediumorchid        turquoise  
darkslateblue        mediumpurple        violet  
darkslategray        mediumseagreen        wheat  
darkturquoise        mediumslateblue        white  
darkviolet        mediumspringgreen     whitesmoke  
deeppink        mediumturquoise        yellow  
deepskyblue        mediumvioletred        yellowgreen  
dimgray        midnightblue      
dodgerblue        mintcream      
firebrick        mistyrose      
floralwhite        moccasin      
forestgreen        navajowhite      
fuchsia        navy      
gainsboro        oldlace      
ghostwhite        olive      
gold           olivedrab      
goldenrod        orange  
gray            orangered  
 


©1998 DC Micro Development. All rights reserved.
No portion of this document may be c opied or reproduced without expressed written consent.
html++ is a trademark of DC Micro Development.