Color Generators

Create consistent color systems with harmony palettes, perceptual scales, contrast generation, color mixing, gradients, and compositing.

Color Harmony

Generate harmonious color palettes based on color theory using /colorHarmony.

Balanced (Triadic/Tetradic)

Evenly distributes colors around the wheel. 3 steps = triadic (120° apart), 4 = tetradic (90° apart).

Try changing the hue or number of steps
Balanced (Triadic/Tetradic) Evenly distributes colors around the wheel.

Complementary

Base + opposite on the color wheel. With steps > 2, creates a split-complementary fan.

Complementary Base + opposite on the color wheel.

Analogous

Adjacent colors clustered near the base hue. The distribution parameter controls spacing (default 10°).

Analogous Adjacent colors clustered near the base hue.

Harmony types: complementary (base + opposite), analogous (clustered neighbors), balanced (evenly spaced). Parameters: hue, steps, lightness, chroma, distribution.

Color Scales

Generate perceptual color scales with OKLCH interpolation using /colorScale.

Basic Scale with range()

Use range(start, end) for linear interpolation of lightness or chroma across steps.

Lightness goes from 90 (light) to 20 (dark)
Basic Scale with range() Use range(start, end) for linear interpolation of lightness or chroma across steps.

Custom Stops

Use stops() for explicit values per step instead of linear interpolation.

Custom Stops Use stops() for explicit values per step instead of linear interpolation.

Color Contrast

Automatically generate accessible text colors that meet WCAG or APCA contrast targets.

Against a Color Group

Generate one contrast color per background in a group. Each is guaranteed to pass the target.

surface.text.on-100 through on-300 — each passes WCAG AA
Against a Color Group Generate one contrast color per background in a group.

Against Its Own Colors

Omit against, or write against = self, and the group's own colors are the backgrounds. Great for generating on-color variants for a scale.

Against Its Own Colors Omit against to use the group's own colors.

Sampling Colors

sample says where the text colors come from: self (this group's own colors), $group (another group), or black-white (pure black or white, the default). From colors, it picks the one that passes with the least contrast to spare.

Each text color is ink or paper, whichever passes against its background
Sampling Colors sample = self picks from this group's own colors.

Inline Function

For a single token, use the inline colorContrast() function:

Inline Function For a single token, use the inline colorContrast() function.

Contrast targets: wcag(aa) = 4.5:1 (default), wcag(aaa) = 7:1, wcag(3) = custom ratio, apca(75) = APCA Lc value.

Color Mixing

Mix two colors together to create blends, tints, and shade ramps.

Inline colorMix()

Mix two colors in a single expression. Arguments: color1, color2, ratio, space, hueMethod.

Ratio 0 = all color1, 100 = all color2
Inline colorMix() Mix two colors in a single expression.

/colorMix Directive

Generate multiple mixed tokens across a range of ratios with /colorMix.

Creates tint.100 through tint.500 blending toward white
/colorMix Directive Generate multiple mixed tokens across a range of ratios.

Gradients

Define gradient tokens with linear, radial, and conic types.

Stops can use references, OKLCH, hex, or named colors
Gradients Define gradient tokens with linear, radial, and conic types.

Gradient parameters: Linear uses angle, radial uses size + position, conic uses from + position. All support repeating = true.

Next: Pipelines — transform, round, override, and rename generated token collections.