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.
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
| CSS keyword | mediumslateblue |
|---|---|
| HEX | #7B68EE |
| RGB | rgb(123, 104, 238) |
| HSL | hsl(249, 80%, 67%) |
| HWB | hwb(249 41% 7%) |
| OKLCH | oklch(60.4% 0.194 285.5) |
| CMYK (naive, no ICC profile) | cmyk(48%, 56%, 0%, 7%) |
| Decimal | 8,087,790 |
| Hue family | Purples 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.
| Pair | Ratio | AA | AA large | AAA | AAA large | APCA Lc |
|---|---|---|---|---|---|---|
| Black text on mediumslateblue | 5.05:1 | Pass | Pass | Fail | Pass | 35.8 |
| White text on mediumslateblue | 4.15:1 | Fail | Pass | Fail | Fail | −73.7 |
| Mediumslateblue text on white | 4.15:1 | Fail | Pass | Fail | Fail | 68.2 |
| Mediumslateblue text on black | 5.05:1 | Pass | Pass | Fail | Pass | −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)
- 5%
#8270ef - 15%
#8f7ff1 - 25%
#9c8ef2 - 35%
#a99df4 - 45%
#b6acf6 - 55%
#c4bbf7 - 65%
#d1caf9 - 75%
#ded9fb - 85%
#ebe8fc - 95%
#f8f7fe
Shades (mixed with black)
- 5%
#7563e2 - 15%
#6958ca - 25%
#5c4eb3 - 35%
#50449b - 45%
#443983 - 55%
#372f6b - 65%
#2b2453 - 75%
#1f1a3c - 85%
#121024 - 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.
| Harmony | Rotation | Color |
|---|---|---|
| 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
| Color | HEX | ΔE OK |
|---|---|---|
| mediumpurple | #9370db | 5.4 |
| slateblue | #6a5acd | 6.5 |
| royalblue | #4169e1 | 7.8 |
Nearest Tailwind v4 colors
| Color | HEX | ΔE OK |
|---|---|---|
| indigo-500 | #615fff | 5.4 |
| violet-500 | #8e51ff | 6.3 |
| indigo-400 | #7c86ff | 7.5 |
Code snippets
.element {
color: mediumslateblue;
background-color: #7b68ee;
border-color: rgb(123 104 238);
outline-color: oklch(60.4% 0.194 285.5);
}<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 */import SwiftUI
extension Color {
static let mediumslateblue = Color(red: 0.482, green: 0.408, blue: 0.933)
}import androidx.compose.ui.graphics.Color
val Mediumslateblue = Color(0xFF7B68EE)import 'package:flutter/material.dart';
const mediumslateblue = Color(0xFF7B68EE);<!-- 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.