Why this matters
Design systems depend on consistent color scales — a single brand hue needs to span from deep backgrounds to subtle text tints without any perceptible hue shift. When you pick a blue for your primary action button, the hover state, focus ring, disabled state, and text on dark backgrounds all need to come from the same hue family. Manually adjusting the lightness slider in a color picker for each variant is tedious and prone to drift, where slight hue or saturation changes accumulate across variants and the palette no longer feels cohesive.
This generator solves the problem by converting your base color to HSL and then interpolating the lightness channel evenly across the ramp while holding hue and saturation constant. The result is a mathematically smooth gradient from dark to light that preserves the exact character of your chosen color. Exporting directly as CSS custom properties means you can drop the output straight into a `:root` block and start using `var(--shade-3)` in your stylesheets immediately.
Shade count recommendations
| Shade Count | Best For | Example Use |
|---|---|---|
| 3 | Minimal accent scale | Hover, active, disabled |
| 5 | Compact design system | Background, surface, border, text, heading |
| 9 | Tailwind-style palette | 50, 100, 200, 400, 500, 600, 700, 800, 900 equivalents |
| 11 | Extended UI scale | Additional steps for subtle gradients |
| 15 | Maximum granularity | Fine-grained data visualization scales |
How to use it
Pick a base color using the color input — click the swatch to open your system color picker or type a HEX value directly.
Choose how many shades you want in the ramp, from 3 (minimal) up to 15 (maximum granularity).
Review the generated ramp: shades are displayed as clickable swatches from darkest to lightest.
Click any individual swatch to copy that specific shade's HEX value to your clipboard.
Click the export button to get all shades formatted as CSS custom properties (`--shade-1` through `--shade-N`) ready to paste into your stylesheet.
Testing your result
Verify the ramp by selecting a vivid base color like `#E63946` (a red) and generating 9 shades. The darkest shade should be a very deep, near-black red, and the lightest should be a pale pink tint. Confirm that clicking each swatch copies a valid HEX value. Check the CSS export output — it should contain `--shade-1` through `--shade-9` with valid color values. To test hue preservation, compare the hue angle of the base color and the middle shade using an HSL converter; they should be identical or nearly so.
Common mistakes
Confusing shades with tints — shades here sample the full lightness range (dark to light), while tints specifically mix toward white only.
Using too many shades for a simple project, which creates decision fatigue when your design only needs three to five variants.
Assuming the exported CSS variables will automatically apply to your project without adding them to your stylesheet's `:root` or a relevant selector.
Picking a base color that is already very dark or very light, which compresses the useful range of the ramp.
Forgetting that extremely saturated colors may produce shades that feel too intense at certain lightness levels compared to a desaturated base.
Edge cases and options
The shade calculation works by converting the base color to HSL, then distributing the lightness evenly from a minimum of roughly 10% to a maximum of roughly 95% across the chosen number of steps. This range avoids pure black (0%) and pure white (100%) to keep every shade visually usable. The nine-shade option is specifically calibrated to match the Tailwind CSS color scale convention, making it easy to map output shades to familiar Tailwind weight numbers. If your base color is already near the extremes of lightness, the ramp will still distribute evenly but the visual difference between steps will be subtler.
Real-world use cases
Building a complete design system color palette from a single brand color, then exporting the CSS variables for immediate use in your component library.
Creating hover and focus state variations for buttons and links that feel like natural extensions of the base color rather than arbitrary lighter or darker guesses.
Generating a data visualization color scale where you need multiple shades of the same hue to represent different data intensities.
Producing a dark mode palette by taking the darker end of the ramp for backgrounds and the lighter end for text, all from one generation.
Matching a Tailwind-style naming convention by generating exactly 9 shades and mapping them to 50 through 900 weight names.
Frequently asked questions
Q: How are shades calculated?
A: The base color is converted to HSL, then lightness is interpolated evenly across the ramp from approximately 10% to 95%. Hue and saturation remain constant throughout.
Q: Is this different from tints?
A: Yes — shades sample the full lightness range from dark to light while preserving hue and saturation. Tints specifically mix toward white only, which is a different operation.
Q: Can I export to CSS?
A: Yes — the export produces CSS custom properties named `--shade-1` through `--shade-N` that you can paste directly into your `:root` block.
Q: How many shades should I use?
A: Nine is the sweet spot for a Tailwind-style palette. Use 5 for compact design systems and 3 for minimal accent scales. Go up to 15 only when you need fine-grained steps.
Q: Does it preserve the exact hue?
A: Yes — hue and saturation are held constant while only lightness varies. The result is a perceptually smooth ramp within the same color family.
Q: What format are the exported colors?
A: HEX values (#RRGGBB) both on the individual swatch copies and in the CSS variable export.
Start using it now
Try the Color Shade Generator tool. See also Color Tint Generator, Color Harmony Generator, and Color Palette Generator.