clr element 

Specifies an alternate value for the color of the text that is contained within this element.

Element Information

Element type: ColorType complexType


Schema name: Simple Content Format

Elements and Attributes

Parent Elements

Child Elements






Possible values


ColorRGB simpleType


Specifies the RGB value of the color to use for the contained text. Devices need not conform to the setting of this attribute.

Hexadecimal numbers containing from one through six digits, inclusive.


Some devices support limited or no color for text. In these cases, devices may ignore the specified colors when rendering text. For devices that do support color text, a color as close to the specified value as possible should be used to display the text. The clr element occurs within the txt element, interspersed with both text and one or more instances of the em element.

The clr element uses the ColorRGB simple type element to define the type that contains valid values for the rgb attribute of the clr element. The valid values are hexadecimal numbers containing from one through six digits, inclusive. The digits are interpreted in pairs, with two hexadecimal values for each of the colors: red, green, and blue, respectively.

Usage Example

The following code example sets the color of the text.

<txt rgb="FFFFFF">White Text <clr rgb="000000">Black Text</clr> White Text</txt>

Schema Definition

The following schema defines two complex and one simple type.

<xsd:element name="clr" type="ColorType" />

<xsd:complexType name="ColorType" mixed="true">
    <xsd:sequence minOccurs="0" maxOccurs="unbounded">
        <xsd:element ref="em" />
    <xsd:attribute name="rgb" type="ColorRGB" use="required" />

<xsd:element name="em" type="EmphasisType" />

<xsd:complexType name="EmphasisType" mixed="true">
    <xsd:sequence minOccurs="0" maxOccurs="unbounded">
        <xsd:element ref="clr" />

<xsd:simpleType name="ColorRGB">
    <xsd:restriction base="xsd:hexBinary">
        <xsd:minLength value="1" />
        <xsd:maxLength value="6" />