Skip to content

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.

MediumVioletRed#C71585

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

Color codes for MediumVioletRed
CSS keywordmediumvioletred
HEX#C71585
RGBrgb(199, 21, 133)
HSLhsl(322, 81%, 43%)
HWBhwb(322 8% 22%)
OKLCHoklch(55.3% 0.222 349.7)
CMYK (naive, no ICC profile)cmyk(0%, 89%, 33%, 22%)
Decimal13,047,173
Hue familyPinks

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.

Contrast and accessibility
PairRatioAAAA largeAAAAAA largeAPCA Lc
Black text on mediumvioletred3.87:1FailPassFailFail29.1
White text on mediumvioletred5.42:1PassPassFailPass−80.4
Mediumvioletred text on white5.42:1PassPassFailPass75.0
Mediumvioletred text on black3.87:1FailPassFailFail−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)

  1. 5%
    #ca218b
  2. 15%
    #cf3897
  3. 25%
    #d550a4
  4. 35%
    #db67b0
  5. 45%
    #e07ebc
  6. 55%
    #e696c8
  7. 65%
    #ebadd4
  8. 75%
    #f1c5e1
  9. 85%
    #f7dced
  10. 95%
    #fcf3f9

Shades (mixed with black)

  1. 5%
    #bd147e
  2. 15%
    #a91271
  3. 25%
    #951064
  4. 35%
    #810e56
  5. 45%
    #6d0c49
  6. 55%
    #5a093c
  7. 65%
    #46072f
  8. 75%
    #320521
  9. 85%
    #1e0314
  10. 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.

Color harmonies
HarmonyRotationColor
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.

Nearest CSS named colors

Nearest CSS named colors
ColorHEXΔE OK
deeppink#ff149311.3
crimson#dc143c11.8
darkmagenta#8b008b13.4

Nearest Tailwind v4 colors

Nearest Tailwind v4 colors
ColorHEXΔE OK
pink-700#c6005c6.2
pink-600#e600766.5
pink-500#f6339a10.6

Code snippets

CSS
.element {
  color: mediumvioletred;
  background-color: #c71585;
  border-color: rgb(199 21 133);
  outline-color: oklch(55.3% 0.222 349.7);
}
Tailwind CSS
<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 */
SwiftUI
import SwiftUI

extension Color {
  static let mediumvioletred = Color(red: 0.780, green: 0.082, blue: 0.522)
}
Jetpack Compose
import androidx.compose.ui.graphics.Color

val Mediumvioletred = Color(0xFFC71585)
Flutter
import 'package:flutter/material.dart';

const mediumvioletred = Color(0xFFC71585);
Android XML
<!-- 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.