[Table of Contents] [docx version]

WordprocessingML Reference Material - Table of Contents

background (Document Background)

This element specifies the background information for this document. This background shall be displayed on all pages of the document, behind all other document content.

The child elements of the background element are in the Vector Markup Language (VML) namespace, which allows any valid VML effect to be applied to the document's background.

For solid color fill backgrounds, however, the attributes on this element allow for the specification of use of any valid RGB or theme color value (the latter a reference to the document's themes part).

[Example: Consider a document which utilizes a gradient fill background moving between black and the accent5 theme color, as follows:

This background would require the following WordprocessingML markup:

<w:background w:color="9BBB59" w:themeColor="accent3">

<v:background id="_x0000_s1025" o:bwmode="white" fillcolor="#9bbb59 [3206]" o:targetscreensize="800,600">

<v:fill color2="fill darken(118)" method="linear sigma" focus="100%" type="gradientRadial">

<o:fill v:ext="view" type="gradientCenter" />

</v:fill>

</v:background>

</w:background>

The resulting background consists of a single color fill of the accent3 theme color from the themeColor attribute, layered under a gradientCenter fill from the fill attribute. end example]

Parent Elements

document2.2.3); glossaryDocument2.12.10)

 

Child Elements

Subclause

Any element from the urn:schemas-microsoft-com:vml namespace

§6.1

Any element from the urn:schemas-microsoft-com:office:office namespace

§6.2

 

Attributes

Description

color (Background Color)

Specifies the color for the background of the document.

 

This color may either be presented as a hex value (in RRGGBB format), or auto to allow a consumer to automatically determine the background color as appropriate.

 

If the background specifies the use of a theme color via the themeColor attribute, this value is superseded by the theme color value.

 

[Example: Consider a border color with value 2C34FF, as follows:

 

<w:background … w:color="2C34FF"/>

 

The background color shall therefore be the color with an RGB value of 44,52,255 (the decimal decoding of the hex value above). end example]

 

The possible values for this attribute are defined by the ST_HexColor simple type2.18.43).

themeColor (Background Theme Color)

Specifies a theme color to be applied to the current background.

 

The specified theme color is a reference to one of the predefined theme colors, located in the document's Theme part, which allows color information to be set centrally in the document.

 

If the color attribute is specified, its value shall be ignored in favor of the color resulting from the use of this attribute with any appropriate themeTint and themeShade attribute value calculations applied.

 

[Example: Consider a background configured to use the accent5 theme color, resulting in the following WordprocessingML markup:

 

<w:background w:color="FFA8A0" w:themeColor="accent5" />

The background has a color with an RGB value of FFA8A0, however, because the themeColor attribute is specified, the RGB color value is ignored in favor of the accent5 theme color specified for this document. end example]

 

The possible values for this attribute are defined by the ST_ThemeColor simple type2.18.104).

themeShade (Border Theme Color Shade)

Specifies the shade value applied to the supplied theme color (if any) for this background.

 

If the themeShade is supplied, then it is applied to the RGB value of the theme color (from the theme part) to determine the final color applied to this border.

 

The themeShade value is stored as a hex encoding of the shade value (from 0–255) applied to the current border.

 

[Example: Consider a shade of 60% applied to a background in a document. This shade is calculated as follows:

 

 

 

The resulting themeShade value in the file format would be 99. end example]

 

Given an RGB color defined as three hex values in RRGGBB format, the shade is applied as follows:

Convert the color to the HSL color format (values from 0 to 1)

Modify the luminance factor as follows:

 

 

Convert the resultant HSL color to RGB

 

[Example: Consider a document with a background using the accent2 theme color, whose RGB value (in RRGGBB hex format) is C0504D.

 

The equivalent HSL color value would be.

 

Applying the shade formula with a shade percentage of 75% to the luminance, we get:

 

 

 

Taking the resulting HSL color value of and converting back to RGB, we get 943634.

 

This transformed value can be seen in the resulting background's color attribute:

 

<w:background w:color="943634"
w:themeColor="accent2" w:themeShade="BF"/>

 

end example]

 

The possible values for this attribute are defined by the ST_UcharHexNumber simple type2.18.106).

themeTint (Border Theme Color Tint)

Specifies the tint value applied to the supplied theme color (if any) for this background.

 

If the themeTint is supplied, then it is applied to the RGB value of the theme color (from the theme part) to determine the final color applied to the document's background.

 

The themeTint value is stored as a hex encoding of the tint value (from 0–255) applied to the current border.

 

[Example: Consider a tint of 60% applied to a border in a document. This tint is calculated as follows:

 

 

 

The resulting themeTint value in the file format would be 66. end example]

 

Given an RGB color defined as three hex values in RRGGBB format, the shade is applied as follows:

Convert the color to the HSL color format (values from 0 to 1)

Modify the luminance factor as follows:

 

 

Convert the resultant HSL color to RGB

 

[Example: Consider a document with a background using the accent2 theme color, whose RGB value (in RRGGBB hex format) is 4F81BD.

 

The equivalent HSL color value would be.

 

Applying the tint formula with a tint percentage of 60% to the luminance, we get:

 

 

 

Taking the resulting HSL color value of and converting back to RGB, we get 95B3D7.

 

This transformed value can be seen in the resulting background's color attribute:

 

<w:background w:color="95B3D7"
w:themeColor="accent2" w:themeTint="99"/>

 

end example]

 

The possible values for this attribute are defined by the ST_UcharHexNumber simple type2.18.106).

The following XML Schema fragment defines the contents of this element:

<complexType name="CT_Background">

   <complexContent>

   <extension base="CT_PictureBase">

   <attribute name="color" type="ST_HexColor" use="optional"/>

   <attribute name="themeColor" type="ST_ThemeColor" use="optional"/>

   <attribute name="themeTint" type="ST_UcharHexNumber" use="optional"/>

   <attribute name="themeShade" type="ST_UcharHexNumber" use="optional"/>

   </extension>

   </complexContent>

</complexType>