Loading...
Loading...
Derive a full UI colour palette algorithmically from one or two brand colours. Darker and lighter variants for interactive states, desaturated greys from the brand hue for borders and backgrounds, and semantic colours that feel coherent with the brand rather than generic. Use when building a colour system from scratch or expanding a limited brand palette for UI use.
npx skill4agent add dembrandt/dembrandt-skills algorithmic-color-paletteDon't guess the seed colours — extract them (dembrandt engine, optional). If the brand already exists on the web, pull its real palette off the live site instead of eyeballing a hex:(or theget_color_paletteskill) returns the actual computed brand and neutral colours from the DOM, which you then expand with the methods below. Seeextract-designfor setup.extract-design
base: hsl(H, S%, L%)
hover: hsl(H, S%, L% - 8%) ← darken by reducing lightness
active: hsl(H, S%, L% - 14%) ← darken further
tint: hsl(H, S%, L% + 40%) ← lighten significantly for backgrounds
subtle: hsl(H, S% * 0.3, L% + 45%) ← heavily desaturated, near-white#133174--color-primary-subtle: hsl(224, 21%, 94%); /* background tint */
--color-primary-tint: hsl(224, 70%, 67%); /* light variant */
--color-primary: hsl(224, 70%, 27%); /* base */
--color-primary-hover: hsl(224, 70%, 19%); /* hover: -8% lightness */
--color-primary-active: hsl(224, 70%, 13%); /* active: -14% lightness */--color-success-subtle: hsl(142, 20%, 94%);
--color-success: hsl(142, 60%, 35%);
--color-success-hover: hsl(142, 60%, 27%);#666#999#eee#000000#FFFFFF#222222grey-900#EEEEEEgrey-50#FFFFFFbrand hue H
grey-900: hsl(H, 12%, 10%) ← near-black, text
grey-700: hsl(H, 10%, 30%) ← dark text, icons
grey-500: hsl(H, 8%, 50%) ← secondary text, placeholders
grey-300: hsl(H, 6%, 70%) ← disabled text, subtle labels
grey-200: hsl(H, 5%, 82%) ← borders, dividers
grey-100: hsl(H, 4%, 92%) ← input backgrounds, table stripes
grey-50: hsl(H, 3%, 96%) ← page background, subtle fills#133174--color-grey-900: hsl(224, 12%, 10%); /* #16171f — slightly blue-black */
--color-grey-500: hsl(224, 8%, 50%); /* #7b7e8a — cool grey */
--color-grey-200: hsl(224, 5%, 82%); /* #cfd0d5 — cool light border */
--color-grey-50: hsl(224, 3%, 96%); /* #f4f4f6 — near-white with a hint of blue */#f5f5f5| Semantic | Hue (H) | Saturation (S) | Lightness (L) |
|---|---|---|---|
| Error | 0–10 | Match Primary | Match Primary |
| Warning | 35–45 | Match Primary | Primary L - 10% |
| Success | 140–160 | Match Primary | Match Primary |
| Info | 210–230 | Match Primary | Match Primary |
hsl(215, 95%, 50%)--color-focus--color-selectiongrey-900--color-overlay: hsla(H, 12%, 10%, 0.5);grey-200grey-100--color-skeletongrey-500grey-200hsla(H, 15%, 5%, alpha)--color-shadow-base--color-link--color-link-visitedgrey-200:root {
/* Primary — derived from brand #133174 */
--color-primary-subtle: hsl(224, 21%, 94%);
--color-primary-tint: hsl(224, 70%, 67%);
--color-primary: hsl(224, 70%, 27%);
--color-primary-hover: hsl(224, 70%, 19%);
--color-primary-active: hsl(224, 70%, 13%);
/* Brand-tinted neutrals */
--color-grey-900: hsl(224, 12%, 10%);
--color-grey-700: hsl(224, 10%, 30%);
--color-grey-500: hsl(224, 8%, 50%);
--color-grey-300: hsl(224, 6%, 70%);
--color-grey-200: hsl(224, 5%, 82%);
--color-grey-100: hsl(224, 4%, 92%);
--color-grey-50: hsl(224, 3%, 96%);
/* Semantic */
--color-error: hsl(4, 72%, 44%);
--color-warning: hsl(38, 80%, 44%);
--color-success: hsl(142, 58%, 35%);
--color-info: hsl(224, 70%, 27%); /* = primary */
/* Semantic subtle backgrounds */
--color-error-subtle: hsl(4, 50%, 95%);
--color-warning-subtle: hsl(38, 60%, 95%);
--color-success-subtle: hsl(142, 40%, 95%);
/* Functional */
--color-focus: var(--color-primary);
--color-selection: hsl(224, 70%, 90%);
--color-overlay: hsla(224, 12%, 10%, 0.5);
--color-skeleton: var(--color-grey-200);
--color-shadow: hsla(224, 15%, 5%, 0.1);
/* Links */
--color-link: var(--color-primary);
--color-link-visited: hsl(244, 40%, 35%);
}#666#eee--color-focusvisited| Anti-pattern | Problem | Fix |
|---|---|---|
| Pure black on pure white | High visual strain, "halation" | Use near-black (#222) and off-white (#EEE) |
| Grey borders next to colourful areas | Looks cheap and disconnected | Remove border or use a tinted/darker version of the adjacent colour |
| Randomly picked "Warning/Error" colours | Palette feels uncoordinated | Derive from brand HSL with visual weight alignment |
| Generic grey palette (#666, #999) | Lacks brand identity | Tint neutrals with a low-saturation version of the brand hue |