Skip to content

Color Calculator

Mix two colours, convert hex to RGB, HSL and CMYK, find the complement and check text contrast, all in one place.

Free, no sign-up · Last updated

US defaults ·

Mixed colour

#945C73

RGB
148, 92, 115
HSL
335°, 24%, 47%
CMYK (%)
0, 38, 22, 42
Complement
#5B947C

Colour 1

Mixed

Colour 2

Complement

Contrast with white text5.22:1 · AA
Contrast with black text4.02:1 · AA large text only

Mixing blends the red, green and blue values directly, like most design tools. It is not the same as mixing paint, which is subtractive. Contrast levels follow WCAG 2: 4.5:1 for normal text (AA) and 7:1 for AAA.

Definition

What digital colour values represent

Digital RGB colour is specified by the intensities of red, green and blue. A six-digit hex code stores those same three channels as pairs of hexadecimal digits. An RGB mix works by blending corresponding channel values in a chosen proportion.

Hex code
Two digits per red, green and blue channel
Mix percentage
Share of the second colour
Text contrast
Check the actual foreground and background

Colours on a screen

Every colour on a screen is a mix of red, green and blue light, each from 0 to 255. That gives the RGB value, and writing the three numbers in hexadecimal gives the familiar hex code used on the web. HSL describes the same colour as hue (the position on the colour wheel in degrees), saturation (how vivid) and lightness (how bright), which is often easier to reason about when you want a lighter or duller shade.

CMYK is used in print. It describes how much cyan, magenta, yellow and black ink to use. The conversion here is the simple mathematical one. A real printer uses colour profiles, so printed colours can differ.

A worked example

Mix #2F44D0 (a strong blue) with #F97316 (orange) at 50%. The red channels are 47 and 249, so the mix is 148. Green is 68 and 115, so 91.5, and blue is 208 and 22, so 115. That is RGB (148, 92, 115), which is #945C73, a muted mauve. The mix has a contrast ratio of 5.22:1 with white text before the channels are rounded. The hex colour has a ratio of 5.20:1 with white, which also passes AA for normal text.

Checking readability

Choosing text and background colours is where the contrast ratio helps. The result shows the ratio for the mixed colour against both white and black text. The better of the two is the safer text colour, and if neither reaches 4.5:1 the colour is a poor background for small text.

For wall and room projects, the paint calculator works out how much you need once you have chosen a colour.

Choosing accessible colours

Text needs enough contrast against its background to be readable by people with low vision. WCAG asks for at least 4.5:1 for body text and 3:1 for large text, and 7:1 for the stricter AAA level. Use the contrast figures under the result to check any colour you plan to use as a background.

The complement (the colour opposite on the colour wheel) makes a strong accent, and lighter or darker versions of one colour make a safe palette. Colour alone should not be the only way to carry information, since some people cannot tell certain colours apart.

Step-by-step example

Mix the two sRGB colours #2F44D0 and #F97316 in equal proportions.

StepResult
Red channel148
Green channel before rounding91.5
Blue channel115
Rounded RGB148, 92, 115
Hex code#945C73
Mixed colour contrast with white5.22:1

Formulas used

Hex to RGB

#RRGGBB: each pair is a base-16 number from 0 to 255

RR
two hexadecimal digits for red
GG
two hexadecimal digits for green
BB
two hexadecimal digits for blue

Example: #2F44D0: 2F = 47, 44 = 68, D0 = 208, so RGB (47, 68, 208).

Mixing two colours

Mixed channel = A + (B − A) × t (t = share of colour 2, from 0 to 1)

A
channel value in the first colour
B
channel value in the second colour
t
fraction contributed by the second colour

Example: A 50/50 mix of #2F44D0 and #F97316: red (47 + 249) ÷ 2 = 148, green (68 + 115) ÷ 2 = 91.5, blue (208 + 22) ÷ 2 = 115, which is #945C73.

Contrast ratio (WCAG)

Luminance L = 0.2126 R + 0.7152 G + 0.0722 B (after sRGB linearisation)

Contrast = (L₁ + 0.05) ÷ (L₂ + 0.05), with L₁ the lighter

L
relative luminance
R
linearised red channel
G
linearised green channel
B
linearised blue channel
L₁
higher relative luminance
L₂
lower relative luminance

Example: #945C73 against white text: 5.20:1, which passes AA (4.5:1) for normal text.

When the answer can mislead

  • An RGB midpoint can differ from the blend you get in a colour space designed around perception.
  • Transparency changes the colour behind text, so check contrast after compositing.
  • Rounding channels to a hex code can change contrast close to an accessibility threshold.

Questions

How do I convert a hex colour to RGB?

A hex colour is three pairs of hexadecimal digits for red, green and blue. Convert each pair from base 16 to base 10. For #2F44D0, 2F = 47, 44 = 68 and D0 = 208, so the RGB value is 47, 68, 208. Short hex codes such as #FA0 repeat each digit, so #FA0 means #FFAA00.

How does the colour mix work?

The mix is a straight blend of each channel. At 50% the red, green and blue values of the two colours are averaged. Red (255, 0, 0) and blue (0, 0, 255) at 50% give (128, 0, 128), which is #800080, a purple. Move the slider to take more of one colour.

What is a complementary colour?

It is the colour opposite on the colour wheel, found by turning the hue 180 degrees and keeping the saturation and lightness. Complementary pairs, such as blue and orange, create strong contrast and are often used together in design.

What does the contrast ratio mean?

Contrast ratio compares the brightness of two colours, from 1:1 (identical) to 21:1 (black on white). The Web Content Accessibility Guidelines ask for at least 4.5:1 for normal text (level AA) and 7:1 for the stricter level AAA. Large text only needs 3:1 for AA.

Why does mixing here differ from mixing paint?

Screens make colour by adding light, but paint absorbs light, so the results of mixing differ. Blue and yellow light make a grey-ish tone on screen, while blue and yellow paint make green. The calculator shows what a digital blend looks like.

Last updated How we check
Embed this calculator
Cite this calculator

Color Calculator. CalculatorLab. https://calculatorlab.site/calculators/color-calculator/. Last updated .