What a color picker does
A color picker lets you choose a color by eye instead of typing numbers, then gives you the code for it. Used as a hex color picker, this one shows the result as HEX and 8-digit HEX with alpha, plus RGB, HSL, HSV, OKLCH and CMYK. It also names the nearest of the 148 CSS color names and shows the WCAG contrast ratio of white and black text on the color. It runs entirely in your browser, and the last color you picked is remembered in this browser (in local storage) for your next visit.
How the square and sliders work
The picker uses the HSV model (hue, saturation, value; value is also called brightness, so the same model is sometimes written HSB). The hue slider chooses a point on the color wheel, from red at 0° through yellow, green, cyan and blue back to red at 360°. The square then shows every saturation and brightness of that hue:
- Left to right is saturation, from 0% (no color, a gray) to 100% (the full hue).
- Bottom to top is value, from 0% (black) to 100% (full brightness).
CSS has no hsv() function, so the picker converts the position to HEX, RGB and HSL for you. HSV and HSL share the same hue; only the other two numbers change. Lightness is L = V × (1 − S ÷ 2), and HSL saturation is (V − L) ÷ min(L, 1 − L), or 0 when L is 0 or 1. That is why the corners of the square land on these HSL values (hue 160):
| Square position | HSV | HEX | HSL |
|---|---|---|---|
| Top left | hsv(160, 0%, 100%) | #FFFFFF | hsl(160, 0%, 100%) |
| Top right | hsv(160, 100%, 100%) | #00FFAA | hsl(160, 100%, 50%) |
| Middle | hsv(160, 50%, 50%) | #40806A | hsl(160, 33%, 38%) |
| Bottom (any) | hsv(160, any, 0%) | #000000 | hsl(160, 0%, 0%) |
The top edge goes from white to the purest form of the hue, which is HSL lightness 50%, not 100%. The whole bottom edge is black, so the picker remembers the hue and saturation you had, and dragging back up returns to the same color family instead of jumping to red.
Worked example
Set the hue to 160° and put the handle 75% of the way across and 70% of the way up, so S = 0.75 and V = 0.70.
- L = 0.70 × (1 − 0.75 ÷ 2) = 0.4375, so 44%
- HSL saturation = (0.70 − 0.4375) ÷ min(0.4375, 0.5625) = 0.600, so 60%
- The RGB channels, rounded to whole numbers, are 45, 179 and 134
The tool shows #2DB386, rgb(45, 179, 134), hsl(160, 60%, 44%) and oklch(68.53% 0.1311 165.34). The nearest CSS name is mediumseagreen (#3CB371), 0.028 away (deltaE OK), so it is close but not an exact match. White text on it has a contrast ratio of only 2.66:1, which fails WCAG AA even for large text; black text has 7.9:1, which passes AAA for normal text.
Positions in the square are rounded to whole RGB channels, and the arrow keys move in 1% steps, so not every HEX code is easy to land on by hand. To get an exact code, type it into the box.
Eyedropper: pick a color from your screen
The Pick from screen button uses the EyeDropper API. Click it, move the magnified cursor to any pixel, including pixels outside the browser window, and click to take that color; press Esc to cancel. The browser only starts picking after you click the button, and the page receives the color of the one pixel you choose, not an image of your screen.
The API is available in Chromium-based browsers on desktop, such as Chrome and Edge from version 95. As of November 2026, Firefox, Safari and mobile browsers do not have it, so the button is hidden there. In those browsers, take a screenshot and open it in the image color picker, which reads any pixel of an image.
HEX, RGB and HSL color codes
All three describe the same sRGB colors in CSS. HEX (#2DB386) is the most compact and the most widely copied format. RGB (rgb(45, 179, 134)) gives the red, green and blue channels from 0 to 255 as plain numbers, which is what you want from an RGB color picker when code expects separate channels. HSL (hsl(160, 60%, 44%)) is the easiest to adjust by hand, because you can change lightness without touching the hue. For how each conversion is calculated, see the color converter.
For transparency, copy the 8-digit HEX or rgba() row; see the color converter for how alpha is stored.
Keyboard controls
| Key (square focused) | Effect |
|---|---|
| Left / Right arrow | Saturation down / up by 1% (10% with Shift) |
| Down / Up arrow | Brightness down / up by 1% (10% with Shift) |
| Home / End | Saturation 0% / 100% |
| Page Down / Page Up | Brightness 0% / 100% |
The hue and opacity sliders are standard range inputs: arrow keys move them by one step, and Home and End jump to the ends.
Common mistakes
- Reading the HSV numbers as HSL.
hsv(160, 75%, 70%)is#2DB386, buthsl(160, 75%, 70%)is the much lighter#79ECC6. Copy the HSL row when writing CSS. - Judging contrast by the square. A color near the top of the square can still be too dark or too light for text. Check the white and black text ratios, or the contrast checker for other text colors.
- Checking contrast on a see-through color. With opacity below 100%, the real color depends on what is behind it, so the ratios here are for the solid color.