a:clrMap (Color Map)
Describes the theme or style structure used by a:clrMap in DrawingML definitions..
Description
a:clrMap is a DrawingML or SVG namespace element used to describe a specific part of a shape, text run, theme, or graphic. In the ECMA-376 DrawingML model, it participates in the XML content tree that defines visual appearance, geometry, and formatting for OOXML content.
The element is commonly encountered in presentation, document, and spreadsheet packages where shapes, charts, pictures, or text boxes are serialized as Open XML. The examples below illustrate a typical usage pattern and a corresponding Open XML SDK implementation.
Attributes
| Attribute | Type | Possible Values | Description |
|---|---|---|---|
bg1 |
ST_ColorSchemeIndex | 0..11 | Background color mapping for the first theme slot. |
tx1 |
ST_ColorSchemeIndex | 0..11 | Text color mapping for the first theme slot. |
XML Example
<a:clrMap bg1="lt1" tx1="dk1" bg2="lt2" tx2="dk2" accent1="accent1" accent2="accent2" accent3="accent3" accent4="accent4" accent5="accent5" accent6="accent6" hlink="hlink" folHlink="folHlink"/>
using System.Xml.Linq;
XNamespace a = "http://schemas.openxmlformats.org/drawingml/2006/main";
var clrMap = new XElement(a + "clrMap",
new XAttribute("bg1", "lt1"),
new XAttribute("tx1", "dk1"),
new XAttribute("bg2", "lt2"),
new XAttribute("tx2", "dk2"),
new XAttribute("accent1", "accent1"),
new XAttribute("accent2", "accent2"),
new XAttribute("accent3", "accent3"),
new XAttribute("accent4", "accent4"),
new XAttribute("accent5", "accent5"),
new XAttribute("accent6", "accent6"),
new XAttribute("hlink", "hlink"),
new XAttribute("folHlink", "folHlink")
);
Console.WriteLine(clrMap);
Notes
- The permitted child elements and attribute values depend on the surrounding OOXML part and the schema version in use.
- In practice, DrawingML content is usually generated from higher-level shape or picture APIs rather than built manually element-by-element.
- When this element appears inside a document package, it is typically linked by relationships or contained in a drawing part that is referenced from a shape or graphic object.