CSS named color

Medium Orchid #BA55D3

The CSS keyword mediumorchid is #BA55D3. It is a vivid magenta in the violet family. In OKLCH it sits at lightness 0.626, chroma 0.202 and hue 319.2°.

Relative luminance
0.2164
OKLCH L · C · h
0.626 · 0.202 · 319.2
Best text
Black 5.32:1
Hue family
Violet

#BA55D3 color codes

HEX
#BA55D3
RGB
rgb(186, 85, 211)
HSL
hsl(288, 59%, 58%)
OKLCH
oklch(0.626 0.202 319.2)
OKLab
oklab(0.626 0.153 -0.132)
CIELAB (D65)
L* 53.64, a* 59.06, b* -47.40
XYZ (D65)
X 35.25, Y 21.64, Z 63.94
CMYK (naive)
cmyk(12%, 60%, 0%, 17%)

CIELAB and XYZ use the D65 white point; CSS lab() uses D50, so paste the OKLCH or HEX value into stylesheets. CMYK here is a plain formula with no press profile.

Legibility

Contrast: is #BA55D3 accessible?

Black text on it reaches 5.32:1, passing AA. White text manages only 3.94:1, enough for large text only.

WCAG 2 gives the same ratio whichever color is the text; APCA does not, so its Lc changes sign and size with polarity.

Open the Contrast System
  • Black text on it

    5.32:1

    • AA passes
    • AA large passes
    • AAA fails
    • APCA Lc +37
  • White text on it

    3.94:1

    • AA fails
    • AA large passes
    • AAA fails
    • APCA Lc −71
  • As text on black

    5.32:1

    • AA passes
    • AA large passes
    • AAA fails
    • APCA Lc −35
  • As text on white

    3.94:1

    • AA fails
    • AA large passes
    • AAA fails
    • APCA Lc +66

Nearest versions that pass 4.5:1

  • For text on white

    #AF4AC7 4.53:1

    Darkening its OKLCH lightness from 0.63 to 0.59 reaches 4.53:1 on white, keeping the hue.

  • For text on black

    #BA55D3 5.32:1

    It already reaches 5.32:1 on black, so no change is needed.

Checking another pair? Use the Contrast Checker.

Studio

Adjust #BA55D3 live

Move lightness, chroma and hue in OKLCH, or drag on the map. The map is every lightness and chroma at the current hue: sRGB inside the solid area, Display P3 out to the dashed line.

The studio needs JavaScript.

Scale

Shades and tints of #BA55D3

Eleven OKLCH lightness steps at this hue, each with its contrast against white and black. #BA55D3 sits at step 500.

  1. 50#FCF1FF
    White
    1.09
    Black
    19.16
  2. 100#F9E2FF
    White
    1.21
    Black
    17.35
  3. 200#F3C4FF
    White
    1.48
    Black
    14.15
  4. 300#EA99FF
    White
    2.00
    Black
    10.49
  5. 400#D572EE
    White
    2.81
    Black
    7.47
  6. 500This color#BA55D3
    White
    3.94
    Black
    5.32
  7. 600#9E39B6
    White
    5.65
    Black
    3.71
  8. 700#841E9B
    White
    7.95
    Black
    2.64
  9. 800#650079
    White
    11.47
    Black
    1.82
  10. 900#430051
    White
    15.46
    Black
    1.35
  11. 950#270031
    White
    18.57
    Black
    1.13

Under each step, white and black text on it; a bold figure passes 4.5:1.

Gamut

How vivid #BA55D3 can get

At its lightness and hue, sRGB reaches OKLCH chroma 0.302; #BA55D3 uses 67% of it. Display P3, which many recent phones and laptops show, reaches 0.324 there: 8% more.

0.00.20.40.60.80.20.40.60.8 460480500520540560580600620
  • sRGB
  • Display P3
  • Rec. 2020
  • Dominant wavelength
OKLCH chroma
0.202
sRGB edge
0.302
Display P3 edge
0.324
Rec. 2020 edge
0.362
Dominant wavelength
Complementary 558 nm
Excitation purity
53%
Chromaticity
x 0.2918, y 0.1791
  • This color#BA55D3
  • Most vivid in sRGB#CF00F6
  • Most vivid in Display P3oklch(0.626 0.324 319.2)

On a screen without Display P3 the last tile shows the sRGB edge instead.

Use the wider color where screens show it
.accent {
  color: #ba55d3;
}
@media (color-gamut: p3) {
  .accent { color: color(display-p3 0.7602 0 0.9594); }
}

Mixing

Mixing #BA55D3

Each row is the same mix worked out in a different space, with the halfway color at its end. sRGB, which older CSS gradients use, can sag gray or dark in the middle; OKLab keeps the lightness steps even; OKLCH holds chroma and hue as it goes.

White #FFFFFF

  • sRGB50%#DDAAE9
  • OKLab50%#DFADEB
  • OKLCH50%#DFADEB

Black #000000

  • sRGB50%#5D2B6A
  • OKLab50%#461C51
  • OKLCH50%#461C51

Its complement #38A200

  • sRGB50%#797C6A
  • OKLab50%#888789
  • OKLCH50%#D56200
In CSS
/* A gradient and a mix, worked out in OKLCH */
background: linear-gradient(in oklch, #ba55d3, white);
color: color-mix(in oklch, #ba55d3 50%, white);

In use

#BA55D3 in an interface

A button, a link, a heading, a focused field, an icon and a chart line in this color, on a light page and a dark one. Each check is a WCAG 2 contrast minimum: 1.4.3 for text, 1.4.11 for the rest.

Light page

  • Button labelText, 4.5:15.32:1 Passes
  • Link and body-size textText, 4.5:13.94:1 Fails
  • Large headingLarge text, 3:13.94:1 Passes
  • Icons, borders and focus ringsNon-text, 3:13.94:1 Passes

For text on this page, the nearest shade that passes is #AF4AC7 4.53:1

Dark page

  • Button labelText, 4.5:15.32:1 Passes
  • Link and body-size textText, 4.5:14.75:1 Passes
  • Large headingLarge text, 3:14.75:1 Passes
  • Icons, borders and focus ringsNon-text, 3:14.75:1 Passes

Color vision

How #BA55D3 looks with color blindness

Protanopia changes it most, ΔE2000 28.7; tritanopia changes it least, 17.0.

Simulated with Machado et al. (2009) at full severity, in linear light.

Simulate a whole page What each type sees
  • Protanopia

    No working red (long-wavelength) cones

    #3679D7 ΔE2000 28.7

    Distinct

    Reads as soft blue

  • Deuteranopia

    No working green (medium-wavelength) cones

    #5D84D0 ΔE2000 26.1

    Distinct

    Reads as soft blue

  • Tritanopia

    No working blue (short-wavelength) cones

    #BA698C ΔE2000 17.0

    Distinct

    Reads as soft pink

  • Achromatopsia

    No cone color vision; lightness only

    #808080 ΔE2000 28.1

    Distinct

    Reads as gray

Pairing check

Checked against its complement, #38A200. Their lightness contrast is only 1.18:1, so where hue collapses, add a label, icon or pattern.

VisionThe pairΔE2000Verdict
Normal vision#BA55D3 · #38A20087.6Stays distinct
Protanopia#3679D7 · #A7920058.6Stays distinct
Deuteranopia#5D84D0 · #9B8A2152.6Stays distinct
Tritanopia#BA698C · #299C8949.7Stays distinct
Achromatopsia#808080 · #8D8D8D4.7Easily confused

Harmony

Color harmonies for #BA55D3

Its complement is #38A200, a vivid green.

Hue rotations in OKLCH, mapped into sRGB by trimming chroma so hue and lightness stay put.

Open the Harmony Studio
  • Base#BA55D3
  • Complement#38A200

Complementary

Open in Harmony Studio
  • −30°#896AF7
  • Base#BA55D3
  • +30°#DA459A
  • Base#BA55D3
  • +120°#B17D00
  • +240°#009BA0
  • Base#BA55D3
  • +150°#8F8E00
  • +210°#009F7B

Split-complementary

Open in Harmony Studio

Code

Design tokens

Ready-to-paste tokens in six formats. Rename them to fit your system.

CSS custom property

:root {
  --color-mediumorchid: #ba55d3;
}

Tailwind config

// tailwind.config.js
module.exports = {
  theme: {
    extend: {
      colors: {
        mediumorchid: '#ba55d3',
      },
    },
  },
};

Tailwind v4 theme

/* app.css — Tailwind CSS v4 */
@import "tailwindcss";

@theme {
  --color-mediumorchid: oklch(0.626 0.202 319.2);
}

Design token (W3C DTCG)

{
  "color": {
    "mediumorchid": {
      "$type": "color",
      "$value": {
        "colorSpace": "srgb",
        "components": [0.7294, 0.3333, 0.8275],
        "hex": "#ba55d3"
      },
      "$description": "CSS named color mediumorchid"
    }
  }
}

SwiftUI color

import SwiftUI

enum Palette {
    static let mediumorchid = Color(.sRGB, red: 0.729, green: 0.333, blue: 0.827, opacity: 1)
}

Jetpack Compose color

import androidx.compose.ui.graphics.Color

object Palette {
    val Mediumorchid = Color(0xFFBA55D3)
}

Matches

The nearest match in each system

The closest CSS name, Tailwind shade, RAL Classic paint and Crayola crayon by ΔE2000; under 2 is hard to tell apart side by side. RAL and Crayola values approximate physical colors.

Tools

Open #BA55D3 in the tools

Each opens over this page. More colors live in the Color Library, and every color page is listed on the hub.