1 Overview
2 COM
3 Active X and DHTML
4 Version
Index
Version: 4.0.2

 

3.4.4 Colors

Many element properties represent colors. In HTML, colors may be represented by an RGB string, which contains 7 characters. The first character is #, the rest are hexadecimal digits (0-9 and a-f or A-F); the first two digits are for the red component of the color, the middle two for the green component, and the last two for the blue component. For example, "#FFFFFF" is white, "#000000" is black, and "#00FF00" is green.

There are also predefined color names. The -native methods use these names in strings, while their nonnative counterpart methods use the names as symbols.

The predefined color names are:

  aliceblue antiquewhite aqua aquamarine azure

  beige bisque black blanchedalmond blue

  blueviolet brown burlywood cadetblue chartreuse

  chocolate coral cornflower cornsilk crimson cyan

  darkblue darkcyan darkgoldenrod darkgray

  darkgreen darkkhaki darkmagenta darkolivegreen

  darkorange darkorchid darkred darksalmon

  darkseagreen darkslateblue darkslategray

  darkturquoise darkviolet deeppink deepskyblue

  dimgray dodgerblue firebrick floralwhite

  forestgreen fuchsia gainsboro ghostwhite gold

  goldenrod gray green greenyellow honeydew

  hotpink indianred indigo ivory khaki lavender

  lavenderblush lawngreen lemonchiffon lightblue

  lightcoral lightcyan lightgoldenrodyellow

  lightgreen lightgray lightpink lightsalmon

  lightseagreen lightskyblue lightslategray

  lightsteelblue lightyellow lime limegreen linen

  magenta maroon mediumaquamarine mediumblue

  mediumorchid mediumpurple mediumseagreen

  mediumslateblue mediumspringgreen

  mediumturquoise mediumvioletred midnightblue

  mintcream mistyrose moccasin navajowhite navy

  oldlace olive olivedrab orange orangered orchid

  palegoldenrod palegreen paleturquoise

  palevioletred papayawhip peachpuff peru pink

  plum powderblue purple red rosybrown royalblue

  saddlebrown salmon sandybrown seagreen seashell

  sienna silver skyblue slateblue slategray snow

  springgreen steelblue tan teal thistle tomato

  turquoise violet wheat white whitesmoke yellow

  yellowgreen