# Color picker

Pick a color, or paste one as hex, rgb(), hsl(), oklch() or a CSS name, and copy it in every format. Shows the contrast of white and black text on it. Nothing is uploaded.

Page: https://toolkitnow.org/tools/color-picker/

Pick a color, or type one as hex, rgb(), hsl(), oklch() or a name. Every format appears at once. The gray values are an example.

## Good to know

### What it reads

Hex with 3, 4, 6 or 8 digits (the `#` is optional), `rgb()` and `rgba()` with commas or spaces, `hsl()` with degrees or turns, `oklch()`, the 148 CSS color names, `transparent`, or three numbers such as `11 107 71`.

### Which format

HEX and RGB work everywhere. HSL is handy for making a color lighter or darker by hand. OKLCH, in all current browsers, has a lightness that matches how light a color looks, so shades made from it keep even contrast.

### Exact

Each format is rounded only as far as it still converts back to the same color, with room to spare. That is why HSL sometimes shows a decimal: `hsl(217, 91%, 60%)` is not quite `#3b82f6`. Chrome computes OKLCH slightly differently from the CSS specification, so in Chrome about 1 color in 200 (bright greens and cyans with little red) shows its red one step (of 255) off from the OKLCH code.

### Transparency

An alpha (8-digit hex, or the fourth value of `rgba()`) is kept in every format and shown over a checkerboard. The system picker cannot set it.

### Contrast

The WCAG 2 ratio of white and of black text on the color. Body text needs 4.5:1 (AA) or 7:1 (AAA); large text and icons need 3:1. Ratios are cut, not rounded, so 4.499 shows as 4.49:1. A transparent color has no ratio of its own: it depends on what is behind it.

### Pick from screen

Takes a color from anywhere on your screen, in Chrome and Edge on a computer. Other browsers show the color picker only.

### Open from a link

`?color=%230b6b47`, `?color=teal` or `?color=rgb(11,107,71)` opens the page with that color.

Runs in the browser; nothing is uploaded. Part of toolkitnow.org.
