[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M719F7MD2MQY9ZFVTK5QQ4BD":3,"skill-same:01M719F7MD2MQY9ZFVTK5QQ4BD":86},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":30,"publishedAt":51,"linkOnly":52,"markdownContent":53,"markdownBody":54,"frontMatter":55,"refName":58,"commitSha":59,"skillDirectory":60,"forksCount":61,"repositoryHtmlUrl":62,"repositoryHomepageUrl":63,"ownerHtmlUrl":64,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":65,"install":66,"resources":79},"01M719F7MD2MQY9ZFVTK5QQ4BD","color-palette",null,"Generate complete, accessible colour palettes from a single brand hex. Produces 11-shade scale (50-950), semantic tokens, dark mode variants, and Tailwind v4 CSS output. Includes WCAG contrast checking. Use when setting up design systems, creating Tailwind themes, building brand colours from a hex value, or checking colour accessibility.","dahaliztupe-sketch\u002FKalmeron-Two","dahaliztupe-sketch","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F271085317?v=4","01M719765Q83P08JCQ1SWNQR0N","01M719766HQBGF44W90MPJKTD2",1,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fdahaliztupe-sketch\u002FKalmeron-Two\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fcolor-palette\u002FSKILL.md",[17,22,25],{"categoryNo":18,"categoryName":19,"taxonomyType":20,"taxonomyTypeDesc":21},"01JBSEEDCAT000000000000009","前端开发","SCENARIO","使用场景",{"categoryNo":23,"categoryName":24,"taxonomyType":20,"taxonomyTypeDesc":21},"01JBSEEDCAT000000000000015","视觉设计",{"categoryNo":26,"categoryName":27,"taxonomyType":28,"taxonomyTypeDesc":29},"01JBSEEDCAT000000000000032","设计师","PROFESSION","适用职业",[31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50],"color","color palette","palette","brand","contrast","colour","generate","tailwind v4","code","when","design systems","themes","hex","only","variants","design","up","mode","Tailwind","css","2026-11-10 10:12:30",false,"---\nname: color-palette\ndescription: >\n  Generate complete, accessible colour palettes from a single brand hex.\n  Produces 11-shade scale (50-950), semantic tokens, dark mode variants,\n  and Tailwind v4 CSS output. Includes WCAG contrast checking.\n  Use when setting up design systems, creating Tailwind themes, building brand\n  colours from a hex value, or checking colour accessibility.\ncompatibility: claude-code-only\n---\n\n# Colour Palette Generator\n\nGenerate a complete, accessible colour system from a single brand hex. Produces Tailwind v4 CSS ready to paste into your project.\n\n## Workflow\n\n### Step 1: Get the Brand Hex\n\nAsk for the primary brand colour. A single hex like `#0D9488` is enough.\n\n### Step 2: Generate 11-Shade Scale\n\nConvert hex to HSL, then generate shades by varying lightness while keeping hue constant.\n\n#### Hex to HSL Conversion\n\n```javascript\nfunction hexToHSL(hex) {\n  hex = hex.replace(\u002F^#\u002F, '');\n  const r = parseInt(hex.substring(0, 2), 16) \u002F 255;\n  const g = parseInt(hex.substring(2, 4), 16) \u002F 255;\n  const b = parseInt(hex.substring(4, 6), 16) \u002F 255;\n\n  const max = Math.max(r, g, b);\n  const min = Math.min(r, g, b);\n  const diff = max - min;\n\n  let l = (max + min) \u002F 2;\n  let s = 0;\n  if (diff !== 0) {\n    s = l > 0.5 ? diff \u002F (2 - max - min) : diff \u002F (max + min);\n  }\n\n  let h = 0;\n  if (diff !== 0) {\n    if (max === r) h = ((g - b) \u002F diff + (g \u003C b ? 6 : 0)) \u002F 6;\n    else if (max === g) h = ((b - r) \u002F diff + 2) \u002F 6;\n    else h = ((r - g) \u002F diff + 4) \u002F 6;\n  }\n\n  return { h: Math.round(h * 360), s: Math.round(s * 100), l: Math.round(l * 100) };\n}\n```\n\n#### Lightness and Saturation Values\n\n| Shade | Lightness | Saturation Mult | Use Case |\n|-------|-----------|-----------------|----------|\n| 50 | 97% | 0.80 | Subtle backgrounds |\n| 100 | 94% | 0.80 | Hover states |\n| 200 | 87% | 0.85 | Borders, dividers |\n| 300 | 75% | 0.90 | Disabled states |\n| 400 | 62% | 0.95 | Placeholder text |\n| 500 | 48% | 1.00 | **Brand colour baseline** |\n| 600 | 40% | 1.00 | Primary actions (often the brand colour) |\n| 700 | 33% | 1.00 | Hover on primary |\n| 800 | 27% | 1.00 | Active states |\n| 900 | 20% | 1.00 | Text on light bg |\n| 950 | 10% | 1.00 | Darkest accents |\n\nReduce saturation for lighter shades (50-200 by 15-20%, 300-400 by 5-10%) to prevent overly vibrant pastels. Keep full saturation for 500-950.\n\n#### Complete Scale Generator\n\n```javascript\nfunction generateShadeScale(brandHex) {\n  const { h, s } = hexToHSL(brandHex);\n  const shades = {\n    50:  { l: 97, sMul: 0.8 },  100: { l: 94, sMul: 0.8 },\n    200: { l: 87, sMul: 0.85 }, 300: { l: 75, sMul: 0.9 },\n    400: { l: 62, sMul: 0.95 }, 500: { l: 48, sMul: 1.0 },\n    600: { l: 40, sMul: 1.0 },  700: { l: 33, sMul: 1.0 },\n    800: { l: 27, sMul: 1.0 },  900: { l: 20, sMul: 1.0 },\n    950: { l: 10, sMul: 1.0 }\n  };\n  const result = {};\n  for (const [shade, { l, sMul }] of Object.entries(shades)) {\n    result[shade] = `hsl(${h}, ${Math.round(s * sMul)}%, ${l}%)`;\n  }\n  return result;\n}\n```\n\n#### HSL to Hex Conversion\n\n```javascript\nfunction hslToHex(h, s, l) {\n  s = s \u002F 100; l = l \u002F 100;\n  const c = (1 - Math.abs(2 * l - 1)) * s;\n  const x = c * (1 - Math.abs((h \u002F 60) % 2 - 1));\n  const m = l - c \u002F 2;\n  let r = 0, g = 0, b = 0;\n  if (h \u003C 60) { r = c; g = x; }\n  else if (h \u003C 120) { r = x; g = c; }\n  else if (h \u003C 180) { g = c; b = x; }\n  else if (h \u003C 240) { g = x; b = c; }\n  else if (h \u003C 300) { r = x; b = c; }\n  else { r = c; b = x; }\n  r = Math.round((r + m) * 255);\n  g = Math.round((g + m) * 255);\n  b = Math.round((b + m) * 255);\n  return `#${r.toString(16).padStart(2, '0')}${g.toString(16).padStart(2, '0')}${b.toString(16).padStart(2, '0')}`.toUpperCase();\n}\n```\n\n#### Verification\n\nGenerated shades should look like the same colour family with smooth progression. Light shades (50-300) usable for backgrounds, dark shades (700-950) usable for text. Brand colour recognisable in 500-700.\n\n---\n\n### Step 3: Map Semantic Tokens\n\nEvery background token MUST have a paired foreground token. Never use a background without its pair or dark mode will break.\n\n#### Light Mode Tokens\n\n| Token | Shade | Use Case |\n|-------|-------|----------|\n| `background` | white | Page backgrounds |\n| `foreground` | 950 | Body text |\n| `card` | white | Card backgrounds |\n| `card-foreground` | 900 | Card text |\n| `popover` | white | Dropdown\u002Ftooltip backgrounds |\n| `popover-foreground` | 950 | Dropdown text |\n| `primary` | 600 | Primary buttons, links |\n| `primary-foreground` | white | Text on primary buttons |\n| `secondary` | 100 | Secondary buttons |\n| `secondary-foreground` | 900 | Text on secondary buttons |\n| `muted` | 50 | Disabled backgrounds, subtle sections |\n| `muted-foreground` | 600 | Muted text, captions |\n| `accent` | 100 | Hover states, subtle highlights |\n| `accent-foreground` | 900 | Text on accent backgrounds |\n| `destructive` | red-600 | Delete buttons, errors |\n| `destructive-foreground` | white | Text on destructive buttons |\n| `border` | 200 | Input borders, dividers |\n| `input` | 200 | Input field borders |\n| `ring` | 600 | Focus rings |\n\n#### Dark Mode Tokens\n\n| Token | Shade | Use Case |\n|-------|-------|----------|\n| `background` | 950 | Page backgrounds |\n| `foreground` | 50 | Body text |\n| `card` | 900 | Card backgrounds |\n| `card-foreground` | 50 | Card text |\n| `popover` | 900 | Dropdown backgrounds |\n| `popover-foreground` | 50 | Dropdown text |\n| `primary` | 500 | Primary buttons (brighter in dark) |\n| `primary-foreground` | white | Text on primary buttons |\n| `secondary` | 800 | Secondary buttons |\n| `secondary-foreground` | 50 | Text on secondary buttons |\n| `muted` | 800 | Disabled backgrounds |\n| `muted-foreground` | 400 | Muted text |\n| `accent` | 800 | Hover states |\n| `accent-foreground` | 50 | Text on accent backgrounds |\n| `destructive` | red-500 | Delete buttons (brighter) |\n| `destructive-foreground` | white | Text on destructive |\n| `border` | 800 | Borders |\n| `input` | 800 | Input borders |\n| `ring` | 500 | Focus rings |\n\n#### Dark Mode Inversion Pattern\n\nDark mode inverts lightness while preserving hue and saturation. Swap extremes (50 becomes 950, 950 becomes 50), preserve middle (500 stays near 500).\n\n| Light Shade | Dark Equivalent | Role |\n|-------------|-----------------|------|\n| 50 | 950 | Backgrounds |\n| 100 | 900 | Subtle backgrounds |\n| 200 | 800 | Borders |\n| 500 | 500 (slightly brighter) | Brand baseline |\n| 600 | 400 | Primary actions |\n| 950 | 50 | Text colour |\n\nKey dark mode principles:\n- Use shade 500 (not 600) for primary -- brighter for visibility on dark backgrounds\n- Use shade 50 (off-white) for text instead of pure `#FFFFFF` -- easier on eyes\n- Borders need ~10-15% lighter than background (e.g. 800 border on 950 background)\n- Higher elevation = lighter colour (opposite of light mode shadows)\n- Always update foreground when changing background\n\n---\n\n### Step 4: Check Contrast\n\n#### WCAG Minimum Ratios\n\n| Content Type | AA | AAA |\n|--------------|-----|-----|\n| Normal text (\u003C18px or \u003C14px bold) | 4.5:1 | 7:1 |\n| Large text (>=18px or >=14px bold) | 3:1 | 4.5:1 |\n| UI components (buttons, borders) | 3:1 | Not defined |\n| Graphical objects (icons, charts) | 3:1 | Not defined |\n\nTarget AA for most projects, AAA for high-accessibility needs (government, healthcare).\n\n#### Luminance and Contrast Formulas\n\n```javascript\nfunction getLuminance(hex) {\n  hex = hex.replace(\u002F^#\u002F, '');\n  const r = parseInt(hex.substring(0, 2), 16) \u002F 255;\n  const g = parseInt(hex.substring(2, 4), 16) \u002F 255;\n  const b = parseInt(hex.substring(4, 6), 16) \u002F 255;\n  const rsRGB = r \u003C= 0.03928 ? r \u002F 12.92 : Math.pow((r + 0.055) \u002F 1.055, 2.4);\n  const gsRGB = g \u003C= 0.03928 ? g \u002F 12.92 : Math.pow((g + 0.055) \u002F 1.055, 2.4);\n  const bsRGB = b \u003C= 0.03928 ? b \u002F 12.92 : Math.pow((b + 0.055) \u002F 1.055, 2.4);\n  return 0.2126 * rsRGB + 0.7152 * gsRGB + 0.0722 * bsRGB;\n}\n\nfunction getContrastRatio(hex1, hex2) {\n  const lum1 = getLuminance(hex1);\n  const lum2 = getLuminance(hex2);\n  const lighter = Math.max(lum1, lum2);\n  const darker = Math.min(lum1, lum2);\n  return (lighter + 0.05) \u002F (darker + 0.05);\n}\n```\n\n#### Quick Check Table -- Light Mode\n\n| Foreground | Background | Ratio | Pass? | Use Case |\n|------------|------------|-------|-------|----------|\n| 950 | white | 18.5:1 | AAA | Body text |\n| 900 | white | 14.2:1 | AAA | Card text |\n| 700 | white | 8.1:1 | AAA | Text |\n| 600 | white | 5.7:1 | AA | Text, buttons |\n| 500 | white | 3.9:1 | Fail | Too light for text |\n| white | 600 | 5.7:1 | AA | Button text |\n| white | 700 | 8.1:1 | AAA | Button text |\n| 600 | 50 | 5.4:1 | AA | Muted section text |\n\n#### Quick Check Table -- Dark Mode\n\n| Foreground | Background | Ratio | Pass? | Use Case |\n|------------|------------|-------|-------|----------|\n| 50 | 950 | 18.5:1 | AAA | Body text |\n| 50 | 900 | 14.2:1 | AAA | Card text |\n| 400 | 950 | 8.2:1 | AAA | Muted text |\n| 400 | 900 | 6.3:1 | AA | Muted text |\n| white | 600 | 5.7:1 | AA | Button text |\n\n**Rule of thumb**: For text, aim for 50%+ lightness difference between foreground and background.\n\n#### Essential Pairs to Verify\n\n1. **Body text**: foreground on background (light: 950 on white = 18.5:1, dark: 50 on 950 = 18.5:1)\n2. **Primary button**: primary-foreground on primary (light: white on 600 = 5.7:1, dark: white on 500 = 3.9:1 -- borderline)\n3. **Muted text**: muted-foreground on muted (light: 600 on 50 = 5.4:1, dark: 400 on 800 = 4.1:1 -- may fail)\n4. **Card text**: card-foreground on card (light: 900 on white = 14.2:1, dark: 50 on 900 = 14.2:1)\n\n#### Fixing Common Contrast Failures\n\n**White on primary-500 fails (3.9:1)**: Use primary-600 instead (5.7:1), or use dark text on the button.\n\n**Muted text in dark mode fails (400 on 800 = 4.1:1)**: Use 300 on 900 = 6.8:1.\n\n**Links hard to see (500 on white = 3.9:1)**: Use primary-700 (8.1:1), or add underline decoration.\n\n---\n\n### Step 5: Output Tailwind v4 CSS\n\n```css\n@import \"tailwindcss\";\n\n@theme {\n  \u002F* Shade scale *\u002F\n  --color-primary-50: #F0FDFA;\n  --color-primary-100: #CCFBF1;\n  --color-primary-200: #99F6E4;\n  --color-primary-300: #5EEAD4;\n  --color-primary-400: #2DD4BF;\n  --color-primary-500: #14B8A6;\n  --color-primary-600: #0D9488;\n  --color-primary-700: #0F766E;\n  --color-primary-800: #115E59;\n  --color-primary-900: #134E4A;\n  --color-primary-950: #042F2E;\n\n  \u002F* Light mode semantic tokens *\u002F\n  --color-background: #FFFFFF;\n  --color-foreground: var(--color-primary-950);\n  --color-card: #FFFFFF;\n  --color-card-foreground: var(--color-primary-900);\n  --color-popover: #FFFFFF;\n  --color-popover-foreground: var(--color-primary-950);\n  --color-primary: var(--color-primary-600);\n  --color-primary-foreground: #FFFFFF;\n  --color-secondary: var(--color-primary-100);\n  --color-secondary-foreground: var(--color-primary-900);\n  --color-muted: var(--color-primary-50);\n  --color-muted-foreground: var(--color-primary-600);\n  --color-accent: var(--color-primary-100);\n  --color-accent-foreground: var(--color-primary-900);\n  --color-destructive: #DC2626;\n  --color-destructive-foreground: #FFFFFF;\n  --color-border: var(--color-primary-200);\n  --color-input: var(--color-primary-200);\n  --color-ring: var(--color-primary-600);\n  --radius: 0.5rem;\n}\n\n\u002F* Dark mode overrides *\u002F\n.dark {\n  --color-background: var(--color-primary-950);\n  --color-foreground: var(--color-primary-50);\n  --color-card: var(--color-primary-900);\n  --color-card-foreground: var(--color-primary-50);\n  --color-popover: var(--color-primary-900);\n  --color-popover-foreground: var(--color-primary-50);\n  --color-primary: var(--color-primary-500);\n  --color-primary-foreground: #FFFFFF;\n  --color-secondary: var(--color-primary-800);\n  --color-secondary-foreground: var(--color-primary-50);\n  --color-muted: var(--color-primary-800);\n  --color-muted-foreground: var(--color-primary-400);\n  --color-accent: var(--color-primary-800);\n  --color-accent-foreground: var(--color-primary-50);\n  --color-destructive: #EF4444;\n  --color-destructive-foreground: #FFFFFF;\n  --color-border: var(--color-primary-800);\n  --color-input: var(--color-primary-800);\n  --color-ring: var(--color-primary-500);\n}\n```\n\nCopy `assets\u002Ftailwind-colors.css` as a starting template.\n\n---\n\n## Component Usage Examples\n\n```tsx\n\u002F\u002F Primary button\n\u003Cbutton className=\"bg-primary text-primary-foreground hover:bg-primary\u002F90\">Click me\u003C\u002Fbutton>\n\n\u002F\u002F Secondary button\n\u003Cbutton className=\"bg-secondary text-secondary-foreground hover:bg-secondary\u002F80\">Cancel\u003C\u002Fbutton>\n\n\u002F\u002F Card\n\u003Cdiv className=\"bg-card text-card-foreground border-border rounded-lg\">\n  \u003Ch2>Title\u003C\u002Fh2>\n  \u003Cp className=\"text-muted-foreground\">Description\u003C\u002Fp>\n\u003C\u002Fdiv>\n\n\u002F\u002F Input\n\u003Cinput className=\"bg-background text-foreground border-input focus:ring-ring\" \u002F>\n```\n\n---\n\n## Common Adjustments\n\n- **Too vibrant at light shades**: Reduce saturation by 10-20%\n- **Poor contrast on primary**: Use shade 700+ for text\n- **Dark mode too dark**: Use shade 900 instead of 950 for backgrounds\n- **Brand colour too light\u002Fdark**: Adjust to shade 500-600 range\n- **Dark mode looks washed out**: Use shade 500 for primary (brighter than light mode's 600)\n- **Pure white text too harsh in dark mode**: Use shade 50 (off-white) instead\n- **Dark mode muted text fails contrast**: Use more extreme shades (300 on 900 instead of 400 on 800)\n\n### Brand Identity Adjustments\n\n- **Conservative brands** (finance, law): Use primary-700 for buttons, reduce saturation in light shades\n- **Vibrant brands** (creative, tech): Use primary-500-600, keep full saturation\n- **Minimal brands** (design, architecture): Use primary sparingly, emphasise muted tones, subtle borders (primary-100)\n\n---\n\n## Verification Checklist\n\n- [ ] Body text: >=4.5:1 (normal) or >=3:1 (large)\n- [ ] Primary button text: >=4.5:1\n- [ ] Secondary button text: >=4.5:1\n- [ ] Muted text: >=4.5:1\n- [ ] Links: >=4.5:1 (or underlined)\n- [ ] UI elements (borders): >=3:1\n- [ ] Focus indicators: >=3:1\n- [ ] Error text: >=4.5:1\n- [ ] Dark mode: All above checks pass\n- [ ] Every background has a foreground pair\n- [ ] Brand colour recognisable in both modes\n- [ ] Borders visible but not harsh\n- [ ] Cards\u002Fsections have clear boundaries\n\n**Test both modes before shipping.**\n\n---\n\n## Optional References\n\n- **Online contrast checkers**: WebAIM (webaim.org\u002Fresources\u002Fcontrastchecker), Coolors (coolors.co\u002Fcontrast-checker), Accessible Colors (accessible-colors.com)\n- **CI\u002FCD contrast tests**: Use `getContrastRatio()` in test suites to assert minimum ratios for all token pairs\n- **Transparent\u002Fgradient edge cases**: For colours with opacity, calculate against final rendered colour. For gradients, check both endpoints.\n- **OLED dark mode**: Use `@media (prefers-contrast: high)` with `#000000` background for battery savings on AMOLED screens\n- **Multi-colour palettes**: Generate separate shade scales for each brand colour, map to different semantic roles (primary, accent)\n- **Palette visualisation tools**: coolors.co, paletton.com, Figma swatches\n- `assets\u002Ftailwind-colors.css` — Complete CSS output template\n","# Colour Palette Generator\n\nGenerate a complete, accessible colour system from a single brand hex. Produces Tailwind v4 CSS ready to paste into your project.\n\n## Workflow\n\n### Step 1: Get the Brand Hex\n\nAsk for the primary brand colour. A single hex like `#0D9488` is enough.\n\n### Step 2: Generate 11-Shade Scale\n\nConvert hex to HSL, then generate shades by varying lightness while keeping hue constant.\n\n#### Hex to HSL Conversion\n\n```javascript\nfunction hexToHSL(hex) {\n  hex = hex.replace(\u002F^#\u002F, '');\n  const r = parseInt(hex.substring(0, 2), 16) \u002F 255;\n  const g = parseInt(hex.substring(2, 4), 16) \u002F 255;\n  const b = parseInt(hex.substring(4, 6), 16) \u002F 255;\n\n  const max = Math.max(r, g, b);\n  const min = Math.min(r, g, b);\n  const diff = max - min;\n\n  let l = (max + min) \u002F 2;\n  let s = 0;\n  if (diff !== 0) {\n    s = l > 0.5 ? diff \u002F (2 - max - min) : diff \u002F (max + min);\n  }\n\n  let h = 0;\n  if (diff !== 0) {\n    if (max === r) h = ((g - b) \u002F diff + (g \u003C b ? 6 : 0)) \u002F 6;\n    else if (max === g) h = ((b - r) \u002F diff + 2) \u002F 6;\n    else h = ((r - g) \u002F diff + 4) \u002F 6;\n  }\n\n  return { h: Math.round(h * 360), s: Math.round(s * 100), l: Math.round(l * 100) };\n}\n```\n\n#### Lightness and Saturation Values\n\n| Shade | Lightness | Saturation Mult | Use Case |\n|-------|-----------|-----------------|----------|\n| 50 | 97% | 0.80 | Subtle backgrounds |\n| 100 | 94% | 0.80 | Hover states |\n| 200 | 87% | 0.85 | Borders, dividers |\n| 300 | 75% | 0.90 | Disabled states |\n| 400 | 62% | 0.95 | Placeholder text |\n| 500 | 48% | 1.00 | **Brand colour baseline** |\n| 600 | 40% | 1.00 | Primary actions (often the brand colour) |\n| 700 | 33% | 1.00 | Hover on primary |\n| 800 | 27% | 1.00 | Active states |\n| 900 | 20% | 1.00 | Text on light bg |\n| 950 | 10% | 1.00 | Darkest accents |\n\nReduce saturation for lighter shades (50-200 by 15-20%, 300-400 by 5-10%) to prevent overly vibrant pastels. Keep full saturation for 500-950.\n\n#### Complete Scale Generator\n\n```javascript\nfunction generateShadeScale(brandHex) {\n  const { h, s } = hexToHSL(brandHex);\n  const shades = {\n    50:  { l: 97, sMul: 0.8 },  100: { l: 94, sMul: 0.8 },\n    200: { l: 87, sMul: 0.85 }, 300: { l: 75, sMul: 0.9 },\n    400: { l: 62, sMul: 0.95 }, 500: { l: 48, sMul: 1.0 },\n    600: { l: 40, sMul: 1.0 },  700: { l: 33, sMul: 1.0 },\n    800: { l: 27, sMul: 1.0 },  900: { l: 20, sMul: 1.0 },\n    950: { l: 10, sMul: 1.0 }\n  };\n  const result = {};\n  for (const [shade, { l, sMul }] of Object.entries(shades)) {\n    result[shade] = `hsl(${h}, ${Math.round(s * sMul)}%, ${l}%)`;\n  }\n  return result;\n}\n```\n\n#### HSL to Hex Conversion\n\n```javascript\nfunction hslToHex(h, s, l) {\n  s = s \u002F 100; l = l \u002F 100;\n  const c = (1 - Math.abs(2 * l - 1)) * s;\n  const x = c * (1 - Math.abs((h \u002F 60) % 2 - 1));\n  const m = l - c \u002F 2;\n  let r = 0, g = 0, b = 0;\n  if (h \u003C 60) { r = c; g = x; }\n  else if (h \u003C 120) { r = x; g = c; }\n  else if (h \u003C 180) { g = c; b = x; }\n  else if (h \u003C 240) { g = x; b = c; }\n  else if (h \u003C 300) { r = x; b = c; }\n  else { r = c; b = x; }\n  r = Math.round((r + m) * 255);\n  g = Math.round((g + m) * 255);\n  b = Math.round((b + m) * 255);\n  return `#${r.toString(16).padStart(2, '0')}${g.toString(16).padStart(2, '0')}${b.toString(16).padStart(2, '0')}`.toUpperCase();\n}\n```\n\n#### Verification\n\nGenerated shades should look like the same colour family with smooth progression. Light shades (50-300) usable for backgrounds, dark shades (700-950) usable for text. Brand colour recognisable in 500-700.\n\n---\n\n### Step 3: Map Semantic Tokens\n\nEvery background token MUST have a paired foreground token. Never use a background without its pair or dark mode will break.\n\n#### Light Mode Tokens\n\n| Token | Shade | Use Case |\n|-------|-------|----------|\n| `background` | white | Page backgrounds |\n| `foreground` | 950 | Body text |\n| `card` | white | Card backgrounds |\n| `card-foreground` | 900 | Card text |\n| `popover` | white | Dropdown\u002Ftooltip backgrounds |\n| `popover-foreground` | 950 | Dropdown text |\n| `primary` | 600 | Primary buttons, links |\n| `primary-foreground` | white | Text on primary buttons |\n| `secondary` | 100 | Secondary buttons |\n| `secondary-foreground` | 900 | Text on secondary buttons |\n| `muted` | 50 | Disabled backgrounds, subtle sections |\n| `muted-foreground` | 600 | Muted text, captions |\n| `accent` | 100 | Hover states, subtle highlights |\n| `accent-foreground` | 900 | Text on accent backgrounds |\n| `destructive` | red-600 | Delete buttons, errors |\n| `destructive-foreground` | white | Text on destructive buttons |\n| `border` | 200 | Input borders, dividers |\n| `input` | 200 | Input field borders |\n| `ring` | 600 | Focus rings |\n\n#### Dark Mode Tokens\n\n| Token | Shade | Use Case |\n|-------|-------|----------|\n| `background` | 950 | Page backgrounds |\n| `foreground` | 50 | Body text |\n| `card` | 900 | Card backgrounds |\n| `card-foreground` | 50 | Card text |\n| `popover` | 900 | Dropdown backgrounds |\n| `popover-foreground` | 50 | Dropdown text |\n| `primary` | 500 | Primary buttons (brighter in dark) |\n| `primary-foreground` | white | Text on primary buttons |\n| `secondary` | 800 | Secondary buttons |\n| `secondary-foreground` | 50 | Text on secondary buttons |\n| `muted` | 800 | Disabled backgrounds |\n| `muted-foreground` | 400 | Muted text |\n| `accent` | 800 | Hover states |\n| `accent-foreground` | 50 | Text on accent backgrounds |\n| `destructive` | red-500 | Delete buttons (brighter) |\n| `destructive-foreground` | white | Text on destructive |\n| `border` | 800 | Borders |\n| `input` | 800 | Input borders |\n| `ring` | 500 | Focus rings |\n\n#### Dark Mode Inversion Pattern\n\nDark mode inverts lightness while preserving hue and saturation. Swap extremes (50 becomes 950, 950 becomes 50), preserve middle (500 stays near 500).\n\n| Light Shade | Dark Equivalent | Role |\n|-------------|-----------------|------|\n| 50 | 950 | Backgrounds |\n| 100 | 900 | Subtle backgrounds |\n| 200 | 800 | Borders |\n| 500 | 500 (slightly brighter) | Brand baseline |\n| 600 | 400 | Primary actions |\n| 950 | 50 | Text colour |\n\nKey dark mode principles:\n- Use shade 500 (not 600) for primary -- brighter for visibility on dark backgrounds\n- Use shade 50 (off-white) for text instead of pure `#FFFFFF` -- easier on eyes\n- Borders need ~10-15% lighter than background (e.g. 800 border on 950 background)\n- Higher elevation = lighter colour (opposite of light mode shadows)\n- Always update foreground when changing background\n\n---\n\n### Step 4: Check Contrast\n\n#### WCAG Minimum Ratios\n\n| Content Type | AA | AAA |\n|--------------|-----|-----|\n| Normal text (\u003C18px or \u003C14px bold) | 4.5:1 | 7:1 |\n| Large text (>=18px or >=14px bold) | 3:1 | 4.5:1 |\n| UI components (buttons, borders) | 3:1 | Not defined |\n| Graphical objects (icons, charts) | 3:1 | Not defined |\n\nTarget AA for most projects, AAA for high-accessibility needs (government, healthcare).\n\n#### Luminance and Contrast Formulas\n\n```javascript\nfunction getLuminance(hex) {\n  hex = hex.replace(\u002F^#\u002F, '');\n  const r = parseInt(hex.substring(0, 2), 16) \u002F 255;\n  const g = parseInt(hex.substring(2, 4), 16) \u002F 255;\n  const b = parseInt(hex.substring(4, 6), 16) \u002F 255;\n  const rsRGB = r \u003C= 0.03928 ? r \u002F 12.92 : Math.pow((r + 0.055) \u002F 1.055, 2.4);\n  const gsRGB = g \u003C= 0.03928 ? g \u002F 12.92 : Math.pow((g + 0.055) \u002F 1.055, 2.4);\n  const bsRGB = b \u003C= 0.03928 ? b \u002F 12.92 : Math.pow((b + 0.055) \u002F 1.055, 2.4);\n  return 0.2126 * rsRGB + 0.7152 * gsRGB + 0.0722 * bsRGB;\n}\n\nfunction getContrastRatio(hex1, hex2) {\n  const lum1 = getLuminance(hex1);\n  const lum2 = getLuminance(hex2);\n  const lighter = Math.max(lum1, lum2);\n  const darker = Math.min(lum1, lum2);\n  return (lighter + 0.05) \u002F (darker + 0.05);\n}\n```\n\n#### Quick Check Table -- Light Mode\n\n| Foreground | Background | Ratio | Pass? | Use Case |\n|------------|------------|-------|-------|----------|\n| 950 | white | 18.5:1 | AAA | Body text |\n| 900 | white | 14.2:1 | AAA | Card text |\n| 700 | white | 8.1:1 | AAA | Text |\n| 600 | white | 5.7:1 | AA | Text, buttons |\n| 500 | white | 3.9:1 | Fail | Too light for text |\n| white | 600 | 5.7:1 | AA | Button text |\n| white | 700 | 8.1:1 | AAA | Button text |\n| 600 | 50 | 5.4:1 | AA | Muted section text |\n\n#### Quick Check Table -- Dark Mode\n\n| Foreground | Background | Ratio | Pass? | Use Case |\n|------------|------------|-------|-------|----------|\n| 50 | 950 | 18.5:1 | AAA | Body text |\n| 50 | 900 | 14.2:1 | AAA | Card text |\n| 400 | 950 | 8.2:1 | AAA | Muted text |\n| 400 | 900 | 6.3:1 | AA | Muted text |\n| white | 600 | 5.7:1 | AA | Button text |\n\n**Rule of thumb**: For text, aim for 50%+ lightness difference between foreground and background.\n\n#### Essential Pairs to Verify\n\n1. **Body text**: foreground on background (light: 950 on white = 18.5:1, dark: 50 on 950 = 18.5:1)\n2. **Primary button**: primary-foreground on primary (light: white on 600 = 5.7:1, dark: white on 500 = 3.9:1 -- borderline)\n3. **Muted text**: muted-foreground on muted (light: 600 on 50 = 5.4:1, dark: 400 on 800 = 4.1:1 -- may fail)\n4. **Card text**: card-foreground on card (light: 900 on white = 14.2:1, dark: 50 on 900 = 14.2:1)\n\n#### Fixing Common Contrast Failures\n\n**White on primary-500 fails (3.9:1)**: Use primary-600 instead (5.7:1), or use dark text on the button.\n\n**Muted text in dark mode fails (400 on 800 = 4.1:1)**: Use 300 on 900 = 6.8:1.\n\n**Links hard to see (500 on white = 3.9:1)**: Use primary-700 (8.1:1), or add underline decoration.\n\n---\n\n### Step 5: Output Tailwind v4 CSS\n\n```css\n@import \"tailwindcss\";\n\n@theme {\n  \u002F* Shade scale *\u002F\n  --color-primary-50: #F0FDFA;\n  --color-primary-100: #CCFBF1;\n  --color-primary-200: #99F6E4;\n  --color-primary-300: #5EEAD4;\n  --color-primary-400: #2DD4BF;\n  --color-primary-500: #14B8A6;\n  --color-primary-600: #0D9488;\n  --color-primary-700: #0F766E;\n  --color-primary-800: #115E59;\n  --color-primary-900: #134E4A;\n  --color-primary-950: #042F2E;\n\n  \u002F* Light mode semantic tokens *\u002F\n  --color-background: #FFFFFF;\n  --color-foreground: var(--color-primary-950);\n  --color-card: #FFFFFF;\n  --color-card-foreground: var(--color-primary-900);\n  --color-popover: #FFFFFF;\n  --color-popover-foreground: var(--color-primary-950);\n  --color-primary: var(--color-primary-600);\n  --color-primary-foreground: #FFFFFF;\n  --color-secondary: var(--color-primary-100);\n  --color-secondary-foreground: var(--color-primary-900);\n  --color-muted: var(--color-primary-50);\n  --color-muted-foreground: var(--color-primary-600);\n  --color-accent: var(--color-primary-100);\n  --color-accent-foreground: var(--color-primary-900);\n  --color-destructive: #DC2626;\n  --color-destructive-foreground: #FFFFFF;\n  --color-border: var(--color-primary-200);\n  --color-input: var(--color-primary-200);\n  --color-ring: var(--color-primary-600);\n  --radius: 0.5rem;\n}\n\n\u002F* Dark mode overrides *\u002F\n.dark {\n  --color-background: var(--color-primary-950);\n  --color-foreground: var(--color-primary-50);\n  --color-card: var(--color-primary-900);\n  --color-card-foreground: var(--color-primary-50);\n  --color-popover: var(--color-primary-900);\n  --color-popover-foreground: var(--color-primary-50);\n  --color-primary: var(--color-primary-500);\n  --color-primary-foreground: #FFFFFF;\n  --color-secondary: var(--color-primary-800);\n  --color-secondary-foreground: var(--color-primary-50);\n  --color-muted: var(--color-primary-800);\n  --color-muted-foreground: var(--color-primary-400);\n  --color-accent: var(--color-primary-800);\n  --color-accent-foreground: var(--color-primary-50);\n  --color-destructive: #EF4444;\n  --color-destructive-foreground: #FFFFFF;\n  --color-border: var(--color-primary-800);\n  --color-input: var(--color-primary-800);\n  --color-ring: var(--color-primary-500);\n}\n```\n\nCopy `assets\u002Ftailwind-colors.css` as a starting template.\n\n---\n\n## Component Usage Examples\n\n```tsx\n\u002F\u002F Primary button\n\u003Cbutton className=\"bg-primary text-primary-foreground hover:bg-primary\u002F90\">Click me\u003C\u002Fbutton>\n\n\u002F\u002F Secondary button\n\u003Cbutton className=\"bg-secondary text-secondary-foreground hover:bg-secondary\u002F80\">Cancel\u003C\u002Fbutton>\n\n\u002F\u002F Card\n\u003Cdiv className=\"bg-card text-card-foreground border-border rounded-lg\">\n  \u003Ch2>Title\u003C\u002Fh2>\n  \u003Cp className=\"text-muted-foreground\">Description\u003C\u002Fp>\n\u003C\u002Fdiv>\n\n\u002F\u002F Input\n\u003Cinput className=\"bg-background text-foreground border-input focus:ring-ring\" \u002F>\n```\n\n---\n\n## Common Adjustments\n\n- **Too vibrant at light shades**: Reduce saturation by 10-20%\n- **Poor contrast on primary**: Use shade 700+ for text\n- **Dark mode too dark**: Use shade 900 instead of 950 for backgrounds\n- **Brand colour too light\u002Fdark**: Adjust to shade 500-600 range\n- **Dark mode looks washed out**: Use shade 500 for primary (brighter than light mode's 600)\n- **Pure white text too harsh in dark mode**: Use shade 50 (off-white) instead\n- **Dark mode muted text fails contrast**: Use more extreme shades (300 on 900 instead of 400 on 800)\n\n### Brand Identity Adjustments\n\n- **Conservative brands** (finance, law): Use primary-700 for buttons, reduce saturation in light shades\n- **Vibrant brands** (creative, tech): Use primary-500-600, keep full saturation\n- **Minimal brands** (design, architecture): Use primary sparingly, emphasise muted tones, subtle borders (primary-100)\n\n---\n\n## Verification Checklist\n\n- [ ] Body text: >=4.5:1 (normal) or >=3:1 (large)\n- [ ] Primary button text: >=4.5:1\n- [ ] Secondary button text: >=4.5:1\n- [ ] Muted text: >=4.5:1\n- [ ] Links: >=4.5:1 (or underlined)\n- [ ] UI elements (borders): >=3:1\n- [ ] Focus indicators: >=3:1\n- [ ] Error text: >=4.5:1\n- [ ] Dark mode: All above checks pass\n- [ ] Every background has a foreground pair\n- [ ] Brand colour recognisable in both modes\n- [ ] Borders visible but not harsh\n- [ ] Cards\u002Fsections have clear boundaries\n\n**Test both modes before shipping.**\n\n---\n\n## Optional References\n\n- **Online contrast checkers**: WebAIM (webaim.org\u002Fresources\u002Fcontrastchecker), Coolors (coolors.co\u002Fcontrast-checker), Accessible Colors (accessible-colors.com)\n- **CI\u002FCD contrast tests**: Use `getContrastRatio()` in test suites to assert minimum ratios for all token pairs\n- **Transparent\u002Fgradient edge cases**: For colours with opacity, calculate against final rendered colour. For gradients, check both endpoints.\n- **OLED dark mode**: Use `@media (prefers-contrast: high)` with `#000000` background for battery savings on AMOLED screens\n- **Multi-colour palettes**: Generate separate shade scales for each brand colour, map to different semantic roles (primary, accent)\n- **Palette visualisation tools**: coolors.co, paletton.com, Figma swatches\n- `assets\u002Ftailwind-colors.css` — Complete CSS output template\n",{"name":5,"description":56,"compatibility":57},"Generate complete, accessible colour palettes from a single brand hex. Produces 11-shade scale (50-950), semantic tokens, dark mode variants, and Tailwind v4 CSS output. Includes WCAG contrast checking. Use when setting up design systems, creating Tailwind themes, building brand colours from a hex value, or checking colour accessibility.\n","claude-code-only","main","13d9afadbb6a87d6209fe4bd6ca2bbe4553119ac",".agents\u002Fskills\u002Fcolor-palette",0,"https:\u002F\u002Fgithub.com\u002Fdahaliztupe-sketch\u002FKalmeron-Two","https:\u002F\u002Fkalmeron-two.vercel.app","https:\u002F\u002Fgithub.com\u002Fdahaliztupe-sketch","2026-10-05 12:24:53",{"source":8,"skillName":5,"commands":67,"prompt":77,"zipAvailable":78},[68,71,74],{"tool":69,"command":70},"npx","npx skills add dahaliztupe-sketch\u002FKalmeron-Two --skill color-palette",{"tool":72,"command":73},"bunx","bunx skills add dahaliztupe-sketch\u002FKalmeron-Two --skill color-palette",{"tool":75,"command":76},"pnpm","pnpm dlx skills add dahaliztupe-sketch\u002FKalmeron-Two --skill color-palette","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fdahaliztupe-sketch\u002FKalmeron-Two\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fcolor-palette\u002FSKILL.md",true,[80],{"path":81,"resourceType":82,"resourceTypeDesc":83,"sizeBytes":84,"sourceHtmlUrl":85},"assets\u002Ftailwind-colors.css","ASSET","资产文件",5136,"https:\u002F\u002Fgithub.com\u002Fdahaliztupe-sketch\u002FKalmeron-Two\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fcolor-palette\u002Fassets\u002Ftailwind-colors.css",[87,96,103,118,141,159],{"skillNo":88,"name":89,"nameZh":6,"description":90,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":91,"sourceHtmlUrl":92,"categories":93,"keywords":94,"publishedAt":95},"01M73HK3SBGDHWYP2ZTMJHSJ33","skill-creator","To create new CLI skills following Anthropic's official best practices with zero manual configuration. This skill automates brainstorming, template application, validation, and installation processes while maintaining progressive disclosure patterns and writing style standards.","https:\u002F\u002Fgithub.com\u002Fdahaliztupe-sketch\u002FKalmeron-Two\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fskill-creator\u002Fskill-creator\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fdahaliztupe-sketch\u002FKalmeron-Two\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fskill-creator\u002Fskill-creator\u002FSKILL.md",[],[],"2026-11-11 15:11:14",{"skillNo":97,"name":98,"nameZh":6,"description":99,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":100,"categories":101,"keywords":102,"publishedAt":95},"01M73HA3PK4C7YS0D3VD9FQ8QA","business-investment-advisor","Business investment analysis and capital allocation advisor. Use when evaluating whether to invest in equipment, real estate, a new business, hiring, technology, or any capital expenditure. Also use for ROI calculations, IRR, NPV, payback period, build vs buy decisions, lease vs buy analysis, vendor evaluation, or deciding where to allocate limited budget for maximum return.","https:\u002F\u002Fgithub.com\u002Fdahaliztupe-sketch\u002FKalmeron-Two\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Ffinance-skills\u002Fbusiness-investment-advisor\u002FSKILL.md",[],[],{"skillNo":104,"name":105,"nameZh":6,"description":106,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":107,"sourceHtmlUrl":108,"categories":109,"keywords":113,"publishedAt":51},"01M719SWYD9RGS97HJ69PXWY62","add-new-agent","خطوات تفصيليّة لإضافة وكيل ذكاء اصطناعي جديد إلى منصّة Kalmeron من الفكرة إلى الإنتاج","https:\u002F\u002Fgithub.com\u002Fdahaliztupe-sketch\u002FKalmeron-Two\u002Fblob\u002Fmain\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fdahaliztupe-sketch\u002FKalmeron-Two\u002Fblob\u002Fmain\u002FSKILL.md",[110],{"categoryNo":111,"categoryName":112,"taxonomyType":20,"taxonomyTypeDesc":21},"01JBSEEDCAT000000000000023","Skill与智能体开发",[114,115,116,117],"add","add new agent","new","new agent",{"skillNo":119,"name":120,"nameZh":6,"description":121,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":122,"categories":123,"keywords":133,"publishedAt":51},"01M719SSKNBA7T5NS7V6DP0PX4","writing-skills","Use when creating new skills, editing existing skills, or verifying skills work before deployment","https:\u002F\u002Fgithub.com\u002Fdahaliztupe-sketch\u002FKalmeron-Two\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fwriting-skills\u002FSKILL.md",[124,127,130],{"categoryNo":125,"categoryName":126,"taxonomyType":20,"taxonomyTypeDesc":21},"01JBSEEDCAT000000000000008","测试与质量",{"categoryNo":128,"categoryName":129,"taxonomyType":20,"taxonomyTypeDesc":21},"01JBSEEDCAT000000000000018","写作与文案",{"categoryNo":131,"categoryName":132,"taxonomyType":28,"taxonomyTypeDesc":29},"01JBSEEDCAT000000000000036","内容创作者",[134,135,116,40,136,137,138,139,140],"writing skills","writing","work","editing","deployment","use","Existing",{"skillNo":142,"name":143,"nameZh":6,"description":144,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":145,"categories":146,"keywords":149,"publishedAt":51},"01M719SRFDNKA3044QD3FYZ05R","writing-plans","Use when you have a spec or requirements for a multi-step task, before touching code","https:\u002F\u002Fgithub.com\u002Fdahaliztupe-sketch\u002FKalmeron-Two\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fwriting-plans\u002FSKILL.md",[147,148],{"categoryNo":128,"categoryName":129,"taxonomyType":20,"taxonomyTypeDesc":21},{"categoryNo":131,"categoryName":132,"taxonomyType":28,"taxonomyTypeDesc":29},[150,135,151,152,39,153,154,155,156,139,40,157,158],"writing plans","plans","task","multi","spec","multi-step task","for","you","requirements",{"skillNo":160,"name":161,"nameZh":6,"description":162,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":163,"categories":164,"keywords":167,"publishedAt":51},"01M719SPN5FM1JYJSR9DGJQPZ0","web-design-guidelines","Review UI code for Web Interface Guidelines compliance. Use when asked to \"review my UI\", \"check accessibility\", \"audit design\", \"review UX\", or \"check my site against best practices\".","https:\u002F\u002Fgithub.com\u002Fdahaliztupe-sketch\u002FKalmeron-Two\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fweb-design-guidelines\u002FSKILL.md",[165,166],{"categoryNo":23,"categoryName":24,"taxonomyType":20,"taxonomyTypeDesc":21},{"categoryNo":26,"categoryName":27,"taxonomyType":28,"taxonomyTypeDesc":29},[46,168,169,170,171,172,156,173,174,175,39,176,177,178,179,180,40,139,181,182],"guidelines","web","web design guidelines","web design","vercel","accessibility","best practices","file","review","check","compliance","audit","ux","web interface guidelines","interface"]