WorkArticlesContact
© 2026 AycanBack to top ↑
← All articles

Hygraph · Baukasten Design System

Re-approaching the Baukasten color system

September 1, 2024
My contribution
Lead Designer
Team
1 × Lead designer1 × Engineer2 × Product designers
Year
2024

As designers, we're always striving to deliver the best user experience with the prettiest UI possible. But imagine this: what if the colors we use aren't accessible or coherent enough? Are we unintentionally causing more problems than we're solving?

Where we started

Before this project, our color system was anything but systematic:

  • Most text and background combinations didn't pass AA contrast, not even our primary button.
  • Some buttons looked disabled when they weren't.
  • Hues were inconsistent across color groups.
  • Mid-shades were handpicked, without a clear structure behind them.

This approach might work for small projects, but it wasn't sustainable for a growing design system.

The challenge

Color is deeply subjective. How it's perceived depends on screens, environments and even cultural context. Without a structured system, ensuring consistency and accessibility was nearly impossible, especially whenever we needed to add a new shade.

A perceptual palette

Instead of picking shades by eye, we generated them in HSLuv, a human-friendly alternative to HSL. GitHub's Primer and Shopify's Polaris use the same approach. In HSL, a yellow and a blue with the same "lightness" look completely different. In HSLuv they don't, so contrast stays consistent from one hue to the next.

We built every scale in GitHub's Primer Prism, tuning hue, saturation and lightness as curves and checking contrast at every step.

Primer Prism editing the indigo scale, with hue, saturation and lightness curves and a contrast badge on each step
The indigo scale in Primer Prism. Each step shows whether it passes AA or AAA.

Every color group shares the same lightness curve, and the step names come straight from it: 50 is 98.5% lightness, 1000 is 5%. The main color of each group sits at 600, 45% lightness.

A table mapping lightness percentages to scale names from 50 to 1000, above neutral and indigo ramps, with 600 marked as the main color
Scale names are tied to lightness, so indigo-600 and red-600 are always equally dark.

That gives us two rules:

  1. Every -600 shade meets AA contrast on white, so it's safe for text, icons and solid buttons.
  2. The same step has the same lightness across groups, so swapping one color group for another doesn't change the visual weight of a component.

Same step, same contrast

The second rule is easiest to see in the numbers. These are the main text colors from every group in Baukasten today. Different hues, but each one lands between 5.2:1 and 5.4:1 on white.

Accent text colors · contrast on white

Aa

indigo

#5d57e1

5.36:1

Aa

blue

#3161df

5.38:1

Aa

green

#1a7b5e

5.20:1

Aa

yellow

#9a6000

5.19:1

Aa

red

#c33634

5.39:1

Aa

orange

#a95220

5.36:1

Aa

teal

#1d757d

5.39:1

Aa

olive

#547431

5.36:1

Aa

pink

#b43d80

5.36:1

Aa

purple

#7355cc

5.38:1

The yellow exception

One group didn't fit. A yellow that still looks yellow can't carry white text: our first warning button only reached 3.45:1. We looked at three ways out: a darker, more ochre yellow, a light yellow with dark text, or switching warning to orange.

Indigo, green, red and yellow buttons in ghost and solid states, and four warning button options with their contrast ratios
Solid and ghost buttons built from each group's 600, and the four warning options we compared.

We kept yellow and darkened it: today's warning color, #9a6000, passes AA with white text at 5.19:1.

The result

Nine color ramps (neutral, indigo, green, red, yellow, blue, orange, pink and teal), each running from light to dark
The new palette: nine color groups with matching lightness at every step.

The new system not only improved accessibility but also streamlined the design process. With predictable steps and built-in contrast guarantees, it's much easier to expand the palette, and much harder to accidentally ship something that isn't readable.

The palette is only the first layer, though. How these colors became semantic design tokens is a story of its own.