Skip to content

Interface: ColorRef ​

A DrawingML colour as the file writes it and as it renders. Every read value type that carries a colour carries one of these: a gradient stop, a shadow or glow, a bullet, a cell border, a pattern's two colours, a picture's recolour, a solid background, and a chart series' fill and line.

At most one of srgb, scheme and preset is set, naming the colour model the file used. A colour written as a:sysClr or a:hslClr sets none of the three and is reported through resolved alone. With no colour at all, every field is null.

Properties ​

preset ​

preset: string | null

a:prstClr/@val, a preset name such as black, or null; presetColorHex makes one literal.


resolved ​

resolved: ResolvedColor | null

The colour resolved against the theme, with its transforms applied, or null when there is no colour, it cannot be made literal (an unmapped token, or a:scrgbClr), or it was read without a theme, as a chart part's colours are. Read resolved.transforms when re-authoring against a different theme: effectiveHex alone is one theme baked in, and an empty list means the file stated no transforms.


scheme ​

scheme: string | null

a:schemeClr/@val, a theme token such as accent1, or null.


srgb ​

srgb: string | null

a:srgbClr/@val, a 6-hex literal, or null.