RGB to HEX: #020617

Also known as: Tailwind v3 slate-950

Result

rgb(2 6 23) → #020617

Values are shown at full precision, so converting back gives exactly #020617. 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. base 10 → base 16

    R = 2 = 0×16 + 2 → 02
    G = 6 = 0×16 + 6 → 06
    B = 23 = 1×16 + 7 → 17
  2. 2. pairs → HEX

    02 06 17 → #020617

All formats

HEX
#020617
RGB
rgb(2 6 23)
RGB (legacy)
rgb(2, 6, 23)
HSL
hsl(228.57 84.00% 4.90%) → hsl(229 84% 5%)
HWB
hwb(229 1% 91%)
OKLCH
oklch(0.129 0.041 264.7) · oklch(12.9% 0.041 264.7)
OKLab
oklab(0.129 -0.004 -0.040)
Lab (D50)
lab(1.77 1.22 -8.85)
LCH (D50)
lch(1.77 8.93 277.85)
Display P3
color(display-p3 0.0106 0.0230 0.0857)
Linear sRGB
color(srgb-linear 0.0006 0.0018 0.0086)

Gamut: sRGB and Display P3

#020617 is a hex color, so it sits inside sRGB and therefore inside Display P3. At this lightness and hue, sRGB reaches chroma 0.089 and Display P3 reaches 0.089; this color uses 46% of the sRGB chroma available.

CSS snippets

.element {
  color: #020617;
  color: rgb(2 6 23);
  color: hsl(229 84% 5%);
  color: oklch(0.129 0.041 264.7);
}

/* Tailwind CSS v4 */
@theme {
  --color-brand: oklch(0.129 0.041 264.7);
}
/* arbitrary values */
class="text-[#020617] bg-[oklch(0.129_0.041_264.7)]"

/* wide-gamut screens */
@media (color-gamut: p3) {
  .element { color: color(display-p3 0.0106 0.0230 0.0857); }
}

/* relative color syntax: 10% darker */
.element-dark { color: oklch(from #020617 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

  • #0A1326 · oklch(0.189 0.041 264.7) · ΔL +0.06
  • #000009 · oklch(0.069 0.041 264.7) · ΔL −0.06

Open in the studio

Other converters for this color

All converters →

Guides: What is OKLCH?