purple for shadcn/ui

purple is a shadcn/ui theme built around a muted purple primary color (#6f5577) with muted teal accents (#55776f). The light mode uses a neutral background (#fcf7fd). Dark mode keeps the muted purple primary (#6f5577) on a neutral background (#030203).

Color palette

TokenLightDark
Background
#fcf7fdghostwhite
#030203black
Foreground
#040105black
#ffffffwhite
Card
#fcf7fdghostwhite
#030203black
Card foreground
#040105black
#ffffffwhite
Popover
#fcf7fdghostwhite
#030203black
Popover foreground
#040105black
#ffffffwhite
Primary
#6f5577dimgray
#6f5577dimgray
Primary foreground
#ffffffwhite
#ffffffwhite
Secondary
#776f55dimgray
#776f55dimgray
Secondary foreground
#ffffffwhite
#ffffffwhite
Muted
#eae5d7antiquewhite
#282415black
Muted foreground
#55503fdarkolivegreen
#c0bbaasilver
Accent
#55776fdimgray
#55776fdimgray
Accent foreground
#ffffffwhite
#ffffffwhite
Destructive
#971b02darkred
#fb3109orangered
Destructive foreground
#fed5cdbisque
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#6f5577dimgray
#6f5577dimgray

Contrast

WCAG 2 contrast ratios between each background and its foreground color.

Light mode
Text on background19.58:1AAA
Text on card19.58:1AAA
Primary button6.48:1AA
Secondary button4.99:1AA
Muted text6.42:1AA
Accent4.91:1AA
Destructive6.32:1AA
Dark mode
Text on background20.74:1AAA
Text on card20.74:1AAA
Primary button6.48:1AA
Secondary button4.99:1AA
Muted text8.09:1AAA
Accent4.91:1AA
Destructive3.77:1AA Large

CSS variables

Paste this into your globals.css to use purple in your shadcn/ui project.

:root {
  --radius: 0.5rem;
  --background: oklch(0.981 0.01 318.32);
  --foreground: oklch(0.08 0.027 321.051);
  --muted: oklch(0.923 0.02 92.857);
  --muted-foreground: oklch(0.431 0.028 93.124);
  --popover: oklch(0.981 0.01 318.32);
  --popover-foreground: oklch(0.08 0.027 321.051);
  --card: oklch(0.981 0.01 318.32);
  --card-foreground: oklch(0.08 0.027 321.051);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.489 0.063 318.187);
  --primary-foreground: oklch(1 0 180);
  --secondary: oklch(0.543 0.04 93.155);
  --secondary-foreground: oklch(1 0 180);
  --accent: oklch(0.541 0.042 178.575);
  --accent-foreground: oklch(1 0 180);
  --destructive: oklch(0.438 0.162 32.471);
  --destructive-foreground: oklch(0.906 0.048 31.239);
  --ring: oklch(0.489 0.063 318.187);
  --chart-1: oklch(0.489 0.063 318.187);
  --chart-2: oklch(0.543 0.04 93.155);
  --chart-3: oklch(0.541 0.042 178.575);
  --chart-4: oklch(0.571 0.043 93.156);
  --chart-5: oklch(0.486 0.074 318.152);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.087 0.012 319.559);
  --foreground: oklch(1 0 180);
  --muted: oklch(0.259 0.026 93.154);
  --muted-foreground: oklch(0.791 0.024 92.928);
  --popover: oklch(0.087 0.012 319.559);
  --popover-foreground: oklch(1 0 180);
  --card: oklch(0.087 0.012 319.559);
  --card-foreground: oklch(1 0 180);
  --border: oklch(0.278 0.03 256.848);
  --input: oklch(0.278 0.03 256.848);
  --primary: oklch(0.489 0.063 318.187);
  --primary-foreground: oklch(1 0 180);
  --secondary: oklch(0.543 0.04 93.155);
  --secondary-foreground: oklch(1 0 180);
  --accent: oklch(0.541 0.042 178.575);
  --accent-foreground: oklch(1 0 180);
  --destructive: oklch(0.639 0.238 32.007);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.489 0.063 318.187);
  --chart-1: oklch(0.489 0.063 318.187);
  --chart-2: oklch(0.543 0.04 93.155);
  --chart-3: oklch(0.541 0.042 178.575);
  --chart-4: oklch(0.571 0.043 93.156);
  --chart-5: oklch(0.486 0.074 318.152);
}