CSS named color
MediumPurple #9370DB
MediumPurple (CSS keyword mediumpurple) has the hex code #9370DB and the RGB value rgb(147, 112, 219): a medium, vivid blue-violet.
A soft, medium lavender-purple (#9370db). It is lighter and bluer than purple and is often used for tags and badges.
Color codes for MediumPurple
| CSS keyword | mediumpurple |
|---|---|
| HEX | #9370DB |
| RGB | rgb(147, 112, 219) |
| HSL | hsl(260, 60%, 65%) |
| HWB | hwb(260 44% 14%) |
| OKLCH | oklch(62.7% 0.158 296.7) |
| CMYK (naive, no ICC profile) | cmyk(33%, 49%, 0%, 14%) |
| Decimal | 9,662,683 |
| Hue family | Purples and violets |
Contrast and accessibility
On mediumpurple, black text has a contrast ratio of 5.58:1 and passes AA for normal text; white text reaches 3.76: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 mediumpurple | 5.58:1 | Pass | Pass | Fail | Pass | 39.1 |
| White text on mediumpurple | 3.76:1 | Fail | Pass | Fail | Fail | −70.5 |
| Mediumpurple text on white | 3.76:1 | Fail | Pass | Fail | Fail | 65.0 |
| Mediumpurple text on black | 5.58:1 | Pass | Pass | Fail | Pass | −36.7 |
Tints and shades
Each step mixes mediumpurple with white (tints) or black (shades) in gamma-encoded sRGB, the same result as color-mix(in srgb, mediumpurple, white 25%) in CSS.
Tints (mixed with white)
- 5%
#9877dd - 15%
#a385e0 - 25%
#ae94e4 - 35%
#b9a2e8 - 45%
#c4b0eb - 55%
#cebfef - 65%
#d9cdf2 - 75%
#e4dbf6 - 85%
#efeafa - 95%
#faf8fd
Shades (mixed with black)
- 5%
#8c6ad0 - 15%
#7d5fba - 25%
#6e54a4 - 35%
#60498e - 45%
#513e78 - 55%
#423263 - 65%
#33274d - 75%
#251c37 - 85%
#161121 - 95%
#07060b
Color harmonies
Rotating the hue in OKLCH while keeping lightness and chroma, mediumpurple's complementary color is #839300 (close to olivedrab), its analogous colors are #5C82E7 and #B861BA, and its triadic partners are #CD6A00 and #00A286. For text on top, black gives the higher contrast.
| Harmony | Rotation | Color |
|---|---|---|
| Complementary | +180° | #839300 |
| Analogous | −30°, +30° | #5c82e7#b861ba |
| Triadic | +120°, +240° | #cd6a00#00a286 |
| Split-complementary | +150°, +210° | #af8000#36a14a |
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?
MediumPurple is a cool color: its hue is 260° 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 |
|---|---|---|
| mediumslateblue | #7b68ee | 5.4 |
| mediumorchid | #ba55d3 | 8.3 |
| slateblue | #6a5acd | 9.0 |
Nearest Tailwind v4 colors
| Color | HEX | ΔE OK |
|---|---|---|
| indigo-400 | #7c86ff | 7.8 |
| violet-400 | #a684ff | 8.0 |
| violet-500 | #8e51ff | 9.5 |
Code snippets
.element {
color: mediumpurple;
background-color: #9370db;
border-color: rgb(147 112 219);
outline-color: oklch(62.7% 0.158 296.7);
}<div class="bg-[#9370db] text-black">...</div>
/* or register it once in your CSS (Tailwind v4) */
@theme {
--color-mediumpurple: #9370db;
}
/* then use bg-mediumpurple, text-mediumpurple, border-mediumpurple */import SwiftUI
extension Color {
static let mediumpurple = Color(red: 0.576, green: 0.439, blue: 0.859)
}import androidx.compose.ui.graphics.Color
val Mediumpurple = Color(0xFF9370DB)import 'package:flutter/material.dart';
const mediumpurple = Color(0xFF9370DB);<!-- res/values/colors.xml -->
<color name="mediumpurple">#9370DB</color>Frequently asked questions
- What is the hex code for mediumpurple?
- The hex code for mediumpurple is #9370DB. The same color is rgb(147, 112, 219), hsl(260, 60%, 65%) and oklch(62.7% 0.158 296.7), and in CSS you can also write the keyword mediumpurple directly.
- Is mediumpurple a warm or cool color?
- MediumPurple is a cool color: its hue is 260° on the HSL wheel, in the green, blue and violet range that is conventionally called cool.
- What colors go with mediumpurple?
- Rotating the hue in OKLCH while keeping lightness and chroma, mediumpurple's complementary color is #839300 (close to olivedrab), its analogous colors are #5C82E7 and #B861BA, and its triadic partners are #CD6A00 and #00A286. For text on top, black gives the higher contrast.
- Can you use white text on mediumpurple?
- White text on mediumpurple has a contrast ratio of 3.76:1, which passes AA only for large text (24 px, or 18.66 px bold, and up) under WCAG 2.2. Black text reaches 5.58:1 and passes AA for normal text but not AAA. In APCA terms that is Lc −70.5 for white and Lc 39.1 for black.
- What is the RGB value of mediumpurple?
- MediumPurple is rgb(147, 112, 219): red 147, green 112 and blue 219 on the 0 to 255 scale, or 57.6%, 43.9% and 85.9%. As a decimal integer it is 9662683.
Last reviewed by Arielton Oberek.