Skip to content

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.

MediumPurple#9370DB

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

Color codes for MediumPurple
CSS keywordmediumpurple
HEX#9370DB
RGBrgb(147, 112, 219)
HSLhsl(260, 60%, 65%)
HWBhwb(260 44% 14%)
OKLCHoklch(62.7% 0.158 296.7)
CMYK (naive, no ICC profile)cmyk(33%, 49%, 0%, 14%)
Decimal9,662,683
Hue familyPurples 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.

Contrast and accessibility
PairRatioAAAA largeAAAAAA largeAPCA Lc
Black text on mediumpurple5.58:1PassPassFailPass39.1
White text on mediumpurple3.76:1FailPassFailFail−70.5
Mediumpurple text on white3.76:1FailPassFailFail65.0
Mediumpurple text on black5.58:1PassPassFailPass−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)

  1. 5%
    #9877dd
  2. 15%
    #a385e0
  3. 25%
    #ae94e4
  4. 35%
    #b9a2e8
  5. 45%
    #c4b0eb
  6. 55%
    #cebfef
  7. 65%
    #d9cdf2
  8. 75%
    #e4dbf6
  9. 85%
    #efeafa
  10. 95%
    #faf8fd

Shades (mixed with black)

  1. 5%
    #8c6ad0
  2. 15%
    #7d5fba
  3. 25%
    #6e54a4
  4. 35%
    #60498e
  5. 45%
    #513e78
  6. 55%
    #423263
  7. 65%
    #33274d
  8. 75%
    #251c37
  9. 85%
    #161121
  10. 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.

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

Nearest CSS named colors
ColorHEXΔE OK
mediumslateblue#7b68ee5.4
mediumorchid#ba55d38.3
slateblue#6a5acd9.0

Nearest Tailwind v4 colors

Nearest Tailwind v4 colors
ColorHEXΔE OK
indigo-400#7c86ff7.8
violet-400#a684ff8.0
violet-500#8e51ff9.5

Code snippets

CSS
.element {
  color: mediumpurple;
  background-color: #9370db;
  border-color: rgb(147 112 219);
  outline-color: oklch(62.7% 0.158 296.7);
}
Tailwind CSS
<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 */
SwiftUI
import SwiftUI

extension Color {
  static let mediumpurple = Color(red: 0.576, green: 0.439, blue: 0.859)
}
Jetpack Compose
import androidx.compose.ui.graphics.Color

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

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