domain/appearance/accent
Interfaces
Section titled “Interfaces”Defined in: app/src/domain/appearance/accent.ts:6
A color in OKLCH: lightness 0-1, chroma and hue in degrees.
Properties
Section titled “Properties”
readonlyc:number
Defined in: app/src/domain/appearance/accent.ts:8
readonlyh:number
Defined in: app/src/domain/appearance/accent.ts:9
readonlyl:number
Defined in: app/src/domain/appearance/accent.ts:7
Variables
Section titled “Variables”minimumAccentContrast
Section titled “minimumAccentContrast”
constminimumAccentContrast: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.
Functions
Section titled “Functions”accentColors()
Section titled “accentColors()”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.
Parameters
Section titled “Parameters”accent
Section titled “accent”string
A preset, such as blue, or a custom color, such as #2a7f62.
Returns
Section titled “Returns”contrastRatio()
Section titled “contrastRatio()”contrastRatio(
a,b):number
Defined in: app/src/domain/appearance/accent.ts:57
The WCAG contrast ratio of two OKLCH colors.
Parameters
Section titled “Parameters”One color.
The other color.
Returns
Section titled “Returns”number
A ratio from 1 to 21.
oklchFromHex()
Section titled “oklchFromHex()”oklchFromHex(
hex):Oklch
Defined in: app/src/domain/appearance/accent.ts:66
Reads a #rrggbb color.
Parameters
Section titled “Parameters”string
The color; anything else reads as black.
Returns
Section titled “Returns”References
Section titled “References”AccentColors
Section titled “AccentColors”Re-exports AccentColors
AccentPreset
Section titled “AccentPreset”Re-exports AccentPreset
accentPresets
Section titled “accentPresets”Re-exports accentPresets