Color Picker
Pick any color and get values in HEX, RGB, HSL, and CMYK formats with variations.
Pick a Color
Color Formats
#3B82F6Click to copyrgb(59, 130, 246)Click to copyrgba(59, 130, 246, 1)Click to copyhsl(217, 91%, 60%)Click to copyhsla(217, 91%, 60%, 1)Click to copycmyk(76%, 47%, 0%, 4%)Click to copyLightness Variations
Color Harmonies
Complementary
Triadic 1
Triadic 2
Analogous 1
Analogous 2
Color Values
Red
59
Green
130
Blue
246
Hue
217deg
What Is a Color Picker?
A color picker is an interactive tool that lets you select any color and instantly see its value expressed in every major color format used across the web, print, and design industries. Instead of memorizing cryptic codes or doing manual conversions, you simply click your chosen color and the tool does the work—outputting HEX, RGB, RGBA, HSL, HSLA, and CMYK representations in one place.
Color pickers are essential for web designers, front-end developers, UI/UX professionals, and digital artists. Whether you are matching a brand color precisely for a CSS stylesheet, preparing artwork for a print shop, or experimenting with palette ideas, having all color formats side by side eliminates errors and saves time.
This online color picker goes further than a plain hex selector. It computes lightness variations—nine steps of the same hue at increasing and decreasing brightness—so you can build a complete tonal scale for a design system. It also generates color harmonies based on proven color theory relationships: complementary, triadic, and analogous colors. All values update in real time as you drag the color wheel or type a hex code directly.
Understanding how different color models describe the same shade helps you work confidently across tools. RGB is native to screens, HSL maps to human perception of hue and lightness, and CMYK is required for professional printing. Our color picker makes switching between these models frictionless.
Color Format Conversions: HEX, RGB, HSL, and CMYK
Every color you see on a screen can be described by multiple mathematical models. This color picker converts between them automatically, but knowing what each model represents helps you choose the right format for your workflow.
HEX (Hexadecimal)
HEX is the most common format in web development. A hex color such as #3B82F6 encodes three bytes—3B for red, 82 for green, F6 for blue—each as a base-16 number from 00 (0) to FF (255). The picker parses hex digits using parseInt(hex.substring(0,2), 16) for red, parseInt(hex.substring(2,4), 16) for green, and parseInt(hex.substring(4,6), 16) for blue.
RGB and RGBA
RGB expresses the same three channels as decimal integers (0–255). RGBA adds a fourth alpha channel for transparency, where 1 is fully opaque. CSS syntax: rgb(59, 130, 246) or rgba(59, 130, 246, 1).
HSL and HSLA
HSL (Hue, Saturation, Lightness) maps much more naturally to human color intuition. Hue is a degree on the color wheel (0°–360°), saturation describes vibrancy (0–100%), and lightness ranges from black (0%) through the pure hue (50%) to white (100%). Because HSL separates perceptual qualities, it is ideal for generating tonal scales and harmonies. This tool uses the standard algorithm described above.
CMYK
CMYK (Cyan, Magenta, Yellow, Key/Black) is the subtractive model used in color printing. The conversion from RGB first calculates K = 1 − max(R', G', B'). If K equals 1 (pure black), all other channels are 0. Otherwise each ink percentage is derived by C = round(((1−R'−K)/(1−K)) × 100), and similarly for M and Y. Note that on-screen CMYK is an approximation; precise print reproduction requires a calibrated ICC color profile.
RGB to HSL Conversion
Where:
- R, G, B= Integer red, green, blue channel values (0–255) parsed from the hex color string
- R', G', B'= Normalized channel values in [0, 1] range (each divided by 255)
- max / min= The largest and smallest of the three normalized channel values
- d= Delta: the range between max and min, used to derive saturation and hue
- L= Lightness: the arithmetic mean of max and min, expressed as a percentage (0–100)
- S= Saturation: how vivid the color is relative to a grey at the same lightness (0–100%)
- H= Hue: the color's angular position on the 360° color wheel
- K (CMYK)= Key (black) component: K = 1 − max(R', G', B')
- C, M, Y= Cyan, Magenta, Yellow ink percentages: e.g., C = round(((1−R'−K)/(1−K)) × 100)
Lightness Variations and Tonal Scales
The lightness variation strip in the color picker shows your selected color at nine different brightness levels. Starting from the base HSL lightness value, the tool generates four lighter steps by adding 10%, 20%, 30%, and 40% to the lightness component (capped at 100), and four darker steps by subtracting 10%, 20%, 30%, and 40% (floored at 0). The base color sits in the center, labeled "Base."
This tonal scale mirrors the convention used by major design systems such as Tailwind CSS, Material Design, and Radix UI, which define colors as numbered scales (50 through 950 or similar). By clicking any swatch in the strip the picker adopts that lighter or darker shade as the new active color, so you can inspect its exact HEX, RGB, HSL, and CMYK values and continue exploring from there.
When building UI components, use lighter variations for backgrounds, hover states, and focus rings, while reserving the deepest shades for body text and borders. This consistent approach to lightness ensures sufficient contrast ratios for accessibility (WCAG 2.1 recommends a minimum 4.5:1 contrast ratio for normal text).
The mathematical relationship is straightforward: only the L channel in hsl(H, S%, L%) changes across the strip. Hue and saturation remain constant, which keeps the color recognizably the same family. This is why HSL is the right model for generating design-system palettes.
Color Harmonies: Complementary, Triadic, and Analogous
Color harmony refers to combinations of hues that are aesthetically pleasing because of their geometric relationship on the color wheel. The picker generates five harmony colors from your base using modular arithmetic on the hue angle.
| Harmony | Hue Offset | Use Case |
|---|---|---|
| Complementary | (H + 180) % 360 | High contrast, call-to-action emphasis |
| Triadic 1 | (H + 120) % 360 | Vibrant, balanced three-color palettes |
| Triadic 2 | (H + 240) % 360 | Third point of the triadic triangle |
| Analogous 1 | (H + 30) % 360 | Serene, cohesive adjacent hues |
| Analogous 2 | (H + 330) % 360 | The opposite adjacent hue (-30°) |
Saturation and lightness are kept equal to the base color so that the harmony relationships are pure—only the hue shifts. Clicking any harmony swatch sets it as the new active color, letting you explore the palette interactively. Triadic schemes work well for playful brands and illustrations; analogous schemes suit professional dashboards and minimal interfaces where visual tension should be low.
Using Color Formats in Web and Print Design
Knowing when to use each format is as important as knowing how to convert between them. Here is a practical guide for common design and development workflows.
CSS Stylesheets
All modern browsers support HEX, RGB(A), and HSL(A) natively. HEX is compact and easiest to copy-paste from design tools. HSL is preferred when you want to tweak colors programmatically—for example, darkening a button on hover by reducing L by 10 percentage points—because the relationship between values and visual output is intuitive. RGBA and HSLA are required whenever you need partial transparency.
Design Tools (Figma, Sketch, Adobe XD)
Design tools typically accept HEX and RGB inputs in their color dialogs. When exporting tokens to a developer handoff, prefer HEX for solid colors and RGBA when layers use transparency. Some tools also let you define HSL for easier palette management.
Print and Pre-press
Professional printing workflows require CMYK values, often alongside a Pantone (PMS) reference. The CMYK numbers from this tool give a screen-based approximation; for production print work, always convert using an ICC color profile in Adobe Illustrator, InDesign, or a similar application to ensure color accuracy on press.
Accessibility and Contrast
When choosing text and background colors, verify contrast ratios. WCAG 2.1 Level AA requires at least 4.5:1 for normal text and 3:1 for large text. The lightness (L) component in HSL is a reliable indicator—a large L difference between foreground and background generally yields high contrast, but always measure with a dedicated contrast checker because hue also affects perceived brightness.
Worked Examples
Converting Tailwind Blue (#3B82F6) to All Formats
Problem:
Given the hex color #3B82F6 (Tailwind's blue-500), compute its RGB, HSL, and CMYK values.
Solution Steps:
- 1Parse the hex channels: R = 0x3B = 59, G = 0x82 = 130, B = 0xF6 = 246.
- 2Normalize to [0,1]: R' = 59/255 ≈ 0.2314, G' = 130/255 ≈ 0.5098, B' = 246/255 ≈ 0.9647.
- 3Compute max = 0.9647 (B'), min = 0.2314 (R'), d = 0.9647 − 0.2314 = 0.7333.
- 4Lightness: L = (0.9647 + 0.2314) / 2 = 0.5980 → round to 60%.
- 5Since L > 0.5: S = d / (2 − max − min) = 0.7333 / (2 − 0.9647 − 0.2314) = 0.7333 / 0.8039 ≈ 0.9122 → round to 91%.
- 6Max is B': H = ((R' − G') / d + 4) / 6 = ((0.2314 − 0.5098) / 0.7333 + 4) / 6 = (−0.3799 + 4) / 6 = 3.6201 / 6 ≈ 0.6034 → H = round(0.6034 × 360) = 217°.
- 7HSL result: hsl(217, 91%, 60%).
- 8CMYK: K = 1 − 0.9647 = 0.0353 ≈ 4%. C = round(((1−0.2314−0.0353)/(1−0.0353))×100) = round((0.7333/0.9647)×100) = round(76.0) = 76%. M = round(((1−0.5098−0.0353)/0.9647)×100) = round((0.4549/0.9647)×100) = round(47.2) = 47%. Y = round(((1−0.9647−0.0353)/0.9647)×100) = round(0/0.9647×100) = 0%.
- 9CMYK result: cmyk(76%, 47%, 0%, 4%).
Result:
HEX #3B82F6 → RGB(59, 130, 246) → HSL(217, 91%, 60%) → CMYK(76%, 47%, 0%, 4%)
Finding the Complementary Color of #E11D48 (Rose-600)
Problem:
Starting from #E11D48 (a vivid red), find its complementary color using the color picker's harmony formula.
Solution Steps:
- 1Parse hex: R = 0xE1 = 225, G = 0x1D = 29, B = 0x48 = 72.
- 2Normalize: R' = 225/255 ≈ 0.8824, G' = 29/255 ≈ 0.1137, B' = 72/255 ≈ 0.2824.
- 3max = 0.8824 (R'), min = 0.1137 (G'), d = 0.7687.
- 4L = (0.8824 + 0.1137) / 2 = 0.4980 → 50%. S: L ≤ 0.5, so S = d/(max+min) = 0.7687/0.9961 ≈ 0.7717 → 77%.
- 5Max is R': H = ((G'−B')/d + (G'<B' ? 6 : 0))/6 = ((0.1137−0.2824)/0.7687 + 6)/6 = (−0.2195+6)/6 = 5.7805/6 ≈ 0.9634 → 347°.
- 6Base HSL: hsl(347, 77%, 50%).
- 7Complementary hue: (347 + 180) % 360 = 527 % 360 = 167°.
- 8Complementary color: hsl(167, 77%, 50%) — a medium teal-green.
Result:
Complementary of #E11D48 (hsl 347°) is hsl(167, 77%, 50%) — a vibrant teal.
Generating a Lighter Variation for a Dark Background
Problem:
Given base color #1E3A5F (a dark navy, HSL approximately hsl(211, 51%, 24%)), find the +40% lightness variation.
Solution Steps:
- 1Parse hex: R = 0x1E = 30, G = 0x3A = 58, B = 0x5F = 95.
- 2Normalize: R' = 30/255 ≈ 0.1176, G' = 58/255 ≈ 0.2275, B' = 95/255 ≈ 0.3725.
- 3max = 0.3725 (B'), min = 0.1176 (R'), d = 0.2549.
- 4L = (0.3725 + 0.1176)/2 = 0.2451 → 25% (approximately). S = d/(max+min) = 0.2549/0.4902 ≈ 0.5200 → 52%. H: max is B', H = ((R'−G')/d+4)/6 = ((0.1176−0.2275)/0.2549+4)/6 = (−0.4312+4)/6 = 3.5688/6 ≈ 0.5948 → 214°.
- 5Base HSL: hsl(214, 52%, 25%).
- 6Lightness variation +40%: new L = min(100, 25 + 40) = 65%.
- 7Result swatch: hsl(214, 52%, 65%) — a soft steel-blue suitable for a hover state or secondary background.
Result:
Base hsl(214, 52%, 25%) → +40% variation → hsl(214, 52%, 65%)
Tips & Best Practices
- ✓Click any format row to copy its value to the clipboard instantly—no need to manually select text.
- ✓Click a lightness swatch or harmony tile to set it as the new active color and inspect its full format breakdown.
- ✓For CSS custom properties, use HSL format—adjusting only L lets you create hover and active states without changing color identity.
- ✓When picking brand colors for the web, verify WCAG contrast by pairing a dark and light variation from the tonal strip.
- ✓CMYK output from this tool is a screen-based estimate; always request a Pantone or ICC-profiled match from your print vendor for production work.
- ✓Analogous palettes (±30° hue) work best for professional UIs; save complementary and triadic schemes for bold hero sections or marketing graphics.
- ✓If you know an approximate hue but want a specific brightness, type the hex code you have and then click a lighter or darker swatch to fine-tune.
- ✓The RGBA and HSLA outputs always default alpha to 1—edit the alpha value directly in your CSS when you need a semi-transparent version.
Frequently Asked Questions
Sources & References
Last updated: 2026-06-05
Help us improve!
How would you rate the Color Picker?
Editorial Note
MyCalcBuddy Editorial Team
This page is maintained as an educational calculator reference.
Formula Source: Standard Mathematical References
by Various