Skip to main content
Home pageTokensColors

Colors

Each semantic color is auto-generated from a single base hex value using the OKLCH color space, producing 10 perceptually uniform shades (50–900) plus a muted variant for each.

The palette​

Latty ships with six semantic colors plus a neutral scale:

ColorBase hexRole
Primary#FF8200Brand, main actions, active states
Secondary#5252c5Supporting actions, secondary emphasis
Success#22c55ePositive outcomes, completion
Warning#eeb308Caution, non-blocking issues
Error#ef4444Destructive actions, validation errors
Info#0ea5e9Informational, neutral callouts
NeutralGeneratedText, borders, backgrounds — a chroma-free scale

Each base hex is defined in tokens.config.json and customizable via configure().

How the palette is generated​

The base hex value is pinned to the 500 step. Latty then generates lighter (50–400) and darker (600–900) shades in the OKLCH color space, which produces perceptually uniform steps — unlike HSL, the perceived brightness difference between each step is consistent.

The neutral scale uses a separate lightness curve with zero chroma, so it stays perfectly grey regardless of the primary color.

Muted variants​

Every color also generates a muted variant (*-muted-50 through *-muted-900) with reduced chroma. These are useful for subtle backgrounds, disabled states, and low-emphasis UI.

/* Muted variant tokens */
background: var(--lt-color-primary-muted-100);
border-color: var(--lt-color-error-muted-200);

System colors​

Two fixed tokens are always available:

  • --lt-color-black: #000000
  • --lt-color-white: #ffffff

Customizing colors​

Override any color via configure() — Latty regenerates the full 10-step palette from your base hex:

import { configure } from '@latty-ds/tokens/configure';

configure({
colors: {
primary: '#6366f1', // Indigo primary
secondary: '#8b5cf6' // Purple secondary
}
});

Palette preview​

primaryDefault
50#f0e5df
100#ffd4b5
200#ffbb87
300#ffa860
400#ff9539
500#ff8200
600#d56400
700#963b00
800#5e3c25
900#3c1d05
Muted
50#e9e7e6
100#e8dfda
200#dfd1c8
300#dac8bd
400#d2beb2
500#c6b1a5
600#a08e82
700#6b5c53
800#50453e
900#2b2521
secondaryDefault
50#e5e7f1
100#cbd2ff
200#a3acf7
300#8a93f4
400#7076e5
500#5252c5
600#4544ad
700#333187
800#2e3254
900#202343
Muted
50#e7e8e9
100#d5d7df
200#b4b7c4
300#a0a3b3
400#898c9e
500#6c6f81
600#5a5d6d
700#414351
800#363742
900#25262c
successDefault
50#e1ebe2
100#beedc6
200#94e4a4
300#70df8b
400#4bd573
500#22c55e
600#00a244
700#006f22
800#2b4d32
900#0c2e16
Muted
50#e7e8e7
100#dbe3dc
200#cad7cc
300#bfcfc1
400#b3c5b6
500#a5b8a8
600#839586
700#546256
800#404a41
900#222823
warningDefault
50#ece7de
100#f5e0b5
200#f6d289
300#f9c962
400#f7bf3a
500#eeb308
600#c38e00
700#845a00
800#584720
900#332400
Muted
50#e8e8e6
100#e7e4dc
200#e2dcd0
300#ded7c8
400#dad1c0
500#d2c9b8
600#a9a090
700#6d6659
800#504c42
900#292621
errorDefault
50#f3e4e2
100#ffc8c1
200#ffa198
300#ff847b
400#ff6560
500#ef4444
600#cb2d31
700#950e18
800#5a312e
900#3f1917
Muted
50#e9e7e7
100#e6dad8
200#d6c3c1
300#cdb4b2
400#bfa4a1
500#ab908d
600#8d7572
700#624e4c
800#4c3d3b
900#2d2423
infoDefault
50#e1e9ef
100#bce4fe
200#8fd2fd
300#6ac7ff
400#43b9fa
500#0ea5e9
600#0087c4
700#005c8d
800#1e465d
900#082a3c
Muted
50#e7e8e9
100#d9e0e5
200#c5d0d7
300#b8c6cf
400#aab9c4
500#99a9b3
600#7a8993
700#4f5b63
800#3d464c
900#22272a
neutralDefault
50#fafafa
100#f3f3f3
200#e4e4e4
300#cacaca
400#ababab
500#868686
600#696969
700#4d4d4d
800#333333
900#1b1b1b