Colour Picker

Share:
Developer Tools

Colour Picker

Pick colours and convert between HEX, RGB, HSL and CMYK — with CSS snippets ready to copy.

By Checked against sources by Last reviewed CSS COLOUR DEVELOPER HEX HSL RGB
Your browser is too old for this tool’s interactive features. Please update to Safari 13.1, Chrome or Edge 80, Firefox 74 or newer.

Colour Picker Tool

Click the circle to open the colour picker, or type a value into any field below and press Enter: HEX (3, 6 or 8 digits), rgb(), hsl(), cmyk(), or a pasted CSS declaration.

HEX
RGB
HSL
CMYK
CSS
Recent Colours
Colour Harmonies
WCAG 2.2 contrast, as a text colour

AA needs 4.5:1 for body text and 3:1 for large text (about 24px, or 18.5px bold); AAA needs 7:1. To test this colour against any other background, and get the nearest colour that passes, use the WCAG contrast checker.

Advertisement
After results · AD-W1 Responsive · Post-tool — peak engagement

How to Use the Colour Picker

Open the colour picker

Click the colour circle to open your browser's native colour picker. Drag the selector to any colour — the preview swatch at the top and all output fields update instantly as you drag.

Type any format directly

You can type a HEX code (e.g. #1a2b3c), an RGB value (e.g. rgb(26, 43, 60)), an HSL value (e.g. hsl(210, 40%, 17%)) or a CMYK value into any field and press Enter — all other formats update automatically. An eight-digit HEX such as #E8622A80 or an rgba() keeps its transparency.

Copy your format

Click Copy next to any format row to copy it to your clipboard — HEX for web hex codes, RGB for CSS with transparency (rgba()), HSL for design tokens and dark mode, or the ready-to-paste CSS snippet.

Check WCAG contrast

The contrast section treats your colour as a text colour and grades it on white and on black, with a badge for each WCAG 2.2 threshold: AA (4.5:1), AA large text (3:1) and AAA (7:1). The line under it says which of black or white to put on top of the colour, for a button or a badge. A ratio is never rounded up onto a threshold it misses: 4.496 is printed as 4.496, not 4.50.

Advertisement
After how-to · AD-W2 Responsive

Colour in Web Design — From Hex Codes to Accessibility Standards

HEX vs RGB vs HSL: Which Should You Use in Your Stylesheet?

HEX is the most widely used colour format in web development. Its compact six-character form — #1a2b3c — is immediately recognisable, well-understood by every design tool, and understood by every browser. For most static colour assignments, HEX is the pragmatic default.

RGB shines when you need programmatic manipulation or when you want to add transparency. The CSS rgba(26, 43, 60, 0.5) form gives you a clean half-transparent variant of any colour without needing a design tool. When writing JavaScript that generates colours dynamically — data visualisation, generative art, interactive UI — RGB's numeric channels are the easiest to compute with.

HSL is the format designers think in. Hue is the colour wheel angle (0–360°), saturation is the vibrance (0% is grey; 100% is fully saturated), and lightness is the brightness (0% is black; 100% is white; 50% is the pure colour). You can make a colour lighter or darker by changing L alone and keep its hue.

This predictability makes HSL ideal for design tokens and dark mode. Modern CSS custom properties work beautifully with HSL: define a base hue once, then derive your full palette by varying saturation and lightness. When a user switches to dark mode, you change the lightness variable — one line of code, the entire palette adapts.

Looking forward, CSS Color Module Level 4 adds oklch(), built on the Oklab colour space. Unlike HSL, it is designed to be perceptually uniform, so equal steps in lightness look like equal steps — HSL's 50% lightness is far brighter in yellow than in blue. This picker converts HEX, RGB, HSL and CMYK; the colour code converter adds HSB, CIE Lab and oklch.

Colour Accessibility in Web Design: WCAG Contrast Ratios Explained

The Web Content Accessibility Guidelines (WCAG) 2.2 define minimum contrast ratios that ensure text remains readable for users with low vision or colour blindness. The standard has two levels this tool checks: AA and AAA (enhanced accessibility). For normal body text, AA requires a contrast ratio of at least 4.5:1 and AAA requires 7:1 against the background. Large text — at least 18pt or 14pt bold, which the W3C's Understanding document converts to approximately 24px and 18.5px — has a lower AA threshold of 3:1.

Why does this matter? Red-green colour deficiency affects about 8% of men of European descent and 4–6.5% of men of Chinese and Japanese ethnicity, against about 0.4% of women (Birch, 2012). For these users, and for anyone with low vision, low-contrast combinations — light grey text on white, or green text on red — are hard or impossible to read. In a written parliamentary answer on 12 November 2024, the Ministry of Digital Development and Information said the Government plans to make all high-traffic Government websites — those with one million visits a year — accessible by 2030. (The question named WCAG 2.1 AA; the answer does not name a level.)

Common accessibility failures to avoid: light grey (#aaaaaa) on white fails AA at 2.32:1; medium blue on dark navy; yellow text on white (particularly problematic as yellow has high luminance). Tools for systematic checking beyond this picker include Chrome DevTools' colour picker with built-in contrast indicator, Google Lighthouse accessibility audit, and the free browser extension WAVE by WebAIM.

RECATOOLS' own accent, #E8622A, scores 3.38:1 against white — enough for large text under WCAG AA, not for body copy.

📅 Research current as of 05 Nov 2026 · Sources: W3C CSS Color Module Level 4 for HEX, rgb() and hsl() and the HSL hue rotation; WCAG 2.2 (W3C Recommendation, 12 December 2024) for relative luminance, the contrast ratio and the AA/AAA thresholds. No external rates or network calls.
Standards, published formulas, and reference data are revised over time — check against a current authoritative source before relying on these figures.

Frequently Asked Questions

  • A HEX colour code is a six-digit base-16 number prefixed with # that represents a colour in RGB format. The first two digits are the red channel (00–FF), the next two green, and the last two blue. For example, #E8622A means red=232 (E8), green=98 (62), blue=42 (2A). HEX codes are the most common colour format in web development and are supported in every browser and CSS preprocessor.
  • Use HEX for static colour definitions — it is compact and universally understood by designers and developers. Use RGB (or its rgba() form) when you need transparency: rgba(232, 98, 42, 0.5) gives a 50% transparent version of a colour. RGB is also easier to manipulate programmatically in JavaScript when generating colours dynamically.
  • HSL stands for Hue, Saturation, Lightness. Hue is the colour wheel position (0–360°), saturation is the intensity (0% is greyscale, 100% is fully vibrant), and lightness is the brightness (0% is black, 50% is the pure colour, 100% is white). Designers prefer HSL because it matches how humans think about colour — you can create a lighter tint or darker shade simply by adjusting the L value. It is ideal for design tokens, colour palettes, and implementing dark mode in CSS.
  • CMYK (Cyan, Magenta, Yellow, Key/Black) is the colour model used by inkjet and commercial printers. Unlike RGB (which is additive — mixing light), CMYK is subtractive — inks absorb light. This means not all RGB colours can be reproduced in print. You will need CMYK values when supplying artwork to a print shop, designing business cards, or specifying brand colours for print media. This tool shows CMYK as percentages of each ink, from the simple formula K = 1 − max(R, G, B). That is not a print separation: real ink values depend on the press, paper and the printer's ICC profile, so ask the printer to convert your RGB or supply their profile.
  • WCAG (Web Content Accessibility Guidelines) defines minimum contrast ratios between text and its background to ensure readability for users with low vision or colour blindness. Level AA requires a minimum ratio of 4.5:1 for normal text and 3:1 for large text (18pt+). Level AAA requires 7:1 for normal text. This tool computes the contrast ratio for your chosen colour as text on white and on black; to test it against another background, use the WCAG contrast checker.
  • CSS supports transparency via the alpha channel. Copy the RGB value from this tool and modify it to use rgba() — for example, rgba(232, 98, 42, 0.5) for 50% opacity. Modern CSS also supports #E8622A80 — a HEX code with an extra two digits for the alpha channel (80 in hex = 128, about 50%). HSL also has an alpha form: hsla(18, 81%, 54%, 0.5).
  • RGB is an additive model: red, green and blue light are added together, with all three at full intensity producing white. It is used for screens, monitors and digital displays. CMYK is a subtractive model: cyan, magenta, yellow and black inks are laid on paper, each absorbing (subtracting) wavelengths of light, with all four at full density producing near-black. It is used for printing. Because the two models have different gamuts (range of reproducible colours), some vivid RGB colours — especially saturated oranges and greens — cannot be exactly reproduced in CMYK.
  • The complementary colour is directly opposite on the colour wheel — it is calculated by adding 180° to the hue value in HSL. For example, the complement of orange (hue ≈ 21°) is a blue (hue ≈ 201°). Complementary colour pairs create maximum contrast and visual vibrance. This tool shows the complementary colour alongside two analogous colours (hue ±30°) in the Colour Harmonies section — click any swatch to set it as the active colour.
  • The RECATOOLS accent colour is #E8622A — a coral-orange. In RGB it is rgb(232, 98, 42); in HSL it is hsl(18, 81%, 54%). It scores 3.38:1 against white, which passes WCAG AA for large text (3:1) but not for normal body text (4.5:1) — so it suits headings and highlights, not body copy.
  • Every conversion runs in your browser. The colours are never sent anywhere and never put in the address bar. The Recent Colours row keeps your last eight colours in this browser's local storage so they survive a reload; the Clear button empties it, and so does clearing this site's data in your browser.

Method & sources

How it computes

CSS Color 4 HEX (3/4/6/8 digits), rgb() and hsl() conversions and a naive CMYK (K = 1 − max(R,G,B)); WCAG 2.2 contrast of the colour as text on white and on black (relative luminance, 0.04045 threshold, translucent colours composited first), graded unrounded against 4.5:1, 3:1 and 7:1; complement and ±30° analogous colours from the unrounded HSL hue.

What this tool implements

  • HEX, rgb() and hsl() parsing and the HSL conversions follow CSS Color Module Level 4 (§5, §7.1 and §7.2 sample code). Eight-digit HEX and rgba()/hsla() keep their alpha.
  • Contrast is WCAG 2.2 relative luminance and contrast ratio. A translucent colour is graded as it shows: composited source-over onto white and onto black. Verdicts use the unrounded ratio and the printed ratio never crosses a threshold the verdict did not (Understanding SC 1.4.3: the computed values should not be rounded).
  • The badges are AA (4.5:1), AA large text (3:1, large being at least 18pt or 14pt bold, approximately 24px and 18.5px) and AAA (7:1). Until 2026-11-05 only AA normal and AAA were shown, so a colour that passes for large text read as a plain fail.
  • Harmonies rotate the unrounded CSS HSL hue by 180° and ±30° at the same saturation and lightness; HSL is not perceptually uniform, which the page says.
  • CMYK is the naive device-independent formula and is labelled as not a print separation.
  • Birch (2012): red-green colour deficiency in about 8% of European Caucasian men and 0.4% of women, and 4%–6.5% of men of Chinese and Japanese ethnicity.

Sources

  • W3C. CSS Color Module Level 4, Candidate Recommendation Draft 3 November 2026: https://www.w3.org/TR/css-color-4/
  • W3C. Web Content Accessibility Guidelines (WCAG) 2.2, W3C Recommendation 12 December 2024 — relative luminance, contrast ratio, SC 1.4.3 and 1.4.6: https://www.w3.org/TR/WCAG22/
  • W3C WAI. Understanding SC 1.4.3 Contrast (Minimum) — 1pt = 1.333px, "approximately 18.5px and 24px", unrounded thresholds: https://www.w3.org/WAI/WCAG22/Understanding/contrast-minimum.html
  • Birch J. Worldwide prevalence of red-green color deficiency. J Opt Soc Am A Opt Image Sci Vis. 2012;29(3):313-320. doi:10.1364/JOSAA.29.000313
  • Ministry of Digital Development and Information (Singapore). MDDI's response to PQ on Ensuring High Traffic Government Websites Conform To WCAG, written answer, Parliament sitting of 12 November 2024 (cited by title; MDDI's terms restrict linking).

What can make this go out of date

  • None at runtime: every value is computed in the browser from the colour entered. The Recent Colours row is kept in this browser's local storage (up to 8) and is never sent anywhere or put in the URL.
Advertisement
Pre-footer · AD-W3 728 × 90