Color
Semantic Colors
Semantic colors are colors that carry a fixed, conventional meaning — success, warning, error, and info — so users read a screen's state at a glance.
Definition
Semantic colors are colors that carry a fixed meaning of their own. Green stands for success or completion, yellow and orange signal caution or a warning, red means error or danger, and blue reads as information or a helpful hint. This pairing of color and meaning comes from cultural conventions built up over decades — think traffic lights and road signs — so people guess the rough state of a screen from the color alone, before they even read a single word. In other words, a semantic color isn't one you pick for brand flavor; it's one that honors a promise you've already made with your users.
Why does it matter?
These colors matter because they let people read the state of a screen almost instantly. When a form comes back with a red message, users grasp that something went wrong before reading the text; when they spot a green badge, they know it worked. If you painted errors green and success red, people would have to stop and re-read every time, and a screen that fights convention feels unsettling and hard to trust. Keeping semantic colors consistent builds a shared language for state across your whole product, which dramatically lowers the learning load. The meaning someone learns on one screen carries over to the next, so even when they meet a new feature they can read its state with rules they already know.
Common mistakes
- Relying on color alone to carry the meaning. If an error shows up as only a red border, users with color vision deficiencies can't tell how it differs from a normal state. Color should support meaning, never shoulder the whole message by itself.
- Mixing state colors with brand colors. If your brand is green and you paint success badges, done notifications, and everything else green too, the color stops signaling anything at the very moment users need to tell states apart. State colors and brand colors play different roles, so keep them from overlapping.
- Ignoring convention and inventing your own color pairings. Making errors blue and success purple might look distinctive, but it clashes with signals people have absorbed their whole lives, forcing them to relearn each meaning from scratch.
Practical tips
- Never lean on color alone — always pair it with an icon and text. An error should carry a red hue plus a warning icon and a line explaining what went wrong, so the meaning still lands when the color can't be seen. This is the foundation of accessibility.
- Lock in the four meanings — success, warning, error, and info — up front and define them as tokens. When the whole team references the same values, you avoid a mess where state colors differ from screen to screen.
- Prepare both a light-background step and a dark-text step for each state color. Using the same pure hue for background and text tends to break contrast or come across as far too loud.
Ask your AI
In the code/CSS I paste below, find every color used for success, warning, error, and info states and remap them to convention: green = success/done, yellow or orange = warning, red = error/danger, blue = info. If any brand color has bled into a state color, pull them apart, and extract each meaning into --color-success, --color-warning, --color-error, and --color-info tokens. Give me an old-color → state → token mapping table along with the updated code.
This product is a [product type — e.g. fintech dashboard] and the brand's main color is [brand color — e.g. #4B7BEC]. Design a semantic color set for the four meanings — success, warning, error, info — following convention (green / yellow-orange / red / blue). Keep them from overlapping the brand color, and for each state give me two tones — a light-background step and a dark-text step — as CSS variables like --color-success-bg and --color-success-text. Add a one-line rationale for each hue you pick.
In the component I paste below, find every place that signals a state with color alone — a red border, a green fill, and so on. So users with color vision deficiencies can still tell them apart, pair each state with an icon and explanatory text: error = red + warning icon + a line on what went wrong, success = green + check icon + a done message. Make color only support the meaning, and give me the corrected markup.