# Color Picker

URL: https://hifreetools.com/color/color-picker

> Pick a color with a visual picker, fine-tune it, and copy the exact HEX, RGB, HSL, HSV, and CMYK codes — with a large live preview of your choice.

## Quick answer

A color picker lets you choose a color visually and read its codes. Use the picker (and sliders) to land on a shade, and the tool shows the matching HEX, RGB, HSL, HSV, and CMYK values, each with a copy button. It updates a large swatch live so you can see exactly what you are selecting, all in your browser.

## Formula

- HSL and HSV from the largest and smallest of R, G, B (0–1); CMYK: K = 1 − max(R, G, B), C = (1 − R − K) ÷ (1 − K)
- OKLCH: linear sRGB → OKLab with Ottosson's matrices, then C = √(a² + b²), h = atan2(b, a)
- Contrast (WCAG 2.2): (L1 + 0.05) ÷ (L2 + 0.05), L = 0.2126 R + 0.7152 G + 0.0722 B on linear channels
- Tints mix toward white and shades toward black in 20% steps

The picker reads the selected color as RGB channels and converts them to the other models with the standard formulas: HSL and HSV from the max and min channels, and CMYK from the black key value. Optional sliders adjust hue, saturation, and lightness, which are converted back to RGB so the swatch and every code stay in sync.

## Inputs

- Colour (HEX, rgb() or hsl()); default #1F4FD8

## Worked examples (computed by the page's own function)

- Colour (HEX, rgb() or hsl()) = rgb(0, 128, 255) → HEX = #0080FF, RGB = rgb(0, 128, 255), HSL = hsl(210, 100%, 50%), HSV = hsv(210, 100%, 100%)  (L = 0.2266 · white 1.05 ÷ (L + 0.05) = 3.80 · black (L + 0.05) ÷ 0.05 = 5.53)
- Colour (HEX, rgb() or hsl()) = #777777 → HEX = #777777, RGB = rgb(119, 119, 119), HSL = hsl(0, 0%, 47%), HSV = hsv(0, 0%, 47%)  (L = 0.1845 · white 1.05 ÷ (L + 0.05) = 4.48 · black (L + 0.05) ÷ 0.05 = 4.69)
- Colour (HEX, rgb() or hsl()) = #f60 → HEX = #FF6600, RGB = rgb(255, 102, 0), HSL = hsl(24, 100%, 50%), HSV = hsv(24, 100%, 100%)  (L = 0.3076 · white 1.05 ÷ (L + 0.05) = 2.94 · black (L + 0.05) ÷ 0.05 = 7.15)

## Verification

Checked against 16 reference cases (expected values computed independently). Reviewed 2026-10-27. Latest change 2026-10-28: Moved to the schema color renderer; adds OKLCH, WCAG 2.2 contrast against white and black with AA/AAA verdicts, and a tint/shade ramp. Accepts hex, rgb() and hsl() text.

## FAQ

**What codes does the color picker give me?**
For any color you pick it shows HEX, RGB, HSL, HSV, and CMYK, each with its own copy button so you can paste the format your project needs.

**Can I fine-tune the color?**
Yes. Beyond the visual picker, sliders let you nudge hue, saturation, and lightness, and every code plus the preview swatch update instantly.

**Does it support an eyedropper?**
On browsers that support the EyeDropper API, a pick-from-screen option may be offered. Where it isn't available, use the visual picker and sliders instead.

**Is the picker free and private?**
Yes. It is completely free and runs entirely in your browser, so your colors are never uploaded.

**What is the difference between this and the color converter?**
The picker is for choosing a color visually, while the color converter is for typing an existing code and translating it. Both output the same set of formats.

**How do I make a color lighter or darker?**
Adjust the lightness slider, or use the Color Shades Generator to produce a full ramp of tints and shades from your base color.


## Sources

- [W3C — WCAG 2.2: relative luminance and contrast ratio definitions](https://www.w3.org/TR/WCAG22/)
- [W3C — Understanding SC 1.4.3 Contrast (Minimum)](https://www.w3.org/WAI/WCAG22/Understanding/contrast-minimum.html)
- [W3C — CSS Color Module Level 4 (hex, rgb(), hsl(), oklch())](https://www.w3.org/TR/css-color-4/)
- [MDN — <color> CSS data type](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value)
- [Wikipedia — HSL and HSV](https://en.wikipedia.org/wiki/HSL_and_HSV)
- [Wikipedia — CMYK color model](https://en.wikipedia.org/wiki/CMYK_color_model)
- [Björn Ottosson — A perceptual color space for image processing (OKLab)](https://bottosson.github.io/posts/oklab/)

Runs in the browser; nothing is uploaded. Cite as: HIFreeTools, "Color Picker", https://hifreetools.com/color/color-picker
