Color Converter Convert colors between HEX, RGB and HSL — free, instant, private.

Midnightblue Color Code (#191970)

Midnightblue is an official CSS named color: #191970 — rgb(25, 25, 112) — hsl(240, 64%, 27%).

HEX#191970
RGBrgb(25, 25, 112)
HSLhsl(240, 64%, 27%)
Complementary#717119 (hue + 180°)
CSS namemidnightblue (official keyword)
color: midnightblue; background-color: #191970; border-color: hsl(240, 64%, 27%);



The color midnightblue in CSS

Midnightblue is one of the 148 named colors defined by the CSS Color Module — write the keyword midnightblue anywhere a color value is accepted (color, background-color, border-color, gradients) and every browser renders exactly #191970 (rgb(25, 25, 112)).

Shades and tints of midnightblue

Same hue and saturation, stepped through lightness — click any swatch for its own page:

Popular color codes

Convert any color with the HEX, RGB and HSL converter.

Common input mistakes (and fixes)

Why an HSL round trip can shift by one

This tool rounds HSL values to whole numbers, so converting away and back can drift slightly. Example: #f97316 becomes hsl(25, 95%, 53%), and converting that back gives rgb(249, 116, 21) — one step off on two channels. That is rounding, not a bug: whole-number HSL offers roughly 3.7 million combinations, while RGB has 16,777,216, so some colors simply have no exact HSL match. Treat the 6-digit HEX as the exact value and HSL as a close, editable approximation.

Frequently asked questions

What color is midnightblue?

Midnightblue is an official CSS named color with the hex code #191970 — rgb(25, 25, 112) in RGB and hsl(240, 64%, 27%) in HSL. Its complementary color (hue + 180°) is #717119.

How do I use the midnightblue color in CSS?

Write color: midnightblue; for text or background-color: midnightblue; for surfaces — the keyword works in every browser, no quotes needed. Equivalent notations: #191970, rgb(25, 25, 112) and hsl(240, 64%, 27%).

Is midnightblue the same as #191970?

Yes — the CSS keyword midnightblue is defined as exactly #191970 (rgb(25, 25, 112)), so the keyword and the hex code always render the identical color.