a:prstClr (Preset Color)
References a named preset color from a predefined color palette.
Parent elements
Description
a:prstClr is the DrawingML preset color element that references named standard colors. It is defined in ECMA-376 Part 1 §20.1.2.3.25.
Preset colors provide:
- Consistent named colors across applications
- Standard color palette from predefined list
- Easy readability and color identification
- Compatibility with legacy documents
Common preset colors:
- aliceBlue, antiqueWhite, aqua, aquamarine, azure
- beige, bisque, black, blanchedAlmond, blue, blueViolet, brown
- red, green, yellow, white, transparent
- And ~100+ other named CSS/X11 colors
Attributes
| Attribute | Type | Possible Values | Description |
|---|---|---|---|
val |
PresetColorValues | aliceBlue, antiqueWhite, aqua, … transparent | Named preset color. |
Examples
Preset Blue
<a:solidFill>
<a:prstClr val="blue"/>
</a:solidFill>
using DocumentFormat.OpenXml.Drawing;
var solidFill = new SolidFill();
var prstClr = new PresetColor { Val = PresetColorValues.Blue };
solidFill.Append(prstClr);
Preset Red with Tint
<a:prstClr val="red">
<a:tint val="50000"/>
</a:prstClr>
var prstClr = new PresetColor { Val = PresetColorValues.Red };
var tint = new Tint { Val = 50000 }; // 50% lighter
prstClr.Append(tint);
var solidFill = new SolidFill();
solidFill.Append(prstClr);
Notes
- Preset colors are named standard colors (X11/CSS color names)
- Over 100 preset colors available (black, red, green, blue, yellow, etc.)
- Easy human-readable alternative to hex RGB values
- Modifications (tint, shade, alpha) apply on top of preset color
- Common preset colors: aliceBlue, aqua, black, blue, cyan, darkGreen, gold, gray, green, red, silver, white, yellow
- Good for standard/theme colors that don’t need to be scheme-driven