2.1.72 Part 1 Section 17.3.2.6, color (Run Content Color)

For additional notes that apply to this portion of the standard, please see the notes for color, §17.15.2.5(a).

a.   The standard specifies an algorithm for themeShade calculations that is different from themeShade calculations in other subclauses.

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:

    Equation to modify luminance factor: L prime equals L times Shade sub percentage

  • Convert the resultant HSL color to RGB.

If this attribute is specified in the color element ("[ISO/IEC-29500-1] §17.15.2.5; color (Frameset Splitter Color)") nested inside a framesetSplitbar ("[ISO/IEC-29500-1] §17.15.2.20; framesetSplitbar (Frameset Splitter Properties)") element, Word deviates from this behavior. Refer to the themeColor attribute description.

[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 beEquation for equivalent HSL color value: parentheses 1 over 360 comma 0.48 comma 0.53 parentheses.

Applying the shade formula with a shade percentage of 75% to the luminance, the result is:

Equation of shade formula: L prime = 0.53 times 0.75

Result of equation: = 0.39698

Taking the resulting HSL color value of Equation for HSL color value: parentheses 1 over 360 comma 0.48 comma 0.39698 parenthesesand converting back to RGB, the result is 943634.

This transformed value can be seen in the resulting run color WordprocessingML's val attribute:

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

end example]

b.   The standard does not state which setting is applied when both the themeShade and the themeTint attributes are present.

Word applies the themeTint setting when both of these attributes are present.

c.   The standard describes an algorithm for themeTint calculations that is different from themeTint calculations in other subclauses.

In Word, the themeTint attribute is calculated using the following algorithm:

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:

Equation to modify luminance factor: L prime = L times Tint sub percent + parentheses 1 minus Tint sub percent parentheses

  • Convert the resultant HSL color to RGB.

If this attribute is specified in the color element ("[ISO/IEC-29500-1] §17.15.2.5; color (Frameset Splitter Color)") nested inside a framesetSplitbar element ("[ISO/IEC-29500-1] §17.15.2.20; framesetSplitbar (Frameset Splitter Properties)"), Word will not use the specified theme color but rather will use an RGB color based on the themeShade and themeTint attributes. The intensity of the red, green, and blue components of this RGB color range from 0 to 255. The value of themeTint shall specify the intensity of the red component. If the themeTint attribute is omitted, the intensity of the red component shall default to 255. The value of themeShade shall specify the intensity of the green component. If the themeShade attribute is omitted, the intensity of the green component shall default to 255. The intensity of the blue component shall be 0.

[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 beHSL color value: parentheses 213 over 360 comma 0.45 comma 0.53 parentheses.

Applying the tint formula with a tint percentage of 60% to the luminance, the result is:

Equation for tint forumla: L prime = 0.53 times 0.6 + parentheses 1 minus .6 parentheses

Result of equation: = 0.71

Taking the resulting HSL color value of HSL color value: parentheses 213 over 360 comma 0.45 comma 0.71 parentheses and converting back to RGB, the result is 95B3D7.

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

 <w:top w:val="single" w:sz="4" w:space="24"
   w:color="95B3D7" w:themeColor="accent2" 
   w:themeTint="99"/>

end example]