Skip to content

CSS named color

MediumSlateBlue #7B68EE

MediumSlateBlue (CSS keyword mediumslateblue) has the hex code #7B68EE and the RGB value rgb(123, 104, 238): a medium, vivid blue-violet.

MediumSlateBlue#7B68EE

A vivid, medium blue-violet (#7b68ee), the brightest of the slate blues. At 15 characters, it is one of the longer names in the list.

Color codes for MediumSlateBlue

Color codes for MediumSlateBlue
CSS keywordmediumslateblue
HEX#7B68EE
RGBrgb(123, 104, 238)
HSLhsl(249, 80%, 67%)
HWBhwb(249 41% 7%)
OKLCHoklch(60.4% 0.194 285.5)
CMYK (naive, no ICC profile)cmyk(48%, 56%, 0%, 7%)
Decimal8,087,790
Hue familyPurples and violets

Contrast and accessibility

On mediumslateblue, black text has a contrast ratio of 5.05:1 and passes AA for normal text; white text reaches 4.15: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 mediumslateblue5.05:1PassPassFailPass35.8
White text on mediumslateblue4.15:1FailPassFailFail−73.7
Mediumslateblue text on white4.15:1FailPassFailFail68.2
Mediumslateblue text on black5.05:1PassPassFailPass−33.4

Tints and shades

Each step mixes mediumslateblue with white (tints) or black (shades) in gamma-encoded sRGB, the same result as color-mix(in srgb, mediumslateblue, white 25%) in CSS.

Tints (mixed with white)

  1. 5%
    #8270ef
  2. 15%
    #8f7ff1
  3. 25%
    #9c8ef2
  4. 35%
    #a99df4
  5. 45%
    #b6acf6
  6. 55%
    #c4bbf7
  7. 65%
    #d1caf9
  8. 75%
    #ded9fb
  9. 85%
    #ebe8fc
  10. 95%
    #f8f7fe

Shades (mixed with black)

  1. 5%
    #7563e2
  2. 15%
    #6958ca
  3. 25%
    #5c4eb3
  4. 35%
    #50449b
  5. 45%
    #443983
  6. 55%
    #372f6b
  7. 65%
    #2b2453
  8. 75%
    #1f1a3c
  9. 85%
    #121024
  10. 95%
    #06050c

Color harmonies

Rotating the hue in OKLCH while keeping lightness and chroma, mediumslateblue's complementary color is #8F8500 (close to olive), its analogous colors are #147FF1 and #AC54CE, and its triadic partners are #D94D00 and #009C6B. For text on top, black gives the higher contrast.

Color harmonies
HarmonyRotationColor
Complementary+180°#8f8500
Analogous−30°, +30°#147ff1#ac54ce
Triadic+120°, +240°#d94d00#009c6b
Split-complementary+150°, +210°#b37200#459900

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?

MediumSlateBlue is a cool color: its hue is 249° 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
mediumpurple#9370db5.4
slateblue#6a5acd6.5
royalblue#4169e17.8

Nearest Tailwind v4 colors

Nearest Tailwind v4 colors
ColorHEXΔE OK
indigo-500#615fff5.4
violet-500#8e51ff6.3
indigo-400#7c86ff7.5

Code snippets

CSS
.element {
  color: mediumslateblue;
  background-color: #7b68ee;
  border-color: rgb(123 104 238);
  outline-color: oklch(60.4% 0.194 285.5);
}
Tailwind CSS
<div class="bg-[#7b68ee] text-black">...</div>

/* or register it once in your CSS (Tailwind v4) */
@theme {
  --color-mediumslateblue: #7b68ee;
}
/* then use bg-mediumslateblue, text-mediumslateblue, border-mediumslateblue */
SwiftUI
import SwiftUI

extension Color {
  static let mediumslateblue = Color(red: 0.482, green: 0.408, blue: 0.933)
}
Jetpack Compose
import androidx.compose.ui.graphics.Color

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

const mediumslateblue = Color(0xFF7B68EE);
Android XML
<!-- res/values/colors.xml -->
<color name="mediumslateblue">#7B68EE</color>

Frequently asked questions

What is the hex code for mediumslateblue?
The hex code for mediumslateblue is #7B68EE. The same color is rgb(123, 104, 238), hsl(249, 80%, 67%) and oklch(60.4% 0.194 285.5), and in CSS you can also write the keyword mediumslateblue directly.
Is mediumslateblue a warm or cool color?
MediumSlateBlue is a cool color: its hue is 249° on the HSL wheel, in the green, blue and violet range that is conventionally called cool.
What colors go with mediumslateblue?
Rotating the hue in OKLCH while keeping lightness and chroma, mediumslateblue's complementary color is #8F8500 (close to olive), its analogous colors are #147FF1 and #AC54CE, and its triadic partners are #D94D00 and #009C6B. For text on top, black gives the higher contrast.
Can you use white text on mediumslateblue?
White text on mediumslateblue has a contrast ratio of 4.15: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.05:1 and passes AA for normal text but not AAA. In APCA terms that is Lc −73.7 for white and Lc 35.8 for black.
What is the RGB value of mediumslateblue?
MediumSlateBlue is rgb(123, 104, 238): red 123, green 104 and blue 238 on the 0 to 255 scale, or 48.2%, 40.8% and 93.3%. As a decimal integer it is 8087790.

Last reviewed by Arielton Oberek.