Skip to content

domain/appearance/accent

Defined in: app/src/domain/appearance/accent.ts:6

A color in OKLCH: lightness 0-1, chroma and hue in degrees.

readonly c: number

Defined in: app/src/domain/appearance/accent.ts:8

readonly h: number

Defined in: app/src/domain/appearance/accent.ts:9

readonly l: number

Defined in: app/src/domain/appearance/accent.ts:7

const minimumAccentContrast: 4.5 = 4.5

Defined in: app/src/domain/appearance/accent.ts:34

Contrast that accents keep against those surfaces, as WCAG requires for text.

accentColors(accent): AccentColors

Defined in: app/src/domain/appearance/accent.ts:42

Computes the accent for light and dark mode. A preset or a custom #rrggbb color keeps its hue; its lightness changes only as far as needed for a contrast of at least 4.5:1 against the surfaces of each mode.

string

A preset, such as blue, or a custom color, such as #2a7f62.

AccentColors


contrastRatio(a, b): number

Defined in: app/src/domain/appearance/accent.ts:57

The WCAG contrast ratio of two OKLCH colors.

Oklch

One color.

Oklch

The other color.

number

A ratio from 1 to 21.


oklchFromHex(hex): Oklch

Defined in: app/src/domain/appearance/accent.ts:66

Reads a #rrggbb color.

string

The color; anything else reads as black.

Oklch

Re-exports AccentColors


Re-exports AccentPreset


Re-exports accentPresets