HSL to HEX: #2F4F4F

Also known as: CSS darkslategray, CSS darkslategrey

Result

hsl(180.00 25.40% 24.71%) → #2F4F4F

Values are shown at full precision, so converting back gives exactly #2f4f4f. 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. input

    H = 180.00°, S = 25.40%, L = 24.71%
  2. 2. C

    C = (1 − |2L − 1|) × S = 0.12553
  3. 3. X

    X = C × (1 − |(H / 60°) mod 2 − 1|) = 0.12553   (H / 60° = 3.0000, sector 3)
  4. 4. m

    m = L − C / 2 = 0.18434
  5. 5. (R′, G′, B′) + m

    (R′, G′, B′) = (0.00000, 0.12553, 0.12553)
    R = round((0.00000 + 0.18434) × 255) = 47
    G = round((0.12553 + 0.18434) × 255) = 79
    B = round((0.12553 + 0.18434) × 255) = 79
  6. 6. RGB → HEX

    #2F4F4F

All formats

HEX
#2f4f4f
RGB
rgb(47 79 79)
RGB (legacy)
rgb(47, 79, 79)
HSL
hsl(180.00 25.40% 24.71%) → hsl(180 25% 25%)
HWB
hwb(180 18% 69%)
OKLCH
oklch(0.403 0.038 195.8) · oklch(40.3% 0.038 195.8)
OKLab
oklab(0.403 -0.036 -0.010)
Lab (D50)
lab(31.14 -12.26 -3.94)
LCH (D50)
lch(31.14 12.88 197.80)
Display P3
color(display-p3 0.2129 0.3066 0.3081)
Linear sRGB
color(srgb-linear 0.0284 0.0782 0.0782)

Gamut: sRGB and Display P3

#2F4F4F is a hex color, so it sits inside sRGB and therefore inside Display P3. At this lightness and hue, sRGB reaches chroma 0.069 and Display P3 reaches 0.092; this color uses 55% of the sRGB chroma available.

CSS snippets

.element {
  color: #2f4f4f;
  color: rgb(47 79 79);
  color: hsl(180 25% 25%);
  color: oklch(0.403 0.038 195.8);
}

/* Tailwind CSS v4 */
@theme {
  --color-brand: oklch(0.403 0.038 195.8);
}
/* arbitrary values */
class="text-[#2f4f4f] bg-[oklch(0.403_0.038_195.8)]"

/* wide-gamut screens */
@media (color-gamut: p3) {
  .element { color: color(display-p3 0.2129 0.3066 0.3081); }
}

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

  • #3F6060 · oklch(0.463 0.038 195.8) · ΔL +0.06
  • #1F3F3F · oklch(0.343 0.038 195.8) · ΔL −0.06

Open in the studio

Other converters for this color

All converters →

Guides: What is OKLCH?