Skip to main content

Colors

Eight helpers for deriving one colour from another, so a theme can state a relationship instead of a hex code.

FunctionDoes
lightenraises lightness
darkenlowers lightness
saturateraises saturation
adjustHuerotates hue
alphasets opacity
mixblends two colours
contrastcontrast between two colours
tokenAccessorreads a token back out

Why derive rather than hardcode

A theme built from seven literal hex values has seven independent things to keep consistent. One built from a base colour plus lighten, darken, and mix has one, and the relationships survive a change to the base.

contrast is the one that checks rather than produces — reach for it when a derived colour has to stay readable against its background, instead of eyeballing the result.

Where they belong

These are theme-authoring helpers. They compute values; they do not register anything. The registration is theme().