a:srgbClr (RGB Color)
Specifies a color using RGB (Red-Green-Blue) model with 6-digit hexadecimal notation.
Parent elements
Child elements
## Description
`a:srgbClr` defines a color using the **sRGB (standard RGB) color model**. It is defined in **ECMA-376 Part 1 §20.1.2.3.32**.
The color value is a **6-digit hexadecimal string** in the format `RRGGBB` where:
- **RR** = Red component (00–FF)
- **GG** = Green component (00–FF)
- **BB** = Blue component (00–FF)
For example:
- `000000` = Black
- `FFFFFF` = White
- `FF0000` = Pure Red
- `00FF00` = Pure Green
- `0000FF` = Pure Blue
Child elements allow color modifications (transparency, tint, shade, etc.) to be applied to the base RGB value.
## Attributes
| Attribute | Type | Possible Values | Description |
|---|---|---|---|
| `val` | `ST_HexColor` | 6-digit hex string (000000–FFFFFF) | RGB color value in hex notation. |
## Examples
### Pure Red Color
### RGB Color with Alpha Transparency (50% opacity)
### RGB Color with Tint Modification (20% lighter)
### RGB Color with Shade Modification (30% darker)
## Notes
- The `val` attribute is a **case-insensitive 6-digit hex string** (use uppercase for readability).
- Color modifications (`a:alpha`, `a:tint`, `a:shade`) use values 0–100000 where 50000 = 50%.
- Tint (0–100000) blends the color toward white; shade blends toward black.
- Common color references:
- Theme colors use `a:schemeClr` instead; raw RGB uses `a:srgbClr`.
- For predefined named colors, use color names via application-specific mappings.
- Child modification elements are optional; omit if no modifications are needed.
<a:srgbClr val="FF0000"/>
using DocumentFormat.OpenXml.Drawing;
var redColor = new RgbColorModelHex { Val = "FF0000" };
<a:srgbClr val="0070C0">
<a:alpha val="50000"/>
</a:srgbClr>
var blueColor = new RgbColorModelHex { Val = "0070C0" };
blueColor.Append(new Alpha { Val = 50000 }); // 50% opacity (0–100000)
<a:srgbClr val="4472C4">
<a:tint val="20000"/>
</a:srgbClr>
var tintedColor = new RgbColorModelHex { Val = "4472C4" };
tintedColor.Append(new Tint { Val = 20000 }); // 20% lighter (0–100000)
<a:srgbClr val="FF9900">
<a:shade val="30000"/>
</a:srgbClr>
var shadedColor = new RgbColorModelHex { Val = "FF9900" };
shadedColor.Append(new Shade { Val = 30000 }); // 30% darker (0–100000)