What This Color Picker Can Do
- Sample colors from images* or start from a precise color wheel or HEX/RGB input
- Rich conversions: HEX, HEX8, RGB/A, HSL/A, HSV, CMYK, XYZ, LAB, LCH
- Built-in WCAG contrast checker against #000000 and #FFFFFF using relative luminance
- Web-safe and shorthand HEX suggestions when applicable
- Color harmonies: complement, triadic, tetradic, analogous, monochrome (computed via hue rotation)
- Luminance and perceived brightness preview to anticipate contrast issues
- Approximate Pantone-like matching based on closest RGB distance (with cached dataset)
- Analysis runs client-side; only minimal data is used when optional Pantone lookup is enabled
🔧 How to Use the Color Picker for color-picker
1. Choose or pick a base color
Paste a HEX value, type RGB/HSL, or use the picker to grab a color from an image or the wheel. The tool normalizes it to a safe HEX value internally.
2. Fine-tune hue and lightness
Adjust hue, saturation and lightness until the swatch looks right. A large preview shows the color on light and dark surfaces for context.
3. Read and copy the formats you need
Copy HEX, HEX8, RGB, RGBA, HSL, HSLA, HSV, CMYK, XYZ, LAB and LCH in one click. Use them for CSS variables, design tokens or handoff notes.
4. Check WCAG contrast
See contrast ratios versus #000000 and #FFFFFF based on sRGB luminance. Use the results to quickly decide if a color works for body text, large titles or UI elements.
5. Generate harmonies & build a palette
Explore complementary, triadic, tetradic, analogous and monochrome colors generated via hue rotation. Add your favorites to a palette/history and export them as tokens.
Technical Details
Input Handling & Normalization
The tool accepts hexadecimal color codes and converts them into a normalized 6-digit HEX as the internal reference.
| Aspect | Behavior | Notes |
|---|---|---|
| HEX normalization | 3-digit and 6-digit HEX, optional leading # | Short HEX (e.g. #0f8) is expanded to #00ff88; non-hex characters are stripped. |
| HEX8 support | RGBA via #RRGGBBAA | Alpha channel is converted to 0–255 and appended as the 4th byte. |
| Web-safe suggestion | Snap to nearest 51-step per channel | Values are rounded to the nearest multiple of 51 (0, 51, 102, 153, 204, 255). |
| Shorthand HEX suggestion | Only when compressible | Shown when each pair of HEX digits is repeated (e.g. #112233 → #123). |
Color Spaces & Conversions
All computations are based on sRGB with a D65 reference white.
| Space | Computation | Usage |
|---|---|---|
| RGB | From normalized HEX (0–255 per channel) | Base representation for conversions. |
| HSL / HSV | Standard cylindrical transforms from sRGB | Used for intuitive edits and harmony calculations. |
| CMYK | Device-independent approximation | Computed as 1−max(R,G,B) with 0–100% components; not tied to ICC profiles. |
| XYZ | Linearized sRGB → XYZ using D65 matrix | Intermediate space for LAB/LCH and deeper analysis. |
| LAB | CIE L*a*b* from XYZ | Perceptually more uniform metric space. |
| LCH | CIE L*C*h° from LAB | Useful for hue/chroma/lightness adjustments and perceptual palette design. |
Luminance & WCAG Contrast
Contrast is computed using the standard WCAG relative luminance formula.
| Aspect | Details | Notes |
|---|---|---|
| Relative luminance | Computed from linearized sRGB (Y component) | Uses coefficients 0.2126R + 0.7152G + 0.0722B. |
| Contrast ratio | (L1 + 0.05) / (L2 + 0.05) | The tool reports contrast vs #000000 and #FFFFFF. |
| WCAG thresholds | AA/AAA for normal and large text | Typical thresholds: 4.5:1 (AA normal), 3:1 (AA large), 7:1 (AAA normal), 4.5:1 (AAA large). |
Harmonies & Derived Colors
Harmonies are generated as simple hue rotations in HSL, preserving saturation and lightness.
| Harmony | Rule | Example |
|---|---|---|
| Complement | +180° hue | Opposite point on the color wheel. |
| Triadic | ±120° hue | Three evenly spaced colors. |
| Tetradic | +90°, +180°, +270° hue | Four colors forming a rectangle on the wheel. |
| Analogous | −30° / +30° hue | Neighbors around the base color. |
| Monochrome | Lighten/darken in L | Brighter and darker versions of the same hue. |
Pantone-Like Matching (Approximate)
When the Pantone dataset is available, the tool computes a closest match in RGB space.
| Aspect | Behavior | Notes |
|---|---|---|
| Dataset loading | Cached + async loading via getPantoneColors / getPantoneColorsCached | UI can show a match instantly when cache is warm, or after a short async load. |
| Match metric | Squared Euclidean distance on RGB (0–255) | Fast, simple approximation; not a perceptual ΔE* metric. |
| Output | Pantone-like ID and name | Displayed as guidance only; not an official Pantone mapping. |
Performance & Privacy
Conversions, luminance, contrast and harmonies are computed entirely client-side. Pantone lookup may consult a local or remote dataset depending on configuration, but raw colors remain simple HEX strings unless you explicitly share or export them.
Popular Use Cases
UI/UX & Front-End
- Create accessible foreground/background pairs for buttons, links and text.
- Export CSS variables and design tokens directly from chosen colors.
- Check contrast for light/dark modes before implementing a theme switcher.
/* CSS color tokens */
:root {
--brand: #4caf50;
--brand-rgb: 76, 175, 80;
--on-brand: #0b0b0b;
}
.button-primary {
background-color: var(--brand);
color: var(--on-brand);
}Branding & Visual Identity
- Derive a primary/secondary/accents palette from a single hero color.
- Explore complementary or triadic options for a logo or product line.
- Get approximate Pantone-like naming before preparing a brand guideline.
Data Visualization & Dashboards
- Define series colors that stay distinguishable on both light and dark backgrounds.
- Use LAB/LCH to design palettes with controlled perceptual steps.
- Quickly check whether chart colors meet contrast expectations in legend and labels.
❓ Frequently Asked Questions
What’s the difference between HEX, RGB, HSL and HSV?
Why do CMYK values look approximate?
What are LAB and LCH useful for?
How is contrast calculated?
Are Pantone names exact?
Do you store my images or colors?
Pro Tips
Always preview colors on both light and dark surfaces; perceived saturation and contrast can change dramatically with context.
Use LAB or LCH when generating tints and shades so that brightness changes feel more uniform to human eyes.
Check AA/AAA contrast for all interactive states (hover, active, disabled), not just the default button color.
Export CSS variables or design tokens from the formats tab to keep colors consistent across your components.
When sampling from images, average over a small area instead of a single pixel to reduce noise from compression and anti-aliasing.
Additional Resources
Other Tools
- CSS Beautifier
- HTML Beautifier
- Javascript Beautifier
- PHP Beautifier
- Sprite Extractor
- Base64 Decoder
- Base64 Encoder
- Csharp Formatter
- Csv Formatter
- Dockerfile Formatter
- Elm Formatter
- ENV Formatter
- Go Formatter
- Graphql Formatter
- Hcl Formatter
- INI Formatter
- JSON Formatter
- Latex Formatter
- Markdown Formatter
- Objectivec Formatter
- Php Formatter
- Proto Formatter
- Python Formatter
- Ruby Formatter
- Rust Formatter
- Scala Formatter
- Shell Script Formatter
- SQL Formatter
- SVG Formatter
- Swift Formatter
- TOML Formatter
- Typescript Formatter
- XML Formatter
- YAML Formatter
- Yarn Formatter
- CSS Minifier
- Html Minifier
- Javascript Minifier
- JSON Minifier
- XML Minifier
- Http Headers Viewer
- PDF To Text
- Regex Tester
- Serp Rank Checker
- Whois Lookup