A neighborhood espresso bar at night: a worn copper espresso machine and a jumble of ivory, speckled and teal cups on a dark wood counter, in front of a wall of glossy deep teal tiles, with a jar of coffee beans, a small plant and a linen cloth.

Web color palettes with hex codes that hold up in a UI

UI themes taken from these photos, each with its contrast checked. Open one and put your brand color in.

Espresso and Teal: colors from this photo, tuned in Hue42

A web color palette is a set of hex codes with one job each: a page color, a surface for cards, a border for dividers and outlines, an accent for buttons and links, and a text color. Every palette below lists its colors in that order, and its checks show whether its best text pair clears the WCAG bar of 4.5 to 1.

The same colors on a web page

The dark theme from the photo above, a light theme and a bold one, on a small site. Open one in Hue42 to put your own accent in.

Swipe to compare 3 palettes

Body text on the page: #FAECDD on #0F0A0616.9 to 1. Meets AAA text contrast, the strictest level.

Espresso and Teal

#0F0A06 #082820 #365E5A #E48B54 #FAECDD

Open in Hue42

Body text on the page: #1E1A14 on #FAF6F116.0 to 1. Meets AAA text contrast, the strictest level.

Gallery Blue

#FAF6F1 #EDE2DA #908476 #0048C1 #1E1A14

Open in Hue42

Body text on the page: #260534 on #FCF0DC16.1 to 1. Meets AAA text contrast, the strictest level.

Orange Launch

#FCF0DC #F3D5B3 #9073A0 #F37D00 #260534

Open in Hue42

Pick a photo, get a UI theme

Tap any color to copy its hex code.

A sunlit gallery corner with a large flat rectangle of cobalt blue paint on a white wall, a fiddle leaf fig in a terracotta pot, a pale oak bench and window shadows on a concrete floor.

Gallery Blue

A bright light theme: warm white page, linen panels, a stone border, cobalt buttons and links, charcoal text. The border can outline inputs on the page but is too faint on the panels, so use it as a divider there.

Hex codes, names and checks
Colors in Gallery Blue
ColorHexRGBRole
Seashell#FAF6F1250, 246, 241Tint
Almond#EDE2DA237, 226, 218Neutral
Taupe#908476144, 132, 118Neutral
Sapphire#0048C10, 72, 193Base
Soot#1E1A1430, 26, 20Anchor
  • A readable pair. Best text pairing is 16.0:1 (4.5:1 passes WCAG AA).
  • Light to dark range. Lightness spans 75 points of 100.
  • Every color distinct. No two colors are close enough to be confused.
  • Holds up colorblind. Colors stay distinguishable under common color vision types.
  • Room to breathe. There is a quiet color for surfaces and backgrounds.
The edge of a swimming pool from above: turquoise water over teal tiles, a pale sand stone deck with a palm shadow and a rolled coral towel.

Pool Deck

A sunny booking or travel site: sand page, deeper sand cards, a pool teal border, terracotta buttons and links, deep teal text. On the sand cards, keep terracotta to buttons and large text.

Hex codes, names and checks
Colors in Pool Deck
ColorHexRGBRole
Linen#FCF2E3252, 242, 227Tint
Beige#EBD3B5235, 211, 181Analog
Light Peacock#42878D66, 135, 141Accent
Paprika#BC442A188, 68, 42Base
Bayou#00282B0, 40, 43Anchor
  • A readable pair. Best text pairing is 14.1:1 (4.5:1 passes WCAG AA).
  • Light to dark range. Lightness spans 71 points of 100.
  • Every color distinct. No two colors are close enough to be confused.
  • Holds up colorblind. Colors stay distinguishable under common color vision types.
  • Room to breathe. There is a quiet color for surfaces and backgrounds.
A side street at night after rain, with cyan light from a shop window and pink light from an open doorway reflected in puddles on dark asphalt, and a bicycle by the wall.

Neon Street

A dark theme with a neon edge: near black page, blue black cards, a plum border, hot pink buttons and links, ice blue text. Label pink buttons in the page color, not white, and keep the border to dividers.

Hex codes, names and checks
Colors in Neon Street
ColorHexRGBRole
Jet#020A132, 10, 19Anchor
Abyss#0B1F2B11, 31, 43Neutral
Light Fig#673D59103, 61, 89Analog
Vivid Peony#DE67B1222, 103, 177Base
Light Powder#CFF2FE207, 242, 254Tint
  • A readable pair. Best text pairing is 16.8:1 (4.5:1 passes WCAG AA).
  • Light to dark range. Lightness spans 80 points of 100.
  • Every color distinct. No two colors are close enough to be confused.
  • Holds up colorblind. Colors stay distinguishable under common color vision types.
  • Room to breathe. There is a quiet color for surfaces and backgrounds.
A worktable from above with stacks of cream paper, a sheet of deep red paper, a pot of black ink with a dip pen, a wooden bone folder and a gray cutting mat.

Paper and Ink

A docs or reading site: paper page, tan cards for code and notes, a stone border, deep red links, near black ink. The red sits close to the ink, so underline links inside body text.

Hex codes, names and checks
Colors in Paper and Ink
ColorHexRGBRole
Linen#FAF3E6250, 243, 230Tint
Pearl#E9DCC8233, 220, 200Neutral
Taupe#8D857A141, 133, 122Neutral
Ruby#9C2527156, 37, 39Base
Soot#1A181226, 24, 18Anchor
  • A readable pair. Best text pairing is 16.0:1 (4.5:1 passes WCAG AA).
  • Light to dark range. Lightness spans 76 points of 100.
  • Every color distinct. No two colors are close enough to be confused.
  • Holds up colorblind. Colors stay distinguishable under common color vision types.
  • Room to breathe. There is a quiet color for surfaces and backgrounds.
A window seat in a dark green cabin with a moss green wool blanket and a white enamel mug, looking out at a misty pine forest.

Forest Cabin

A dark green theme for a code editor: forest page, moss side panels, a pine border, a lime accent, misty white text. Lime buttons take dark green labels, never white.

Hex codes, names and checks
Colors in Forest Cabin
ColorHexRGBRole
Black Forest#0D170D13, 23, 13Anchor
Cypress#1F302231, 48, 34Neutral
Thyme#617B4D97, 123, 77Accent
Light Matcha#B4C96D180, 201, 109Base
Sea Salt#E8F1EC232, 241, 236Tint
  • A readable pair. Best text pairing is 15.9:1 (4.5:1 passes WCAG AA).
  • Light to dark range. Lightness spans 76 points of 100.
  • Every color distinct. No two colors are close enough to be confused.
  • Holds up colorblind. Colors stay distinguishable under common color vision types.
  • Room to breathe. There is a quiet color for surfaces and backgrounds.
A deep indigo painted door with a brass knob in a pale lilac plaster wall, with worn stone steps and a pot of lavender beside it.

Indigo Door

A project or planning app: lilac white page, a lavender sidebar, a periwinkle border, indigo buttons and selected rows, deep navy text. For inputs, darken the border until it reaches 3 to 1 against the color around the field.

Hex codes, names and checks
Colors in Indigo Door
ColorHexRGBRole
Snow#F9F5FD249, 245, 253Tint
Lilac Mist#E2D9F2226, 217, 242Neutral
Light Aster#8590B8133, 144, 184Analog
Sapphire#284CAC40, 76, 172Base
Navy#05194E5, 25, 78Anchor
  • A readable pair. Best text pairing is 15.5:1 (4.5:1 passes WCAG AA).
  • Light to dark range. Lightness spans 74 points of 100.
  • Every color distinct. No two colors are close enough to be confused.
  • Holds up colorblind. Colors stay distinguishable under common color vision types.
  • Room to breathe. There is a quiet color for surfaces and backgrounds.
Two neutral themes, light and dark
  • Espresso and Teal

    Open in Hue42

    A warm dark theme: espresso page, deep teal cards, a teal gray border, copper buttons and links, ivory text. Label copper buttons in espresso, not white, and keep the border to dividers.

    #0F0A06 #082820 #365E5A #E48B54 #FAECDD

  • Slate Light

    Open in Hue42

    A neutral light theme for an admin or settings screen: cool gray page, white cards, a slate border, a clear blue accent, ink text. The border can outline inputs on the white cards; on the gray page use it as a divider.

    #E9EDF3 #FFFFFF #8B95A5 #2A55C4 #111827

  • Graphite Dark

    Open in Hue42

    A neutral dark theme: graphite page, lighter cards, a slate border, a soft blue accent, off white text. Label blue buttons in the page color, not white, and keep the border to dividers.

    #0E1116 #1B2028 #4A5363 #7AA2F7 #E6E9EF

Make it yours in Hue42

  1. Start from a palette or your brand color

    Open any palette here, or type your brand's hex code and let Hue42 build the rest around it. A screenshot or a product photo works too, and it stays on your device.

  2. Keep what you like

    Generate a new palette as often as you like. Lock the colors you want to keep and the rest change around them.

  3. Check it, then copy it

    Every palette gets five checks, among them its best text pair against 4.5 to 1. Select any color to copy its hex code, or export CSS, SCSS, Tailwind or JSON.

Open these colors in Hue42
The Hue42 color tool showing the Espresso and Teal palette in five columns, each with its hex code, its name in the tool and its color name.

Names you will see in Hue42

  • PageHue42: Anchor#0F0A06
  • SurfaceHue42: Base#082820
  • BorderHue42: Analog#365E5A
  • AccentHue42: Accent#E48B54
  • TextHue42: Tint#FAECDD

More UI themes

Use these colors in a website

Five roles, one job each

A token called blue-500 tells you what the color looks like. A token called accent tells you what it does, so you can change the color later without renaming anything.

These five are a starting point. A real product usually adds a few more: a muted text color and a hover fill come from the five, while status colors may need hues outside them, always with a word or an icon beside them.

page.
The background of the whole screen. Usually the lightest color in a light theme and the darkest in a dark one.
surface.
Cards, panels, sidebars and menus that sit on the page, one step away from it.
border.
Dividers and outlines, nothing else. Where it reaches 3 to 1 against the color behind it, it can outline an input. Below that it is a decorative divider, and a boundary that matters needs another cue, such as a fill or a label.
accent.
Buttons, links and the one thing you want noticed.
text.
Body copy and headings, with the strongest contrast against both page and surface.
Contrast in short

Normal size text needs a WCAG contrast ratio of 4.5 to 1. Large text, which WCAG sets at 24 CSS pixels, or about 18.7 pixels in bold, needs 3 to 1, and so do the parts that identify a control, such as an input outline, against the colors next to them. Each palette's checks show its best text pair, rounded down, never up.

The usual traps: a bright accent like lemon or orange is a fill, not a text color; a light accent in a dark theme takes dark labels on its buttons, not white; and a color that passes on the page can fail on a tinted card.

Dark mode is its own palette

Flipping black and white rarely works. Pure white text on pure black can glare, and a saturated accent that looks fine on light often vibrates on dark.

Build the dark theme as a separate set: a page that is not quite black, surfaces a little lighter than it, softer text and an accent with more lightness. Espresso and Teal, Neon Street, Forest Cabin, Harbor Night and Graphite Dark above are built that way. Then check every pair again from scratch.

Hover, focus and disabled states

You rarely need new colors for states. For hover and pressed, change the accent's lightness and keep its hue, then check the label on it and the surface around it again. A focus ring can be the accent itself, as long as it reaches 3 to 1 against the colors next to it, not only the page.

Inactive controls are exempt from the contrast rules, so a muted gray works there, but do not reuse that gray for text people need to read.

From palette to CSS variables

Give each role a custom property on the root, such as --page, --surface, --border, --accent and --text, and have your components read those names. A dark theme is then the same names with new values inside a prefers-color-scheme media query or under a data attribute.

Hue42's CSS export names its variables by the tool's own roles, such as --color-anchor, --color-base and --color-tint, which describe a color's place in the palette, not its job on a screen. Map them to your five names once by hex code, for example --page: var(--color-anchor) when the anchor is your page color. Hex, RGB and HSL describe the same color: #3B6FD8 is rgb(59, 111, 216) and about hsl(220, 67%, 54%).

Chart colors

Chart series need to stay apart from each other and from the plot background, so vary lightness as well as hue, and check them in grayscale and with a color vision simulation.

Do not let color carry the meaning alone: label lines directly, or add markers or dash patterns, so a reader who cannot tell two hues apart still can tell the series apart.

Questions people ask

What is a hex color code?

A hex code is a base-16 value after a hash sign that gives the red, green and blue amounts of a color. This page uses six-digit codes: #3B6FD8 means 3B red, 6F green and D8 blue. CSS also reads three-digit shorthand such as #FFF. In four-digit #RGBA the last digit sets opacity, and in eight-digit #RRGGBBAA the last two do.

What contrast ratio do I need for text?

Under WCAG level AA, normal text needs a contrast ratio of at least 4.5 to 1 against its background. Large text, 24 CSS pixels or about 18.7 pixels bold, needs 3 to 1. Check each text color on every surface it sits on, because a tinted card or a hover fill changes the result.

Why do some accents need dark labels on their buttons?

A light or bright accent, such as copper on a dark page or lemon on a light one, leaves too little contrast with white. The fix is a dark label from the same palette, usually the page color in a dark theme; the notes say which palettes need it. Check your button label against its fill yourself: a palette's best text pair does not validate every combination.

What are good colors for success, warning and error?

Green, amber and red are the common choices, with blue for information. Use darker versions for text and lighter tints for message backgrounds, and always add an icon or a word so the meaning does not depend on color alone. Amber is usually too light for text on a white page, so use it as a fill.

How do I copy the hex codes from this page?

Each palette on a photo card prints its five hex codes under its description as plain text you can select, and pressing a color on the card's strip copies its code. To get all five at once in the right format, open the palette in Hue42 and export it as CSS, SCSS, Tailwind or JSON.

Do I need an account to export a palette?

No. In the Hue42 color tool, CSS, SCSS, Tailwind, JSON and SVG exports can be copied or downloaded without an account. Pro adds design tokens with every shade and text pairing, and Figma variables through the free Tokens Studio plugin. Every palette here opens in the tool by link, ready to adjust and check first.

Build a palette around your brand color

Open any palette in the Hue42 color tool, put your own color in as the accent, and see whether the text pairs still pass. When it works, export it as CSS, SCSS, Tailwind or JSON.

Open these colors in Hue42

Or pull a palette from a screenshot or a photo of a product