CSS named color
MediumVioletRed #C71585
MediumVioletRed (CSS keyword mediumvioletred) has the hex code #C71585 and the RGB value rgb(199, 21, 133): a medium-dark, vivid magenta.
A deep, saturated magenta-red (#c71585). It is one of the few named pinks dark enough to pass WCAG AA for normal text on white.
Color codes for MediumVioletRed
| CSS keyword | mediumvioletred |
|---|---|
| HEX | #C71585 |
| RGB | rgb(199, 21, 133) |
| HSL | hsl(322, 81%, 43%) |
| HWB | hwb(322 8% 22%) |
| OKLCH | oklch(55.3% 0.222 349.7) |
| CMYK (naive, no ICC profile) | cmyk(0%, 89%, 33%, 22%) |
| Decimal | 13,047,173 |
| Hue family | Pinks |
Contrast and accessibility
On mediumvioletred, white text has a contrast ratio of 5.42:1 and passes AA for normal text; black text reaches 3.87: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 mediumvioletred | 3.87:1 | Fail | Pass | Fail | Fail | 29.1 |
| White text on mediumvioletred | 5.42:1 | Pass | Pass | Fail | Pass | −80.4 |
| Mediumvioletred text on white | 5.42:1 | Pass | Pass | Fail | Pass | 75.0 |
| Mediumvioletred text on black | 3.87:1 | Fail | Pass | Fail | Fail | −26.7 |
Tints and shades
Each step mixes mediumvioletred with white (tints) or black (shades) in gamma-encoded sRGB, the same result as color-mix(in srgb, mediumvioletred, white 25%) in CSS.
Tints (mixed with white)
- 5%
#ca218b - 15%
#cf3897 - 25%
#d550a4 - 35%
#db67b0 - 45%
#e07ebc - 55%
#e696c8 - 65%
#ebadd4 - 75%
#f1c5e1 - 85%
#f7dced - 95%
#fcf3f9
Shades (mixed with black)
- 5%
#bd147e - 15%
#a91271 - 25%
#951064 - 35%
#810e56 - 45%
#6d0c49 - 55%
#5a093c - 65%
#46072f - 75%
#320521 - 85%
#1e0314 - 95%
#0a0107
Color harmonies
Rotating the hue in OKLCH while keeping lightness and chroma, mediumvioletred's complementary color is #008A66 (close to seagreen), its analogous colors are #A733C1 and #D50138, and its triadic partners are #797800 and #007FB0. For text on top, white gives the higher contrast.
| Harmony | Rotation | Color |
|---|---|---|
| Complementary | +180° | #008a66 |
| Analogous | −30°, +30° | #a733c1#d50138 |
| Triadic | +120°, +240° | #797800#007fb0 |
| Split-complementary | +150°, +210° | #068c00#00858c |
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?
MediumVioletRed sits on the boundary: its hue of 322° 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.
Code snippets
.element {
color: mediumvioletred;
background-color: #c71585;
border-color: rgb(199 21 133);
outline-color: oklch(55.3% 0.222 349.7);
}<div class="bg-[#c71585] text-white">...</div>
/* or register it once in your CSS (Tailwind v4) */
@theme {
--color-mediumvioletred: #c71585;
}
/* then use bg-mediumvioletred, text-mediumvioletred, border-mediumvioletred */import SwiftUI
extension Color {
static let mediumvioletred = Color(red: 0.780, green: 0.082, blue: 0.522)
}import androidx.compose.ui.graphics.Color
val Mediumvioletred = Color(0xFFC71585)import 'package:flutter/material.dart';
const mediumvioletred = Color(0xFFC71585);<!-- res/values/colors.xml -->
<color name="mediumvioletred">#C71585</color>Frequently asked questions
- What is the hex code for mediumvioletred?
- The hex code for mediumvioletred is #C71585. The same color is rgb(199, 21, 133), hsl(322, 81%, 43%) and oklch(55.3% 0.222 349.7), and in CSS you can also write the keyword mediumvioletred directly.
- Is mediumvioletred a warm or cool color?
- MediumVioletRed sits on the boundary: its hue of 322° on the HSL wheel is a magenta, which reads warm next to blues and cool next to reds and oranges.
- What colors go with mediumvioletred?
- Rotating the hue in OKLCH while keeping lightness and chroma, mediumvioletred's complementary color is #008A66 (close to seagreen), its analogous colors are #A733C1 and #D50138, and its triadic partners are #797800 and #007FB0. For text on top, white gives the higher contrast.
- Can you use white text on mediumvioletred?
- White text on mediumvioletred has a contrast ratio of 5.42:1, which passes AA for normal text but not AAA under WCAG 2.2. Black text reaches 3.87:1 and passes AA only for large text (24 px, or 18.66 px bold, and up). In APCA terms that is Lc −80.4 for white and Lc 29.1 for black.
- What is the RGB value of mediumvioletred?
- MediumVioletRed is rgb(199, 21, 133): red 199, green 21 and blue 133 on the 0 to 255 scale, or 78.0%, 8.2% and 52.2%. As a decimal integer it is 13047173.
Last reviewed by Arielton Oberek.