CSS named colour

Purple

#800080

A CSS named colour: purple is valid anywhere a colour is expected.

RGB
rgb(128 0 128)
HSL
300°, 100%, 25%
OKLCh
42.1% 0.193 328.4

Open in the picker

Purple in every format

Web & CSSThe everyday formats for stylesheets and design tools.

Hex#800080
RGBrgb(128 0 128)
RGB legacyrgb(128, 0, 128)
RGB percentrgb(50.2% 0% 50.2%)
HSLhsl(300 100% 25.1%)
HSL legacyhsl(300, 100%, 25.1%)
HSV / HSBhsv(300, 100%, 50.2%)
HWBhwb(300 0% 49.8%)
Nearest namepurple
CMYKcmyk(0%, 100%, 0%, 49.8%)Naive conversion. Real print work needs an ICC profile.

Perceptual & wide gamutModern CSS colour spaces for uniform scales and P3 displays.

OKLChoklch(42.091% 0.19345 328.363)Modern CSS colour space for even palettes — better than HSL when building scales.
OKLaboklab(42.091% 0.1647 -0.10147)
CIE LChlch(29.692% 66.826 327.105)
CIE Lablab(29.692% 56.112 -36.293)
Display P3color(display-p3 0.4584 0.0798 0.4848)
Rec. 2020color(rec2020 0.3614 0.0782 0.4297)
srgb-linearcolor(srgb-linear 0.2159 0 0.2159)Light-linear sRGB — the same numbers a shader wants for maths.
CIE XYZ (D65)color(xyz-d65 0.128 0.0615 0.2094)

ShadersGLSL, HLSL and WGSL vectors in both encoded and linear form.

GLSL vec3 — sRGBvec3(0.502, 0.0, 0.502)Encoded values. Use when writing straight to the framebuffer.
GLSL vec3 — linearvec3(0.216, 0.0, 0.216)Light-linear values. Use for lighting, blending and mixing.
GLSL vec4 — sRGBvec4(0.502, 0.0, 0.502, 1.0)
GLSL vec4 — linearvec4(0.216, 0.0, 0.216, 1.0)
GLSL ivec3ivec3(128, 0, 128)
HLSL float3 — sRGBfloat3(0.502, 0.0, 0.502)
HLSL float3 — linearfloat3(0.216, 0.0, 0.216)
HLSL float4 — sRGBfloat4(0.502, 0.0, 0.502, 1.0)
HLSL half4 — sRGBhalf4(0.502, 0.0, 0.502, 1.0)
WGSL vec3f — sRGBvec3f(0.502, 0.0, 0.502)
WGSL vec4f — sRGBvec4f(0.502, 0.0, 0.502, 1.0)
WGSL vec3<f32> — linearvec3<f32>(0.216, 0.0, 0.216)

Engines & appsConstructors for Unity, Unreal, Godot, Flutter, SwiftUI and Android.

Unity Colornew Color(0.502f, 0.0f, 0.502f, 1.0f)Color for everyday scripting (0–1). Color32 when you need whole numbers from 0 to 255.
Unity Color32new Color32(128, 0, 128, 255)
Unreal FLinearColorFLinearColor(0.2159f, 0.0f, 0.2159f, 1.0f)FLinearColor for materials and lighting. FColor when you need whole numbers from 0 to 255.
Unreal FColorFColor(128, 0, 128, 255)Whole numbers from 0 to 255 — use when an API asks for FColor, not FLinearColor.
Godot ColorColor(0.502, 0, 0.502, 1)
Flutter ColorColor(0xFF800080)Packed ARGB, so alpha comes first.
Android ColorColor.rgb(128, 0, 128)
SwiftUI ColorColor(red: 0.502, green: 0, blue: 0.502)
UIKit UIColorUIColor(red: 0.502, green: 0, blue: 0.502, alpha: 1)

Raw valuesPacked integers and plain arrays.

0x hex0x800080
0x hex (ARGB)0xFF800080
Array 0–1[0.502, 0, 0.502]
Array 0–255[128, 0, 128]
Decimal integer8388736

Contrast and accessibility

WCAG 2 ratios are what audits and legislation reference. APCA is shown alongside because WCAG 2 is known to misjudge mid-tone backgrounds, and it is the basis of the WCAG 3 draft.

PairingWCAG 2 ratioLevelAPCASuitable for
Purple on white9.42:1AAALc 90Body text, 18px and up
Purple on black2.23:1FailLc 13Not usable for text

Purple text on a white background

Purple text on a black background

White text on Purple

Black text on Purple

Tonal scale

Hue held fixed while lightness walks OKLCh, ready to use as a design system ramp.

  • 50#ffedff
  • 100#ffdcff
  • 200#ffbeff
  • 300#ff9afe
  • 400#e679e3
  • 500#c757c5
  • 600#a93da7
  • 700#8c278b
  • 800#731473
  • 900#5e035e
  • 950#3c003d

Tints and shades

Mixed perceptually toward white and black, so the steps feel evenly spaced.

  • Tint 1#973e96
  • Tint 2#ae66ab
  • Tint 3#c38cc0
  • Tint 4#d8b2d5
  • Tint 5#ecd8ea
  • Shade 1#630063
  • Shade 2#480048
  • Shade 3#2e002e
  • Shade 4#160016
  • Shade 5#030003

Colours that work with Purple

Complementary, triadic and analogous partners, rotated in OKLCh so they keep the same apparent brightness.

  • #00620f
  • #654800
  • #005a68
  • #5e21a6
  • #94004c

Closest CSS names

  • purpleexact match
  • darkmagentaΔEok 0.028
  • rebeccapurpleΔEok 0.085
  • indigoΔEok 0.120
  • darkslateblueΔEok 0.132
  • darkvioletΔEok 0.136