Sets or retrieves the color of the text in the object.
HRESULT IHTMLRenderStyle::get_textColor(VARIANT *p);HRESULT IHTMLRenderStyle::put_textColor(VARIANT v);
- Pointer to a variable of type VARIANT that receives one of the values listed in Possible Values.
- VARIANT that specifies one of the values listed in Possible Values.
undefined Default. Text has no specified color. The value is set automatically; for instance, by default or inheritance. transparent No text color is rendered; however any color defined by Cascading Style Sheets (CSS) is still rendered. color Any color value, including those specified in the Color Table.
Returns S_OK if successful, or an error value otherwise.
There is only a difference between the
undefinedvalues when there are multiple style properties that apply to a single run of text. In this situation, the IHTMLRenderStyle::renderingPriority property determines which colors are applied. An
undefinedvalue does not participate in text color determination, regardless of its priority. A
transparentvalue only has an effect if it has the highest priority value—that is, if it is the text color value that is ultimately applied to the given text run.
For instance, consider a style1 , with priority 1, which specifies red. Then consider a style2 , with priority 2, which specifies
undefined. If both styles are applied to the same run of text, red is ultimately used as the text color because style2 , even though it has a higher priority, is
undefinedand therefore has no effect.
Now consider a style3 , with priority 2, which specifies
transparent. If both style1 (defined in the previous paragraph) and style3 are applied to the same run of text, no additional color is applied because style3 has a higher priority, so
transparentis applied instead of red. Of course, if color was applied via CSS, that color will appear.