Pulsebook · Blog5 min read

Brand color guidelines: hex, RGB, CMYK, OKLCH, roles and contrast

What to write in brand color guidelines: each color in hex, RGB, HSL, OKLCH and CMYK, a role per color, usage ratios and the contrast pairs that pass.

Brand color guidelines should give every color a name, a role and its values in every format your team uses: hex, RGB, HSL and OKLCH for screens, CMYK (and a Pantone reference if you print spot colors) for print. Then they should say which pairs of colors are allowed together, with the contrast ratio. A palette of swatches with no roles leaves people to guess, and they guess differently.

This guide covers what to specify, how to write it, and how to check that your color pairs are readable. It assumes you are writing the color section of a larger guideline; if you are not there yet, start with how to create brand guidelines.

Which color formats should a guideline include?

Include every format somebody will paste into a tool. The same color gets written five ways, and each audience uses a different one.

Colour formats a guideline should list, who uses each and what to note.
FormatUsed byNotes
HexDesigners, developers, most design toolsShort and easy to copy. The one people quote
RGBScreens, slides, videoSame color as hex, written as three numbers
HSLCSS authors who tweak a colorEasy to lighten or darken, but not perceptually even
OKLCHModern CSS, palette generationLightness, chroma, hue. Steps look more even to the eye
CMYKPrintDepends on paper and press; get it from a proof
PantonePrint and packaging, spot colorName the reference and the coating

Here is one color written all the ways a screen needs it:

css
--brand-blue: #1f5fbf;
--brand-blue: rgb(31 95 191);
--brand-blue: hsl(216 72% 44%);
--brand-blue: oklch(50.2% 0.164 259);

Compute the derived values from the hex, and write them once. If you type each by hand, one of them will be wrong.

Why list OKLCH?

OKLCH is the cylindrical form of the OKLab color space. Its L is perceived lightness, whereas HSL's L is lightness relative to the sRGB space, so equal numeric steps in OKLCH look closer to equal visual steps. According to MDN, oklch() has been widely available across major browsers since May 2023. It is useful for generating tints and shades that hold together and for setting dark mode colors by lightness. See MDN's oklch() reference (opens in a new tab) for the syntax.

You do not need to ask people to design in OKLCH. You list it so those who want it have it.

What about CMYK?

CMYK is a print model, and a conversion from a hex value is only an estimate. Printers differ, and so do paper and ink. If your brand prints anything, ask the printer for a proof, record the CMYK values that matched, and write them next to the hex. If you use a Pantone color, name it and the coating, since the same number looks different on coated and uncoated stock.

If the brand never prints, say so and leave CMYK out. A made-up CMYK value is worse than none.

How do you give colors a role?

A role tells people what a color is for. Start with a short list:

  • Background. The canvas behind everything.
  • Surface. Cards and panels that sit on the background.
  • Ink. Text and icons.
  • Accent. The color that draws the eye: buttons, links, highlights.
  • Secondary. A supporting color.
  • Neutral. Borders, dividers and muted text.
  • Signal. Success, warning and error.

Pulsebook uses these seven roles for the colors in every guideline, so a developer reading a brand.json finds the same labels each time. You can use fewer. What matters is that each color has one job, and that you write a line on when not to use it, for example "never as a text color on the surface color".

How much of each color should be used?

Give a rough share. A statement such as "mostly neutrals, with small moments of the accent" stops a page from turning into a rainbow. GitHub's public color page does this: it suggests mostly neutrals with small moments of green (brand.github.com/foundations/color (opens in a new tab)). Add a percentage if your design team wants more precision. Pulsebook lets you record a usage percentage per color for this reason.

How do you write the contrast rules?

Say which text and background pairs are approved, and give the ratio. The Web Content Accessibility Guidelines (WCAG 2.2) set the AA level at 4.5:1 for normal text and 3:1 for large text, which is 18 point or larger, or 14 point bold (Understanding SC 1.4.3 (opens in a new tab)). Interface components such as input borders, and parts of graphics needed to understand them, need 3:1 against adjacent colors (Understanding SC 1.4.11 (opens in a new tab)).

WCAG 2.2 AA contrast thresholds for the main kinds of brand color pairs.
What it applies toMinimum ratioCriterion
Normal text4.5:1SC 1.4.3
Large text (18 point, or 14 point bold)3:1SC 1.4.3
Interface components, such as input borders3:1SC 1.4.11
Graphics needed to understand content3:1SC 1.4.11

Text that is part of a logo has no contrast requirement under that criterion, but the exception does not apply to a logo that works as a control.

For the example blue above, the computed ratios are:

Contrast ratios of the example blue on three backgrounds, and where each pair may be used.
Text colorBackgroundRatioUse
#1F5FBF#FFFFFF6.09:1Passes AA for body text
#1F5FBF#F4F1EA5.40:1Passes AA for body text
#1F5FBF#1211103.10:1Large text and icons only

A table like this answers the question "can I put this blue on that dark panel?" before anyone asks. Check ratios with any contrast checker and re-check whenever a color changes.

What else belongs in the color section?

  • Tints and shades, if you use them, as named steps rather than ad hoc lightening.
  • Gradients, with the stops and the angle.
  • Dark mode, if you ship it: which colors swap, and whether the accent changes.
  • Colors for data: charts need a set that stays distinguishable, including for people who do not see all colors.
  • What not to do: no new blues, no effects on the logo color, no accent on large areas.

Colors also sit next to type and the logo, so write those sections in the same pass: see typography in brand guidelines and logo usage guidelines.

A short checklist

  1. Every color has a name, a role and a one-line "not for".
  2. Hex, RGB, HSL and OKLCH are derived from one source.
  3. CMYK and Pantone come from a proof, or are left out.
  4. A pair table gives the contrast ratio for approved text and background combinations.
  5. A usage ratio keeps the palette in proportion.

Where Pulsebook fits

In Pulsebook each color has a hex, a role, a group, an optional usage percentage, and optional CMYK and Pantone values. The rgb, hsl and oklch forms are computed from the hex when the page and the brand.json are generated, so they cannot drift. Point it at your website and it drafts the palette from your stylesheet for you to correct. The brand guidelines template has a color section you can fill in without it.

Put your brand on one link.

Draft three brands free. Publish the first one on us. Your client gets one address that stays right.