pttooz

Color Studio

Pick a colour on a live wheel and get harmonies, a full tint scale and WCAG contrast instantly.

Live

How Color Studio calculator works?

The Color Studio calculator works in 5 steps: it reads a HEX code, converts the code to RGB and HSL, rotates the hue to build a harmony palette, steps the lightness to build 11 shades and measures WCAG contrast.

  1. 1

    Read the color

    A color enters as a 6-digit HEX code, a pick from the color picker or a drag on the wheel. The wheel angle sets hue (0–360°) and the distance from the center sets saturation (0–100%).

  2. 2

    Convert HEX to RGB and HSL

    Each pair of HEX digits converts from base 16 to a 0–255 channel value. The red, green and blue (RGB) values then convert to hue, saturation and lightness (HSL).

  3. 3

    Build the harmony palette

    Harmony rules add fixed angles to the hue: +180° for complementary, +120° and +240° for triadic, ±20° and ±40° for analogous, +150° and +210° for split complementary.

  4. 4

    Build 11 tints and shades

    The scale keeps hue and saturation and sets lightness to 11 steps, from 96% (step 50) to 12% (step 950).

  5. 5

    Check contrast

    The relative luminance of the color is compared with white (#FFFFFF) and near-black (#0B0D12) text. The 2 contrast ratios get AA and AAA results from the Web Content Accessibility Guidelines (WCAG) 2.1.

Color Studio formula

Color Studio uses 4 formulas: HEX to RGB, RGB to HSL, relative luminance and contrast ratio. The worked examples use pink #EC4899.

HEX to RGB

R = RR₁₆ → 0–255, G = GG₁₆, B = BB₁₆
RR, GG, BB
The 3 two-digit base-16 pairs of a HEX code
A–F
Digits worth 10–15
EC = 14 × 16 + 12R = 236
48 = 4 × 16 + 8G = 72
99 = 9 × 16 + 9B = 153
Resultrgb(236, 72, 153)

RGB to HSL

L = (max + min) ÷ 2, S = (max − min) ÷ (1 − |2L − 1|)
max, min
Largest and smallest channel ÷ 255
H
60° × the position of the largest channel on the color circle
max = 236 ÷ 2550.925
min = 72 ÷ 2550.282
L = (0.925 + 0.282) ÷ 260.4%
S = 0.643 ÷ 0.79281.2%
H (red is max)330.4°
Resulthsl(330, 81%, 60%)

Relative luminance

L = 0.2126 R + 0.7152 G + 0.0722 B
R, G, B
Linear channels: c ÷ 12.92 when c ≤ 0.03928, else ((c + 0.055) ÷ 1.055)^2.4
L
0 for black, 1 for white
Linear R, G, B0.838, 0.065, 0.319
0.178 + 0.046 + 0.0230.2477
ResultL = 0.2477

Contrast ratio

CR = (L₁ + 0.05) ÷ (L₂ + 0.05)
L₁
Luminance of the lighter color
L₂
Luminance of the darker color
White on #EC4899: 1.05 ÷ 0.29773.53 : 1 · AA Large only
Black on #EC4899: 0.2977 ÷ 0.055.95 : 1 · AA
ResultBlack text wins
WCAG 2.1 contrast thresholds
AA Large · 3:1
AA · 4.5:1
AAA · 7:1
1:121:1

Color Studio conversion chart

The Color Studio conversion chart converts 16 common colors between HEX, RGB and HSL, with contrast ratios against white and black text and the better text color for each.

ColorHEXRGBHSLvs whitevs blackText
AaRed#FF0000rgb(255, 0, 0)hsl(0, 100%, 50%)4.00 AA Large5.25 AABlack
AaOrange#FFA500rgb(255, 165, 0)hsl(39, 100%, 50%)1.97 Fail10.63 AAABlack
AaGold#FFD700rgb(255, 215, 0)hsl(51, 100%, 50%)1.40 Fail14.97 AAABlack
AaYellow#FFFF00rgb(255, 255, 0)hsl(60, 100%, 50%)1.07 Fail19.56 AAABlack
AaLime#00FF00rgb(0, 255, 0)hsl(120, 100%, 50%)1.37 Fail15.30 AAABlack
AaGreen#008000rgb(0, 128, 0)hsl(120, 100%, 25%)5.14 AA4.09 AA LargeWhite
AaTeal#008080rgb(0, 128, 128)hsl(180, 100%, 25%)4.77 AA4.40 AA LargeWhite
AaCyan#00FFFFrgb(0, 255, 255)hsl(180, 100%, 50%)1.25 Fail16.75 AAABlack
AaBlue#0000FFrgb(0, 0, 255)hsl(240, 100%, 50%)8.59 AAA2.44 FailWhite
AaNavy#000080rgb(0, 0, 128)hsl(240, 100%, 25%)16.01 AAA1.31 FailWhite
AaPurple#800080rgb(128, 0, 128)hsl(300, 100%, 25%)9.42 AAA2.23 FailWhite
AaMagenta#FF00FFrgb(255, 0, 255)hsl(300, 100%, 50%)3.14 AA Large6.70 AABlack
AaPink#FFC0CBrgb(255, 192, 203)hsl(350, 100%, 88%)1.54 Fail13.65 AAABlack
AaBrown#A52A2Argb(165, 42, 42)hsl(0, 59%, 41%)7.08 AAA2.96 FailWhite
AaGray#808080rgb(128, 128, 128)hsl(0, 0%, 50%)3.95 AA Large5.32 AABlack
AaBlack#000000rgb(0, 0, 0)hsl(0, 0%, 0%)21.00 AAA1.00 FailWhite

Color Studio FAQ

What is the difference between HEX, RGB and HSL?

HEX, RGB and HSL are 3 notations for the same sRGB color. HEX writes red, green and blue as base-16 pairs (#EC4899), RGB writes the same channels as 0–255 numbers (rgb(236, 72, 153)), and HSL writes hue in degrees with saturation and lightness in percent (hsl(330, 81%, 60%)).

What contrast ratio does WCAG require?

WCAG 2.1 level AA requires a contrast ratio of 4.5:1 for normal text and 3:1 for large text. Level AAA requires 7:1 for normal text and 4.5:1 for large text. Large text means 18 point (24 px) regular or 14 point (about 18.7 px) bold.

How do I find a complementary color?

To find a complementary color, add 180° to the hue and keep saturation and lightness. The complement of #EC4899 (hue 330°) is #48EC9B (hue 150°). Select Complementary in Color Studio to see both colors on the wheel.

Is white or black text better on my color?

The better text color is the color with the higher contrast ratio. On #EC4899, black text reaches 5.95:1 and passes AA, and white text reaches 3.53:1 and passes AA Large only. Color Studio shows both ratios in the Accessibility panel.

What do the 50 to 950 shade numbers mean?

The numbers 50 to 950 label 11 lightness steps, from the lightest tint (50, 96% lightness) to the darkest shade (950, 12% lightness). Step 500 sits at 52% lightness, and a dot marks the step closest to your base color. Design systems such as Tailwind CSS use the same naming.

Can I copy Color Studio colors into CSS?

Yes, every value in Color Studio copies to the clipboard with 1 click: HEX, rgb(), hsl() and a CSS custom property such as --brand: #ec4899;. Palette swatches copy as HEX codes.

Why does dragging the wheel change lightness?

Dragging the wheel keeps lightness between 25% and 75%, the range where hue and saturation stay visible. Set an exact lightness with a shade step or by typing a HEX code.