Skip to main content
MC

Material Color Generator

Generate a full Material Design colour palette — 50 through 900 shades plus A100-A700 accent colours from any primary hex.

Did you like the tool? Thanks!
Share:

How to Use Material Color Generator

Pick a primary colour and instantly get a complete Material Design palette: 10 shade levels (50, 100, 200, ..., 900) from light to dark, plus 4 accent shades (A100, A200, A400, A700). Each swatch shows its shade name, hex code, and CSS variable name (e.g. --md-primary-500). Click any swatch to copy its hex code. Perfect for theming UI frameworks and generating consistent colour scales.

About Material Color Generator

Material Design, Google's design system, includes a carefully crafted colour system where every primary colour is accompanied by a full palette of 10 shade levels (numbered 50, 100, 200, ..., 900) and optionally 4 accent shades (A100, A200, A400, A700). The shade scale is not a simple linear interpolation of lightness — it is designed so that the 500 level is the 'pure' brand colour, the lighter levels (50-400) are not simply the brand colour mixed with white but are deliberately adjusted for visual balance, and the darker levels (600-900) are similarly tuned for depth and readability. The accent colours are higher-saturation variants intended for floating action buttons, selection controls, and other interactive elements that need to pop against the primary palette. This tool approximates the Material Design colour scale from any input hex colour. The generation algorithm takes the base colour's HSL values and adjusts lightness and saturation across the shade levels: - **Level 500 (base):** The input colour exactly as provided. - **Lighter shades (50-400):** Lightness is interpolated from the base L upward toward 100 (white), with a slight desaturation so that very light shades do not look unnaturally vivid. The interpolation is not linear — 50 is significantly lighter than 400, and the step sizes vary to match the perceptual distribution of the official Material palettes. - **Darker shades (600-900):** Lightness is interpolated downward from the base L toward 0 (black), with maintained or slightly increased saturation to prevent muddy dark colours. Again, the step distribution is non-linear — 900 is significantly darker than 600. - **Accent shades (A100-A700):** These are higher-saturation variants of the base hue. A100 is the lightest accent (high lightness, moderate saturation), A200 and A400 increase in saturation, and A700 is a deep, highly saturated dark accent — all sharing the same hue. The tool is not an exact reproduction of Google's internal palette-generation algorithm (which is proprietary and tuned by human designers), but it produces visually sensible, usable results that follow the same structural principles. Every swatch is a clickable `<button>` that copies its hex code on click. CSS variable names are shown below each swatch in the format `--md-primary-50`, `--md-primary-100`, ..., `--md-primary-900`, `--md-primary-a100`, etc., so you can copy-paste them directly into a stylesheet or design-token file.

Details & Tips

Generation algorithm in full: **Input parsing:** The hex input is parsed to RGB, then converted to HSL. Let H_base, S_base, and L_base be the hue (0-360), saturation (0-100), and lightness (0-100) of the input colour. **Primary shade generation (50-900):** For levels 50, 100, 200, 300, 400 (lighter than base): - L_level = L_base + (100 - L_base) × factor, where factor depends on the level: - Level 50: factor = 0.92 (very light, close to white) - Level 100: factor = 0.78 - Level 200: factor = 0.60 - Level 300: factor = 0.38 - Level 400: factor = 0.15 - S_level = S_base × (1 - factor × 0.3) — slight desaturation as lightness increases (preventing neon pastels) - H_level = H_base (unchanged) For levels 600, 700, 800, 900 (darker than base): - L_level = L_base × (1 - factor), where factor depends on the level: - Level 600: factor = 0.18 - Level 700: factor = 0.38 - Level 800: factor = 0.60 - Level 900: factor = 0.82 - S_level = Math.min(100, S_base + factor × 15) — slight saturation increase for darker shades (preventing muddy dark colours) - H_level = H_base (unchanged) **Accent shade generation (A100-A700):** - A100: L = Math.min(95, L_base + 25), S = Math.min(100, S_base + 10) - A200: L = Math.min(90, L_base + 10), S = Math.min(100, S_base + 25) - A400: L = Math.max(40, L_base - 5), S = Math.min(100, S_base + 35) - A700: L = Math.max(20, L_base - 15), S = Math.min(100, S_base + 30) - H = H_base for all accents **Edge cases:** - If base is already very dark (L < 15), darker shades cluster near black — this is expected. - If base is already very light (L > 85), lighter shades cluster near white — also expected. - Hue of achromatic colours (S ≈ 0) is undefined — the palette will consist of greys at varying lightness levels, which is correct behaviour. - All generated HSL values are clamped to valid ranges before conversion. **Display grid:** All 14 swatches (10 primary + 4 accent) are displayed in a 2-column grid on desktop, single column on mobile. Each swatch is a rectangular button showing the level name on the left and the hex code on the right, with the CSS variable name underneath. The 500 level is visually highlighted as the base. **Copy behaviour:** Clicking a swatch copies its hex code with the standard "Copied!" confirmation that auto-clears after 2 seconds.

Frequently Asked Questions

How does the Material palette generator work?
It takes your input hex colour, converts it to HSL, then generates 10 primary shade levels (50-900) by adjusting lightness and saturation, plus 4 accent shades (A100-A700) with boosted saturation. Each swatch shows its level, hex code, and CSS variable name.
What are the Material Design shade levels?
Levels 50-900 form a gradient from light to dark: 50 is the lightest (near white), 500 is the base brand colour, and 900 is the darkest (near black). Levels 100-400 are progressively lighter tints; 600-900 are progressively darker shades.
What are the A100-A700 accent colours?
Accent colours are higher-saturation variants of the primary hue, designed for floating action buttons, selection controls, and interactive elements. A100 is the lightest accent, A700 is the darkest.
Is this an exact reproduction of Google's Material palette?
No — Google's official palettes are hand-tuned by designers. This tool approximates the same structural principles (lighter shades, darker shades, accent colours) using algorithmic lightness and saturation adjustments.
What are the CSS variable names used for?
They follow the convention --md-primary-50, --md-primary-100, etc., making it easy to copy-paste them into a CSS custom properties setup or a design-token configuration. Each swatch displays its variable name.
How do I copy a specific shade's hex code?
Click any swatch and its 6-digit hex code is copied to your clipboard. A "Copied!" confirmation appears briefly.
Does the palette update live as I type?
Yes — every keystroke in the hex field or any change via the colour picker triggers an instant recalculation of all 14 swatches.
Can I use the colour picker instead of typing hex?
Yes — a native `<input type="color">` is provided. Selecting a colour from the OS palette instantly regenerates the full palette.
What happens if my base colour is very dark or very light?
If the base is near black (low L), the darker shades (600-900) cluster near black. If near white (high L), lighter shades (50-400) cluster near white. The tool still generates all 14 levels — the useful range is the one going in the opposite direction.
How does the accent generation differ from primary shades?
Accents boost saturation significantly (20-35% higher than base) and span a compressed lightness range. They are designed to be visually distinct — more vibrant — while still belonging to the same hue family.
Can I copy the CSS variable names?
The variable names are shown as text below each swatch. You can select them with your mouse and copy manually, or use the hex copy feature for the colour value itself.
Is my data sent to a server?
No — all palette generation happens locally in your browser using JavaScript. Nothing is transmitted anywhere.

Part of These Collections

Also Available As

material design color, material palette generator, material color shades, material design palette, google material color, color shade generator, material accent color, ui color palette

Found a Problem?

Let us know if something with Material Color Generator isn't working as expected.

Thanks — we'll take a look.