Lesson 6 of 7 · 11 min
Color systems and dark mode
Goal:Turn a palette into tokens, and design a dark mode that works.
NAMES, NOT HEX CODES
uxuiopen.comIn a real product, nobody should type #533AFD into a button. Teams name colors by their job, so changing a theme (or adding dark mode) means changing a few values in one place instead of hunting through hundreds of screens.
Raw palette
- blue-600
- blue-500
- gray-900
- red-600
Semantic tokens
- color.action
- color.action.hover
- color.text
- color.danger
Used in
- Primary button
- Button, hovered
- Body text
- Error message
Dark mode swaps the raw values behind each token. Components don't change.
Words to know
- Token
- A named value with a job, like color.text or color.action, instead of a raw hex code.
- Variable (Figma)
- Figma's way of storing tokens. One variable can have different values for light and dark modes.
- Mode
- A set of values for every token: light, dark, high contrast…
Dark mode is not inverted light mode

Inverting flips every color, including images and the brand. A designed dark mode keeps them.
Switch between the three versions and read what changes.
Compare the light card, a simply inverted one and a designed dark mode.
Sam shared a file
2 minutes ago
Here's the new onboarding flow. The photo and the brand color should look right in both themes.
Open file- Dark text on light surfaces, a shadow to lift the card.
- The brand purple is the only vivid color.
- This is the starting point.
- Use dark grays for surfaces, and make raised surfaces slightly lighter: shadows are hard to see on dark.
- Lighten and slightly desaturate vivid colors so they don't glow or vibrate.
- Recheck contrast: a color that passes on white may fail on dark gray.
- Keep photos, illustrations and brand marks as they are, or provide versions made for dark.
Your team wants to add dark mode next month. 300 screens use raw hex codes. What's the first step?
See it on real websites
Switch your device between light and dark mode and reload each site.
GitHub
What to notice
- Several themes, including light, dark and high contrast.
- Dark surfaces are dark grays, not pure black.
- Status colors stay readable in every theme.
Light and dark in Figma
Turn your palette into variables with two modes.
- 1Create a variable collection with modes named Light and Dark.
- 2Add tokens: background, surface, border, text, text-muted, action, action-text, success, error.
- 3Fill in light values from your palette, then design dark values (don't just invert).
- 4Apply them to your card and form, then switch the frame's mode.
- 5Share one token and its two values.
Read next