a:clrScheme (Color Scheme)
Defines a set of theme colors for use throughout a document or presentation.
Description
a:clrScheme defines a color scheme (palette) that establishes the theme colors for an entire document. It is defined in ECMA-376 Part 1 §20.1.5.7.
A color scheme typically contains:
- 2 background colors (dark and light):
a:dk1,a:lt1 - 2 text colors (dark and light):
a:dk2,a:lt2 - 6 accent colors:
a:accent1througha:accent6 - 2 hyperlink colors:
a:hyperlink,a:folHyperlink(followed hyperlink)
Elements throughout a document reference this scheme via a:schemeClr (scheme color) references rather than hard-coded RGB values. This allows consistent theming and easy color updates.
Attributes
| Attribute | Type | Possible Values | Description |
|---|---|---|---|
name |
xsd:string |
Text identifier (e.g., “Office”, “Apex”) | Name of the color scheme. |
Examples
Minimal Color Scheme
<a:clrScheme name="CustomScheme">
<a:dk1><a:srgbClr val="000000"/></a:dk1>
<a:lt1><a:srgbClr val="FFFFFF"/></a:lt1>
<a:dk2><a:srgbClr val="44546A"/></a:dk2>
<a:lt2><a:srgbClr val="E7E6E6"/></a:lt2>
<a:accent1><a:srgbClr val="4472C4"/></a:accent1>
<a:accent2><a:srgbClr val="ED7D31"/></a:accent2>
<a:accent3><a:srgbClr val="A5A5A5"/></a:accent3>
<a:accent4><a:srgbClr val="FFC000"/></a:accent4>
<a:accent5><a:srgbClr val="5B9BD5"/></a:accent5>
<a:accent6><a:srgbClr val="70AD47"/></a:accent6>
<a:hyperlink><a:srgbClr val="0563C1"/></a:hyperlink>
<a:folHyperlink><a:srgbClr val="954F72"/></a:folHyperlink>
</a:clrScheme>
using DocumentFormat.OpenXml.Drawing;
var colorScheme = new ColorScheme { Name = "CustomScheme" };
// Dark background
colorScheme.Append(new Dark1(new RgbColorModelHex { Val = "000000" }));
// Light background
colorScheme.Append(new Light1(new RgbColorModelHex { Val = "FFFFFF" }));
// Dark text
colorScheme.Append(new Dark2(new RgbColorModelHex { Val = "44546A" }));
// Light text
colorScheme.Append(new Light2(new RgbColorModelHex { Val = "E7E6E6" }));
// Accent colors
colorScheme.Append(new Accent1(new RgbColorModelHex { Val = "4472C4" }));
colorScheme.Append(new Accent2(new RgbColorModelHex { Val = "ED7D31" }));
// ... remaining accents ...
// Hyperlink colors
colorScheme.Append(new Hyperlink(new RgbColorModelHex { Val = "0563C1" }));
colorScheme.Append(new FollowedHyperlink(new RgbColorModelHex { Val = "954F72" }));
Color Scheme with Theme Color References
<a:clrScheme name="OfficePalette">
<a:dk1><a:srgbClr val="000000"/></a:dk1>
<a:lt1><a:srgbClr val="FFFFFF"/></a:lt1>
<a:dk2><a:srgbClr val="1F497D"/></a:dk2>
<a:lt2><a:srgbClr val="EBEBEB"/></a:lt2>
<a:accent1><a:srgbClr val="0070C0"/></a:accent1>
<a:accent2><a:srgbClr val="FFC000"/></a:accent2>
<a:accent3><a:srgbClr val="00B050"/></a:accent3>
<a:accent4><a:srgbClr val="C00000"/></a:accent4>
<a:accent5><a:srgbClr val="9E480E"/></a:accent5>
<a:accent6><a:srgbClr val="636363"/></a:accent6>
<a:hyperlink><a:srgbClr val="0563C1"/></a:hyperlink>
<a:folHyperlink><a:srgbClr val="800080"/></a:folHyperlink>
</a:clrScheme>
// Color schemes are typically defined in the theme and then referenced
// by name throughout the document using a:schemeClr elements:
var schemeColor = new SchemeColor { Val = ColorSchemeIndexValues.Accent1 };
// To apply a color modification (e.g., tint) to a scheme color:
schemeColor.Append(new Tint { Val = 20000 }); // 20% lighter
Notes
- Color schemes are defined in the theme and reused throughout documents for consistency.
- 12 theme color slots are standard: 2 text/background pairs (dk1, lt1, dk2, lt2), 6 accents, and 2 hyperlink colors.
- Each color slot can contain
a:srgbClr(RGB) ora:sysClr(system color) elements. - Other elements reference scheme colors via
a:schemeClrwith the color index (e.g.,accent1,accent2). - Changing the color scheme automatically updates all elements that reference it throughout the document.
- The
nameattribute helps identify the scheme but is not required for functionality.