color property
[This documentation is preliminary and is subject to change.]
Sets or retrieves the color of the text of the object.
Syntax
Integer value = object.put_color(Variant v);Integer value = object.get_color(Variant* sColor);
Property values
Type: VARIANT
One of the color names or RGB values in the BUGBUG! missing link text: ie.Color_Table.
String format
<color>
CSS information
| Applies To | All elements |
|---|---|
| Media | visual |
| Inherited | 1 |
| Initial Value |
Remarks
These are different ways to specify a color—in this example, red.
EM { color: red } /* natural language / CNS */
EM { color: #F00 } /* #RGB */
EM { color: #FF0000 } /* #RRGGBB */
EM { color: rgb(1.0,0.0,0.0) } /* float range: 0.0 - 1.0 */
EM { color: rgb(100%,0%,0%) ] /* float range: 0.0 - 100.0 */
Some browsers do not recognize color names, but all browsers should recognize RGB color values and display them correctly.
In Windows CE, specifying a value for the color property of the OPTION element when applied through the style object has no effect.
Windows Internet Explorer 9 introduces support for the RGBA, HSL, and HSLA color models.
In Internet Explorer 9, the RGB color model has been extended to include an alpha channel, or transparency. The format of an RGBA value is rgba(red,green,blue,alpha). The red, green, and blue components are identical to those of the RGB color model, and are expressed as integers or percentages. The alpha component is expressed as a value between 0.0 (completely transparent) and 1.0 (completely opaque).
Internet Explorer 9 supports hue-saturation-lightness (HSL) color values. The format of an HSL value is hsl(hue,saturation,lightness). In the HSL color model, "hue" is defined as the indicated color's angle on the color wheel (for instance, red is 0 or 360, green is 120, blue is 240, and so on). "Saturation" and "lightness" are expressed as percentages.
Internet Explorer 9 also extends the HSL color model with an alpha channel. As with the RGBA model, the alpha channel is expressed as a value between 0.0 and 1.0. The format of an HSLA value is hsla(hue,saturation,lightness,alpha).
Requirements
|
Minimum supported client | Windows XP |
|---|---|
|
Minimum supported server | Windows Server 2003 |
|
Header |
|
|
DLL |
|
See also
Build date: 1/23/2012