HSL(240, 78%, 21%)
Blue — Blue color
Adjust Color
Color Information
Color Name
Blue
Color Family
Blue
Warm / Cool
🔵 Cool
Temperature
9000K
CSS Class
bg-[hsl(240,78%,21%)]
Color Conversions
| Format | Value | CSS Usage | |
|---|---|---|---|
| HSL | hsl(240, 78%, 21%) | color: hsl(240, 78%, 21%) | |
| HEX | #0C0C5F | color: #0C0C5F | |
| RGB | rgb(12, 12, 95) | color: rgb(12, 12, 95) | |
| CMYK | cmyk(87%, 87%, 0%, 63%) | — | |
| HSV | hsv(240, 87%, 37%) | — | |
| HWB | hwb(240 5% 63%) | color: hwb(240 5% 63%) | |
| OKLCH | oklch(0.2408 0.1377 269.72) | color: oklch(0.2408 0.1377 269.72) | |
| Lab | lab(10.31 32.21 -47.57) | color: lab(10.31 32.21 -47.57) | |
| LCH | lch(10.31 57.45 304.1) | color: lch(10.31 57.45 304.1) |
Color Theory
Accessibility (WCAG)
White text on color
Black text on color
Colored text
Contrast Ratios
AA Normal (4.5:1)
AA Large (3:1)
AAA Normal (7:1)
Best text on this color: white
Color Blindness Simulation
Protanopia (Red-blind)
#0C0C4B — rgb(12, 12, 75)
Deuteranopia (Green-blind)
#0C0C46 — rgb(12, 12, 70)
Tritanopia (Blue-blind)
#0C3B38 — rgb(12, 59, 56)
Tints & Shades
CSS Code Snippets
background
background-color: hsl(240, 78%, 21%);
text
color: hsl(240, 78%, 21%);
border
border: 2px solid hsl(240, 78%, 21%);
gradient light
background: linear-gradient(to right, hsl(240, 78%, 41%), hsl(240, 78%, 21%));
gradient dark
background: linear-gradient(to right, hsl(240, 78%, 21%), hsl(240, 78%, 1%))
hex
background-color: #0C0C5F;
tailwind
bg-[hsl(240,78%,21%)]
box shadow
box-shadow: 0 4px 6px -1px hsl(240, 78%, 21%, 0.4);
css variable
--color-primary: hsl(240, 78%, 21%);
Related Colors
Use Cases for Blue
Frequently Asked Questions
What are all the color codes for HSL(240, 78%, 21%)?
HEX: #0C0C5F | RGB: rgb(12, 12, 95) | CMYK: 87%, 87%, 0%, 63% | HSV: 240°, 87%, 37%. Copy any format from the conversion table above.
What colors go well with #0C0C5F?
The complementary color is HSL(60, 78%, 21%). For a triadic harmony, use hues 240°, 0°, and 120°. For analogous combinations, try hues 210° and 270°. See the Color Harmony section above for complete palettes with previews.
How do I use HSL(240, 78%, 21%) in CSS?
As HSL: color: hsl(240, 78%, 21%); — As HEX: color: #0C0C5F; — As RGB: color: rgb(12, 12, 95); — Tailwind CSS: bg-[hsl(240,78%,21%)] — CSS variable: --color-primary: hsl(240, 78%, 21%);