RGB to HEX: #030712

Also known as: Tailwind gray-950, Tailwind v3 gray-950

Result

rgb(3 7 18) → #030712

Values are shown at full precision, so converting back gives exactly #030712. 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 = 3 = 0×16 + 3 → 03
    G = 7 = 0×16 + 7 → 07
    B = 18 = 1×16 + 2 → 12
  2. 2. pairs → HEX

    03 07 12 → #030712

All formats

HEX
#030712
RGB
rgb(3 7 18)
RGB (legacy)
rgb(3, 7, 18)
HSL
hsl(224.00 71.43% 4.12%) → hsl(224 71% 4%)
HWB
hwb(224 1% 93%)
OKLCH
oklch(0.130 0.027 261.7) · oklch(13.0% 0.027 261.7)
OKLab
oklab(0.130 -0.004 -0.027)
Lab (D50)
lab(1.89 0.25 -5.31)
LCH (D50)
lch(1.89 5.31 272.75)
Display P3
color(display-p3 0.0145 0.0269 0.0673)
Linear sRGB
color(srgb-linear 0.0009 0.0021 0.0060)

Gamut: sRGB and Display P3

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

CSS snippets

.element {
  color: #030712;
  color: rgb(3 7 18);
  color: hsl(224 71% 4%);
  color: oklch(0.130 0.027 261.7);
}

/* Tailwind CSS v4 */
@theme {
  --color-brand: oklch(0.130 0.027 261.7);
}
/* arbitrary values */
class="text-[#030712] bg-[oklch(0.130_0.027_261.7)]"

/* wide-gamut screens */
@media (color-gamut: p3) {
  .element { color: color(display-p3 0.0145 0.0269 0.0673); }
}

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

  • #0D1420 · oklch(0.190 0.027 261.7) · ΔL +0.06
  • #000106 · oklch(0.070 0.027 261.7) · ΔL −0.06

Open in the studio

Other converters for this color

All converters →

Guides: What is OKLCH?