Hexadecimal colors

Hex color notation encodes sRGB channels in base 16. In #317CFF, 31 is red, 7C is green, and FF is blue. Each channel ranges from 00 to FF. An optional fourth pair encodes alpha, from transparent 00 to opaque FF.

Hex is a convenient handoff format for brand swatches. It does not expose a perceived-lightness value, so use the color engine or CSS relative colors when you need related shades.

Use hex as a theme seed

A theme's seedColor accepts #rrggbb, as well as rgb(), hsl(), and oklch(). Espalier converts supported inputs to OKLCH before generating the palette. For example, seedColor: '#78486A' and its converted oklch(0.469 0.0809 338.5) represent the same source color.

See theming for configuration and brand fitting for preserving supplied swatches.

Derive a color in CSS

.button {
  --seed-hex: #317CFF;
  background: oklch(from var(--seed-hex) l c h);
}

.button:hover {
  background: oklch(from var(--seed-hex) calc(l + 0.05) c h);
}

For component styling, prefer semantic tokens that follow the active theme. Derived custom colors need their own contrast checks.

Components API Guides Getting started Styling Espalier Browser support GitHub npm package Taproot I/O