CSS named color
Violet #EE82EE
Violet (CSS keyword violet) has the hex code #EE82EE and the RGB value rgb(238, 130, 238): a light, vivid magenta.
CSS violet (#ee82ee) is a light pinkish purple, far from spectral violet at the short-wavelength end of the rainbow. For a deep violet, use darkviolet.
Color codes for Violet
| CSS keyword | violet |
|---|---|
| HEX | #EE82EE |
| RGB | rgb(238, 130, 238) |
| HSL | hsl(300, 76%, 72%) |
| HWB | hwb(300 51% 7%) |
| OKLCH | oklch(76.2% 0.186 327.2) |
| CMYK (naive, no ICC profile) | cmyk(0%, 45%, 0%, 7%) |
| Decimal | 15,631,086 |
| Hue family | Purples and violets |
Contrast and accessibility
On violet, black text has a contrast ratio of 9.06:1 and passes AAA at any text size; white text reaches 2.31: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 violet | 9.06:1 | Pass | Pass | Pass | Pass | 58.7 |
| White text on violet | 2.31:1 | Fail | Fail | Fail | Fail | −50.2 |
| Violet text on white | 2.31:1 | Fail | Fail | Fail | Fail | 45.3 |
| Violet text on black | 9.06:1 | Pass | Pass | Pass | Pass | −56.8 |
Tints and shades
Each step mixes violet with white (tints) or black (shades) in gamma-encoded sRGB, the same result as color-mix(in srgb, violet, white 25%) in CSS.
Tints (mixed with white)
- 5%
#ef88ef - 15%
#f195f1 - 25%
#f2a1f2 - 35%
#f4aef4 - 45%
#f6baf6 - 55%
#f7c7f7 - 65%
#f9d3f9 - 75%
#fbe0fb - 85%
#fcecfc - 95%
#fef9fe
Shades (mixed with black)
- 5%
#e27ce2 - 15%
#ca6fca - 25%
#b362b3 - 35%
#9b559b - 45%
#834883 - 55%
#6b3a6b - 65%
#532e53 - 75%
#3c213c - 85%
#241424 - 95%
#0c070c
Color harmonies
Rotating the hue in OKLCH while keeping lightness and chroma, violet's complementary color is #4CD067 (close to limegreen), its analogous colors are #BE98FF and #FF78B3, and its triadic partners are #E1A800 and #00CBE2. For text on top, black gives the higher contrast.
| Harmony | Rotation | Color |
|---|---|---|
| Complementary | +180° | #4cd067 |
| Analogous | −30°, +30° | #be98ff#ff78b3 |
| Triadic | +120°, +240° | #e1a800#00cbe2 |
| Split-complementary | +150°, +210° | #aabf00#00d2b0 |
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?
Violet sits on the boundary: its hue of 300° on the HSL wheel is a magenta, which reads warm next to blues and cool next to reds and oranges.
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
Nearest Tailwind v4 colors
| Color | HEX | ΔE OK |
|---|---|---|
| fuchsia-400 | #ed6aff | 5.9 |
| fuchsia-300 | #f4a8ff | 8.4 |
| pink-400 | #fb64b6 | 8.9 |
Code snippets
.element {
color: violet;
background-color: #ee82ee;
border-color: rgb(238 130 238);
outline-color: oklch(76.2% 0.186 327.2);
}<div class="bg-[#ee82ee] text-black">...</div>
/* or register it once in your CSS (Tailwind v4) */
@theme {
--color-violet: #ee82ee;
}
/* then use bg-violet, text-violet, border-violet */import SwiftUI
extension Color {
static let violet = Color(red: 0.933, green: 0.510, blue: 0.933)
}import androidx.compose.ui.graphics.Color
val Violet = Color(0xFFEE82EE)import 'package:flutter/material.dart';
const violet = Color(0xFFEE82EE);<!-- res/values/colors.xml -->
<color name="violet">#EE82EE</color>Frequently asked questions
- What is the hex code for violet?
- The hex code for violet is #EE82EE. The same color is rgb(238, 130, 238), hsl(300, 76%, 72%) and oklch(76.2% 0.186 327.2), and in CSS you can also write the keyword violet directly.
- Is violet a warm or cool color?
- Violet sits on the boundary: its hue of 300° on the HSL wheel is a magenta, which reads warm next to blues and cool next to reds and oranges.
- What colors go with violet?
- Rotating the hue in OKLCH while keeping lightness and chroma, violet's complementary color is #4CD067 (close to limegreen), its analogous colors are #BE98FF and #FF78B3, and its triadic partners are #E1A800 and #00CBE2. For text on top, black gives the higher contrast.
- Can you use white text on violet?
- White text on violet has a contrast ratio of 2.31:1, which fails AA even for large text under WCAG 2.2. Black text reaches 9.06:1 and passes both AA and AAA. In APCA terms that is Lc −50.2 for white and Lc 58.7 for black.
- What is the RGB value of violet?
- Violet is rgb(238, 130, 238): red 238, green 130 and blue 238 on the 0 to 255 scale, or 93.3%, 51.0% and 93.3%. As a decimal integer it is 15631086.
Last reviewed by Arielton Oberek.