Color Converter (HEX, RGB, HSL)โ†’Specialized Version
๐ŸŽจ

Tailwind Color Converter

Tailwind Color Converter

RGB
HSL

All formats

Closest Tailwind color

blue-500
#3B82F6 ยท distance 0.0

Use bg-blue-500 or an arbitrary value bg-[#3b82f6] to keep the exact color.

Lightness variations

Tailwind Color Converter

Match colors to Tailwind CSS's predefined color palette.

Color Formats Supported

  • HEX: 6-digit hexadecimal codes (#FF5733)
  • RGB: Red, Green, Blue values (255, 87, 51)
  • HSL: Hue, Saturation, Lightness (11ยฐ, 100%, 60%)
  • CMYK: Cyan, Magenta, Yellow, Key for print

Using Colors Effectively

1. Accessibility: Ensure sufficient contrast for text readability 2. Consistency: Use a defined palette throughout your project 3. Hierarchy: Use color to guide attention and establish importance 4. Brand: Maintain consistent colors across all materials

Color Theory Basics

  • Primary colors: Red, blue, yellow (can't be mixed from other colors)
  • Secondary colors: Orange, green, purple (mixed from primaries)
  • Warm vs Cool: Warm colors (red, orange) feel energetic; cool colors (blue, green) feel calm

Arbitrary Values and When to Stop Using Them

Tailwind's palette covers 22 hues at 11 steps each โ€” 242 colours. Any colour outside it needs an arbitrary value:

``html

`

That works, and used more than a handful of times it means you are fighting the framework. The better move is to extend the theme so your brand colour is a first-class token:

`css @theme { --color-brand-500: #ff6347; --color-brand-600: #e5533d; } `

Then bg-brand-500 works everywhere, autocompletes, and changes in one place. Arbitrary values are an escape hatch for genuinely one-off cases, not a colour system.

A Full Ramp From This Colour

Design systems settle on a 50โ€“900 scale because it covers backgrounds, borders, text and states without anyone reaching outside the palette. Mixing toward white and black rather than adjusting HSL lightness keeps more of the hue's character:

StepColourContrast on whiteSafe for
50#F5F9FF1.06:1backgrounds and fills
100#EBF3FE1.12:1backgrounds and fills
200#CEE0FD1.34:1backgrounds and fills
300#B1CDFB1.62:1backgrounds and fills
400#76A8F92.40:1backgrounds and fills
500#3B82F63.68:1large text, borders
600#326FD14.85:1body text on white
700#295BAC6.59:1body text on white
800#2048878.98:1body text on white
900#18346212.31:1body text on white
The contrast column is the one that decides usage. Steps below 3:1 cannot carry text at any size and belong in fills and dividers; steps at 4.5:1 and above are safe for body copy.

Adjusting It

Base colour in HSL is hsl(217, 91%, 60%). Two useful moves:

`css /* +10% lightness, same hue */ --lighter: #6da2f8; /* โˆ’10% lightness */ --darker: #0b64f4; `

Raising lightness also drops perceived saturation, so a lightened colour reads greyer than its numbers suggest. Adding 5โ€“10% saturation alongside every 20% of lightness keeps the ramp looking like one hue rather than a fade to grey.

The 148 CSS Colour Keywords

CSS defines a fixed list โ€” 148 names covering 147 distinct colours, since gray and grey (and aqua/cyan, magenta/fuchsia) are aliases.

NameHEXNote
red#FF0000Full intensity
green#008000Half intensity โ€” lime is #00FF00
blue#0000FFFull intensity
purple#800080Half intensity
gray / grey#808080Both spellings valid
aqua / cyan#00FFFFIdentical
rebeccapurple#663399Added in 2014 in memory of Rebecca Meyer
The green trap catches people repeatedly: the keyword is the dark VGA green, and the bright one everybody pictures is lime.

Why Not to Use Them in Production

Named colours are excellent for prototyping and debugging โ€” border: 1px solid red while you find a layout problem โ€” and poor as a design system.

  • You get 148 and no more. Any brand colour needs a hex value anyway.
  • They carry no semantics. tomato tells a reader nothing about what it is for;
--color-danger does.
  • There are no ramps. darkblue is not a computed shade of blue โ€” it is an
unrelated fixed value, so the two do not form a scale.

Define tokens instead:

`css :root { --color-danger: #dc2626; --color-danger-bg: #fef2f2; } ``

One place to change, a name that survives a rebrand, and a ramp you control.

Frequently Asked Questions

What color format is best for web?

HEX codes are most common for CSS. RGB and HSL offer advantages for programmatic color manipulation.

How do I ensure color accessibility?

Use a contrast ratio of at least 4.5:1 for normal text and 3:1 for large text according to WCAG guidelines.

Can I use these colors commercially?

Yes, color values themselves are not copyrightable. However, be aware that Pantone color names are trademarked.

Related Tools

Explore other tools you might find useful:

More Color Converter (HEX, RGB, HSL) tools

You might also need