New advertisers: 50% off your first month with code FIRSTMONTHSee slots

Generate accessible 11-shade colour palettes from one brand hex, with semantic tokens and WCAG contrast checks.

skills.sh installs
3.4K
GitHub stars
1.1K
last updated
Aug 21, 2026
View on GitHub

What it does

  • Covers the full pipeline: hex-to-HSL conversion, an 11-shade scale (50-950), light and dark semantic tokens, and Tailwind v4 CSS output
  • Includes lightness and saturation tables per shade, plus JavaScript helpers for hex, HSL, luminance, and contrast ratio calculations
  • Enforces a foreground pair for every background token so dark mode does not break when colours are swapped
  • Designed for requests that supply a brand hex and ask for a palette, a design system setup, or contrast and accessibility checks

Install

$ npx -y skills add jezweb/claude-skills --skill color-palette -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

Colour Palette Generator

Generate a complete, accessible colour system from a single brand hex. Produces Tailwind v4 CSS ready to paste into your project.

Workflow

Step 1: Get the Brand Hex

Ask for the primary brand colour. A single hex like #0D9488 is enough.

Step 2: Generate 11-Shade Scale

Convert hex to HSL, then generate shades by varying lightness while keeping hue constant.

Hex to HSL Conversion
function hexToHSL(hex) {
  hex = hex.replace(/^#/, '');
  const r = parseInt(hex.substring(0, 2), 16) / 255;
  const g = parseInt(hex.substring(2, 4), 16) / 255;
  const b = parseInt(hex.substring(4, 6), 16) / 255;

  const max = Math.max(r, g, b);
  const min = Math.min(r, g, b);
  const diff = max - min;

  let l = (max + min) / 2;
  let s = 0;
  if (diff !== 0) {
    s = l > 0.5 ? diff / (2 - max - min) : diff / (max + min);
  }

  let h = 0;
  if (diff !== 0) {
    if (max === r) h = ((g - b) / diff + (g < b ? 6 : 0)) / 6;
    else if (max === g) h = ((b - r) / diff + 2) / 6;
    else h = ((r - g) / diff + 4) / 6;
  }

  return { h: Math.round(h * 360), s: Math.round(s * 100), l: Math.round(l * 100) };
}

Details

Repository
github.com/jezweb/claude-skills
Categories
Design & UI/UX, Frontend & UI Code

More from jezweb/claude-skills

All 64

Similar to Color Palette

More Design & UI/UX