CSS named color

Medium Slate Blue #7B68EE

The CSS keyword mediumslateblue is #7B68EE. It is a vivid violet in the violet family. In OKLCH it sits at lightness 0.604, chroma 0.194 and hue 285.5°.

Relative luminance
0.2028
OKLCH L · C · h
0.604 · 0.194 · 285.5
Best text
Black 5.05:1
Hue family
Violet

#7B68EE color codes

HEX
#7B68EE
RGB
rgb(123, 104, 238)
HSL
hsl(249, 80%, 67%)
OKLCH
oklch(0.604 0.194 285.5)
OKLab
oklab(0.604 0.052 -0.187)
CIELAB (D65)
L* 52.16, a* 41.07, b* -65.40
XYZ (D65)
X 28.55, Y 20.28, Z 83.28
CMYK (naive)
cmyk(48%, 56%, 0%, 7%)

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 #7B68EE accessible?

Black text on it reaches 5.05:1, passing AA. White text manages only 4.15: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.05:1

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

    4.15:1

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

    5.05:1

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

    4.15:1

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

Nearest versions that pass 4.5:1

  • For text on white

    #7562E7 4.50:1

    Darkening its OKLCH lightness from 0.60 to 0.58 reaches 4.50:1 on white, keeping the hue.

  • For text on black

    #7B68EE 5.05:1

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

Checking another pair? Use the Contrast Checker.

Studio

Adjust #7B68EE 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 #7B68EE

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

  1. 50#F4F4FF
    White
    1.09
    Black
    19.23
  2. 100#E9E9FF
    White
    1.19
    Black
    17.56
  3. 200#D3D2FF
    White
    1.45
    Black
    14.43
  4. 300#B7B4FF
    White
    1.91
    Black
    10.98
  5. 400#9A90FF
    White
    2.68
    Black
    7.80
  6. 500This color#7B68EE
    White
    4.15
    Black
    5.05
  7. 600#6954D7
    White
    5.45
    Black
    3.85
  8. 700#543BBA
    White
    7.74
    Black
    2.71
  9. 800#3E2097
    White
    11.30
    Black
    1.85
  10. 900#2A0073
    White
    15.60
    Black
    1.34
  11. 950#170047
    White
    18.62
    Black
    1.12

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

Gamut

How vivid #7B68EE can get

At its lightness and hue, sRGB reaches OKLCH chroma 0.225; #7B68EE uses 86% of it. Display P3, which many recent phones and laptops show, reaches 0.243 there: 8% more.

0.00.20.40.60.80.20.40.60.8 460480500520540560580600620
  • sRGB
  • Display P3
  • Rec. 2020
  • Dominant wavelength
OKLCH chroma
0.194
sRGB edge
0.225
Display P3 edge
0.243
Rec. 2020 edge
0.246
Dominant wavelength
458 nm
Excitation purity
58%
Chromaticity
x 0.2161, y 0.1535
  • This color#7B68EE
  • Most vivid in sRGB#7C60FF
  • Most vivid in Display P3oklch(0.604 0.243 285.5)

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

Use the wider color where screens show it
.accent {
  color: #7b68ee;
}
@media (color-gamut: p3) {
  .accent { color: color(display-p3 0.4674 0.3598 1); }
}

Mixing

Mixing #7B68EE

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%#BDB4F7
  • OKLab50%#B8B6FB
  • OKLCH50%#B8B6FB

Black #000000

  • sRGB50%#3E3477
  • OKLab50%#2C245C
  • OKLCH50%#2C245C

Its complement #8D8500

  • sRGB50%#847777
  • OKLab50%#7F7F95
  • OKLCH50%#D05061
In CSS
/* A gradient and a mix, worked out in OKLCH */
background: linear-gradient(in oklch, #7b68ee, white);
color: color-mix(in oklch, #7b68ee 50%, white);

In use

#7B68EE 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.05:1 Passes
  • Link and body-size textText, 4.5:14.15:1 Fails
  • Large headingLarge text, 3:14.15:1 Passes
  • Icons, borders and focus ringsNon-text, 3:14.15:1 Passes

For text on this page, the nearest shade that passes is #7562E7 4.50:1

Dark page

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

Color vision

How #7B68EE looks with color blindness

Achromatopsia changes it most, ΔE2000 28.2; deuteranopia changes it least, 15.3.

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

    #0280F2 ΔE2000 16.7

    Distinct

    Reads as vivid blue

  • Deuteranopia

    No working green (medium-wavelength) cones

    #0078EB ΔE2000 15.3

    Distinct

    Reads as vivid blue

  • Tritanopia

    No working blue (short-wavelength) cones

    #5286A1 ΔE2000 15.5

    Distinct

    Reads as muted blue

  • Achromatopsia

    No cone color vision; lightness only

    #7C7C7C ΔE2000 28.2

    Distinct

    Reads as gray

Pairing check

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

VisionThe pairΔE2000Verdict
Normal vision#7B68EE · #8D850067.8Stays distinct
Protanopia#0280F2 · #92800059.3Stays distinct
Deuteranopia#0078EB · #95841459.5Stays distinct
Tritanopia#5286A1 · #997B7031.2Stays distinct
Achromatopsia#7C7C7C · #8282822.3Easily confused

Harmony

Color harmonies for #7B68EE

Its complement is #8D8500, a soft yellow.

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

Open the Harmony Studio
  • Base#7B68EE
  • Complement#8D8500

Complementary

Open in Harmony Studio
  • −30°#147FF1
  • Base#7B68EE
  • +30°#AC54CE
  • Base#7B68EE
  • +120°#D05700
  • +240°#00996F
  • Base#7B68EE
  • +150°#AD7500
  • +210°#4B9700

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-mediumslateblue: #7b68ee;
}

Tailwind config

// tailwind.config.js
module.exports = {
  theme: {
    extend: {
      colors: {
        mediumslateblue: '#7b68ee',
      },
    },
  },
};

Tailwind v4 theme

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

@theme {
  --color-mediumslateblue: oklch(0.604 0.194 285.5);
}

Design token (W3C DTCG)

{
  "color": {
    "mediumslateblue": {
      "$type": "color",
      "$value": {
        "colorSpace": "srgb",
        "components": [0.4824, 0.4078, 0.9333],
        "hex": "#7b68ee"
      },
      "$description": "CSS named color mediumslateblue"
    }
  }
}

SwiftUI color

import SwiftUI

enum Palette {
    static let mediumslateblue = Color(.sRGB, red: 0.482, green: 0.408, blue: 0.933, opacity: 1)
}

Jetpack Compose color

import androidx.compose.ui.graphics.Color

object Palette {
    val Mediumslateblue = Color(0xFF7B68EE)
}

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 #7B68EE in the tools

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