Skip to main content

bg-violet-400

Tailwind Violet 400

#A78BFA·Violet family·Shade 400

Color Values

HEX
#A78BFA
RGB
rgb(167, 139, 250)
HSL
hsl(255, 92%, 76%)
OKLCH
oklch(0.709 0.159 294)
CMYK
cmyk(33%, 44%, 0%, 2%)
CSS Variable
var(--color-violet-400)
Tailwind Class
bg-violet-400

Accessibility Score

60/100

Good

Based on WCAG 2.1 contrast ratios against white and black backgrounds.

On White

2.72:1

Fail

On Black

7.72:1

AAA
Test in Contrast Checker →

Tailwind Usage — All Utilities

Background

bg-violet-400

Text

text-violet-400

Border

border-violet-400

Ring

ring-violet-400

Outline

outline-violet-400

Fill

fill-violet-400

Stroke

stroke-violet-400

From (gradient)

from-violet-400

Via (gradient)

via-violet-400

To (gradient)

to-violet-400

Placeholder

placeholder-violet-400

Caret

caret-violet-400

Accent

accent-violet-400

Decoration

decoration-violet-400

Shadow Color

shadow-violet-400

Tailwind v3 Config (extend custom color)

// tailwind.config.js module.exports = { theme: { extend: { colors: { 'violet-400': '#a78bfa', }, }, }, };

CSS Equivalent

/* Hex */
background-color: #A78BFA;

/* RGB */
background-color: rgb(167, 139, 250);

/* HSL */
background-color: hsl(255, 92%, 76%);

/* OKLCH (CSS Color Level 4) */
background-color: oklch(0.709 0.159 294);

/* CSS Custom Property (Tailwind v4) */
background-color: var(--color-violet-400);

/* Gradient example */
background: linear-gradient(135deg, #f5f3ff 0%, #8b5cf6 100%);

OKLCH — Modern Color Space

Lightness (L)

0.709

71% perceived brightness

Chroma (C)

0.159

Color intensity / saturation

Hue (H)

294°

Angle on perceptual hue wheel

oklch(0.709 0.159 294)

OKLCH is a perceptually uniform color space in CSS Color Level 4. Unlike HSL, equal steps in L produce equal perceived lightness changes — making it ideal for building accessible, harmonious design system scales.

Design Recommendations

Mid-tone accent

Shade 400 of the Violet palette

Recommended Uses

  • Icon fills on white
  • Secondary buttons (large text)
  • Chart & data visualization bars
  • Decorative UI elements

Avoid

Body text on white — often fails WCAG AA for normal text.

Preview

On White

Aa Bb Cc

On Black

Aa Bb Cc

As Background

Aa Bb Cc — #A78BFA

Frequently Asked Questions

What is the hex code for Tailwind Violet 400?
Tailwind Violet 400 has the hex code #A78BFA. Its RGB value is rgb(167, 139, 250) and its HSL value is hsl(255, 92%, 76%).
What Tailwind utility classes use Violet 400?
Use bg-violet-400 for backgrounds, text-violet-400 for text color, border-violet-400 for borders, and ring-violet-400 for focus rings. In Tailwind v4 the CSS variable var(--color-violet-400) is available natively.
Is Tailwind Violet 400 WCAG accessible?
Tailwind Violet 400 achieves a 2.72:1 contrast ratio on white (Fail) and 7.72:1 on black (AAA). Its overall accessibility score is 60/100 (Good).
What is the OKLCH value for Tailwind Violet 400?
Tailwind Violet 400 in OKLCH is oklch(0.709 0.159 294) — lightness 0.709, chroma 0.159, hue 294°. OKLCH is a perceptually uniform space supported natively in modern CSS via the `color()` function.
What is Tailwind Violet 400 used for?
At shade 400, Tailwind Violet 400 is best described as "Mid-tone accent". Recommended uses: Icon fills on white, Secondary buttons (large text), Chart & data visualization bars.