CSS named color

Rebecca Purple #663399

The CSS keyword rebeccapurple is #663399. It is a dark soft violet in the violet family. In OKLCH it sits at lightness 0.440, chroma 0.160 and hue 303.4°.

Relative luminance
0.0749
OKLCH L · C · h
0.440 · 0.160 · 303.4
Best text
White 8.40:1
Hue family
Violet

#663399 color codes

HEX
#663399
RGB
rgb(102, 51, 153)
HSL
hsl(270, 50%, 40%)
OKLCH
oklch(0.440 0.160 303.4)
OKLab
oklab(0.440 0.088 -0.134)
CIELAB (D65)
L* 32.90, a* 42.88, b* -47.15
XYZ (D65)
X 12.41, Y 7.49, Z 30.92
CMYK (naive)
cmyk(33%, 67%, 0%, 40%)

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

White text on it reaches 8.40:1, passing AAA. Black text fails at 2.49:1.

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

    2.49:1

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

    8.40:1

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

    2.49:1

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

    8.40:1

    • AA passes
    • AA large passes
    • AAA passes
    • APCA Lc +88

Nearest versions that pass 4.5:1

  • For text on white

    #663399 8.40:1

    It already reaches 8.40:1 on white, so no change is needed.

  • For text on black

    #8F5EC7 4.59:1

    Lightening its OKLCH lightness from 0.44 to 0.58 reaches 4.59:1 on black, keeping the hue.

Checking another pair? Use the Contrast Checker.

Studio

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

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

  1. 50#F7F3FF
    White
    1.09
    Black
    19.21
  2. 100#F0E6FF
    White
    1.20
    Black
    17.46
  3. 200#E1CDFF
    White
    1.46
    Black
    14.37
  4. 300#CEAAFF
    White
    1.94
    Black
    10.81
  5. 400#B686F1
    White
    2.73
    Black
    7.66
  6. 500#9B6AD4
    White
    3.88
    Black
    5.40
  7. 600#8352B9
    White
    5.42
    Black
    3.87
  8. 700This color#663399
    White
    8.40
    Black
    2.49
  9. 800#51227D
    White
    11.20
    Black
    1.87
  10. 900#38085D
    White
    15.43
    Black
    1.36
  11. 950#21003C
    White
    18.58
    Black
    1.12

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

Gamut

How vivid #663399 can get

At its lightness and hue, sRGB reaches OKLCH chroma 0.231; #663399 uses 69% of it. Display P3, which many recent phones and laptops show, reaches 0.242 there: 5% more.

0.00.20.40.60.80.20.40.60.8 460480500520540560580600620
  • sRGB
  • Display P3
  • Rec. 2020
  • Dominant wavelength
OKLCH chroma
0.160
sRGB edge
0.231
Display P3 edge
0.242
Rec. 2020 edge
0.268
Dominant wavelength
Complementary 565 nm
Excitation purity
56%
Chromaticity
x 0.2442, y 0.1474
  • This color#663399
  • Most vivid in sRGB#7000B7
  • Most vivid in Display P3oklch(0.440 0.242 303.4)

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

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

Mixing

Mixing #663399

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%#B399CC
  • OKLab50%#AF99CE
  • OKLCH50%#AF99CE

Black #000000

  • sRGB50%#331A4D
  • OKLab50%#230D38
  • OKLCH50%#230D38

Its complement #475C00

  • sRGB50%#57484D
  • OKLab50%#55505F
  • OKLCH50%#005D6C
In CSS
/* A gradient and a mix, worked out in OKLCH */
background: linear-gradient(in oklch, #663399, white);
color: color-mix(in oklch, #663399 50%, white);

In use

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

Dark page

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

For text on this page, the nearest shade that passes is #9665CF 4.51:1

Color vision

How #663399 looks with color blindness

Achromatopsia changes it most, ΔE2000 26.4; 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

    #004C9C ΔE2000 18.6

    Distinct

    Reads as dark soft blue

  • Deuteranopia

    No working green (medium-wavelength) cones

    #0F4D97 ΔE2000 18.7

    Distinct

    Reads as dark soft blue

  • Tritanopia

    No working blue (short-wavelength) cones

    #5C4961 ΔE2000 17.0

    Distinct

    Reads as dark grayish magenta

  • Achromatopsia

    No cone color vision; lightness only

    #4D4D4D ΔE2000 26.4

    Distinct

    Reads as dark gray

Pairing check

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

VisionThe pairΔE2000Verdict
Normal vision#663399 · #475C0066.6Stays distinct
Protanopia#004C9C · #62550051.9Stays distinct
Deuteranopia#0F4D97 · #5F540D49.3Stays distinct
Tritanopia#5C4961 · #4B574D23.1Stays distinct
Achromatopsia#4D4D4D · #5555552.8Easily confused

Harmony

Color harmonies for #663399

Its complement is #475C00, a dark soft yellow.

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

Open the Harmony Studio
  • Base#663399
  • Complement#475C00

Complementary

Open in Harmony Studio
  • −30°#3A44A9
  • Base#663399
  • +30°#832477
  • Base#663399
  • +120°#784400
  • +240°#006057
  • Base#663399
  • +150°#645100
  • +210°#006433

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-rebeccapurple: #663399;
}

Tailwind config

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

Tailwind v4 theme

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

@theme {
  --color-rebeccapurple: oklch(0.440 0.160 303.4);
}

Design token (W3C DTCG)

{
  "color": {
    "rebeccapurple": {
      "$type": "color",
      "$value": {
        "colorSpace": "srgb",
        "components": [0.4, 0.2, 0.6],
        "hex": "#663399"
      },
      "$description": "CSS named color rebeccapurple"
    }
  }
}

SwiftUI color

import SwiftUI

enum Palette {
    static let rebeccapurple = Color(.sRGB, red: 0.400, green: 0.200, blue: 0.600, opacity: 1)
}

Jetpack Compose color

import androidx.compose.ui.graphics.Color

object Palette {
    val Rebeccapurple = Color(0xFF663399)
}

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

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