HEX to HSL: #0C4A6E

Also known as: Tailwind v3 sky-900

Result

#0C4A6E → hsl(202 80% 24%)

Values are shown at full precision, so converting back gives exactly #0c4a6e. The rounded form is what you normally paste into CSS.

Step-by-step math

Every number below is computed from the input, nothing is looked up.

  1. 1. RGB ÷ 255

    R = 0.0471
    G = 0.2902
    B = 0.4314
  2. 2. max, min, Δ

    max = 0.4314
    min = 0.0471
    Δ = max − min = 0.3843
  3. 3. L

    L = (max + min) / 2 = 0.2392 = 23.92%
  4. 4. S

    S = Δ / (1 − |2L − 1|) = 0.8033 = 80.33%
  5. 5. H

    max is B → H = 60° × ((R − G) / Δ + 4) = 60° × ((0.0471 − 0.2902) / 0.3843 + 4) = 202.04°
  6. 6. HSL

    hsl(202.04 80.33% 23.92%)

All formats

HEX
#0c4a6e
RGB
rgb(12 74 110)
RGB (legacy)
rgb(12, 74, 110)
HSL
hsl(202.04 80.33% 23.92%) → hsl(202 80% 24%)
HWB
hwb(202 5% 57%)
OKLCH
oklch(0.391 0.085 240.9) · oklch(39.1% 0.085 240.9)
OKLab
oklab(0.391 -0.041 -0.074)
Lab (D50)
lab(29.25 -8.24 -26.58)
LCH (D50)
lch(29.25 27.83 252.77)
Display P3
color(display-p3 0.1293 0.2856 0.4196)
Linear sRGB
color(srgb-linear 0.0037 0.0685 0.1559)

Gamut: sRGB and Display P3

#0C4A6E is a hex color, so it sits inside sRGB and therefore inside Display P3. At this lightness and hue, sRGB reaches chroma 0.091 and Display P3 reaches 0.119; this color uses 93% of the sRGB chroma available.

CSS snippets

.element {
  color: #0c4a6e;
  color: rgb(12 74 110);
  color: hsl(202 80% 24%);
  color: oklch(0.391 0.085 240.9);
}

/* Tailwind CSS v4 */
@theme {
  --color-brand: oklch(0.391 0.085 240.9);
}
/* arbitrary values */
class="text-[#0c4a6e] bg-[oklch(0.391_0.085_240.9)]"

/* wide-gamut screens */
@media (color-gamut: p3) {
  .element { color: color(display-p3 0.1293 0.2856 0.4196); }
}

/* relative color syntax: 10% darker */
.element-dark { color: oklch(from #0c4a6e calc(l - 0.1) c h); }

Nearby colors

Closest colors in the Tailwind and CSS named palettes (OKLab distance).

Lighter and darker, same hue and chroma

  • #225B80 · oklch(0.451 0.085 240.9) · ΔL +0.06
  • #003A5C · oklch(0.331 0.085 240.9) · ΔL −0.06

Open in the studio

Other converters for this color

All converters →

Guides: What is OKLCH?