Reads the CSS colors the server meets: a dumped page's theme-color, which the generic link preview keeps as its tint (normalizeCssColor), and the theme stylesheets' tokens, which the emails resolve (theme-tokens.ts).

Functions

f
hexOf(unnamed 0: Rgba): string

Writes color as a lowercase #rrggbb, its alpha dropped.

f
parseCssColor(text: string): Rgba | undefined

Returns the color text writes as a hex (3, 4, 6 or 8 digits), an rgb() or rgba() of numbers or percentages, or one of the common names; undefined for any other form. Channels out of range are clamped.

Interfaces

I
Rgba

An sRGB color with its alpha, each channel 0–255 and alpha 0–1.