CSS named color
Indigo #4B0082
Indigo (CSS keyword indigo) has the hex code #4B0082 and the RGB value rgb(75, 0, 130): a dark, vivid violet.
CSS indigo (#4b0082) is a dark violet, much more purple than the indigo dye or the "indigo" band in Newton's spectrum. It is dark enough for text on white.
Color codes for Indigo
| CSS keyword | indigo |
|---|---|
| HEX | #4B0082 |
| RGB | rgb(75, 0, 130) |
| HSL | hsl(275, 100%, 25%) |
| HWB | hwb(275 0% 49%) |
| OKLCH | oklch(33.9% 0.179 301.7) |
| CMYK (naive, no ICC profile) | cmyk(42%, 100%, 0%, 49%) |
| Decimal | 4,915,330 |
| Hue family | Purples and violets |
Contrast and accessibility
On indigo, white text has a contrast ratio of 12.95:1 and passes AAA at any text size; black text reaches 1.62:1.
WCAG 2.2 contrast ratios (success criteria 1.4.3 and 1.4.6: AA needs 4.5:1 for normal text and 3:1 for large text, AAA needs 7:1 and 4.5:1). APCA Lc is the lightness contrast from the APCA-W3 0.0.98G model proposed for WCAG 3; a higher absolute value is more readable, and Lc 75 is its suggested minimum for body text.
| Pair | Ratio | AA | AA large | AAA | AAA large | APCA Lc |
|---|---|---|---|---|---|---|
| Black text on indigo | 1.62:1 | Fail | Fail | Fail | Fail | 0.0 |
| White text on indigo | 12.95:1 | Pass | Pass | Pass | Pass | −100.8 |
| Indigo text on white | 12.95:1 | Pass | Pass | Pass | Pass | 97.2 |
| Indigo text on black | 1.62:1 | Fail | Fail | Fail | Fail | 0.0 |
Tints and shades
Each step mixes indigo with white (tints) or black (shades) in gamma-encoded sRGB, the same result as color-mix(in srgb, indigo, white 25%) in CSS.
Tints (mixed with white)
- 5%
#540d88 - 15%
#662695 - 25%
#7840a1 - 35%
#8a59ae - 45%
#9c73ba - 55%
#ae8cc7 - 65%
#c0a6d3 - 75%
#d2bfe0 - 85%
#e4d9ec - 95%
#f6f2f9
Shades (mixed with black)
- 5%
#47007c - 15%
#40006f - 25%
#380062 - 35%
#310055 - 45%
#290048 - 55%
#22003a - 65%
#1a002e - 75%
#130021 - 85%
#0b0014 - 95%
#040007
Color harmonies
Rotating the hue in OKLCH while keeping lightness and chroma, indigo's complementary color is #303F00 (close to darkslategray), its analogous colors are #1F1F92 and #65005E, and its triadic partners are #5A2800 and #00453B. For text on top, white gives the higher contrast.
| Harmony | Rotation | Color |
|---|---|---|
| Complementary | +180° | #303f00 |
| Analogous | −30°, +30° | #1f1f92#65005e |
| Triadic | +120°, +240° | #5a2800#00453b |
| Split-complementary | +150°, +210° | #483500#004812 |
Computed in OKLCH: the hue is rotated by 180° (complementary), ±30° (analogous), ±120° (triadic) and 180° ±30° (split-complementary) while lightness and chroma stay fixed. Results that fall outside sRGB are brought back with the CSS Color 4 gamut mapping algorithm. Because this uses OKLCH, the values differ from tools that rotate hue in HSL, but every color keeps the same perceived lightness.
Warm or cool?
Indigo is a cool color: its hue is 275° on the HSL wheel, in the green, blue and violet range that is conventionally called cool.
Nearest named and Tailwind colors
Distance is ΔE OK, the Euclidean distance in OKLab multiplied by 100. Values under about 2 are hard to tell apart side by side.
Nearest CSS named colors
| Color | HEX | ΔE OK |
|---|---|---|
| midnightblue | #191970 | 10.1 |
| darkslateblue | #483d8b | 10.1 |
| rebeccapurple | #663399 | 10.3 |
Nearest Tailwind v4 colors
| Color | HEX | ΔE OK |
|---|---|---|
| purple-900 | #59168b | 4.3 |
| violet-900 | #4d179a | 4.9 |
| purple-950 | #3c0366 | 5.7 |
Code snippets
.element {
color: indigo;
background-color: #4b0082;
border-color: rgb(75 0 130);
outline-color: oklch(33.9% 0.179 301.7);
}<div class="bg-[#4b0082] text-white">...</div>
/* or register it once in your CSS (Tailwind v4) */
@theme {
--color-indigo: #4b0082;
}
/* then use bg-indigo, text-indigo, border-indigo */import SwiftUI
extension Color {
static let indigo = Color(red: 0.294, green: 0.000, blue: 0.510)
}import androidx.compose.ui.graphics.Color
val Indigo = Color(0xFF4B0082)import 'package:flutter/material.dart';
const indigo = Color(0xFF4B0082);<!-- res/values/colors.xml -->
<color name="indigo">#4B0082</color>Frequently asked questions
- What is the hex code for indigo?
- The hex code for indigo is #4B0082. The same color is rgb(75, 0, 130), hsl(275, 100%, 25%) and oklch(33.9% 0.179 301.7), and in CSS you can also write the keyword indigo directly.
- Is indigo a warm or cool color?
- Indigo is a cool color: its hue is 275° on the HSL wheel, in the green, blue and violet range that is conventionally called cool.
- What colors go with indigo?
- Rotating the hue in OKLCH while keeping lightness and chroma, indigo's complementary color is #303F00 (close to darkslategray), its analogous colors are #1F1F92 and #65005E, and its triadic partners are #5A2800 and #00453B. For text on top, white gives the higher contrast.
- Can you use white text on indigo?
- White text on indigo has a contrast ratio of 12.95:1, which passes both AA and AAA under WCAG 2.2. Black text reaches 1.62:1 and fails AA even for large text. In APCA terms that is Lc −100.8 for white and Lc 0.0 for black.
- What is the RGB value of indigo?
- Indigo is rgb(75, 0, 130): red 75, green 0 and blue 130 on the 0 to 255 scale, or 29.4%, 0.0% and 51.0%. As a decimal integer it is 4915330.
Last reviewed by Arielton Oberek.