agentleFS
a-ng-da-ng-d/claude-ui-color-palette/skills/ui-color-palette-generate-source-colors/SKILL.md

ui-color-palette-generate-source-colors

Skill1 starsChanged 8 months agoMITView on GitHub

Generate source colors to seed a palette. Supports three modes — extract dominant colors from an image, generate from a natural language prompt, or derive harmonies from a base color. Output is a set of ColorConfiguration objects ready to pass to ui-color-palette-scale-palette.

The file

Show its rules and text

We split this skill into the rules it gives an agent

14 rules. About 0 are common, 12 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈12

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use the ui-color-palette MCP tools to produce source colors before building a full palette.

    line 9
  2. Very specific:

    If SourceColors exists, show the existing colors (name + hex) and ask: reuse, add more, or start fresh.

    line 19
  3. Distinctive:

    If the mode is not already clear from context, ask which source to use:

    line 25
  4. Distinctive:

    Ask for a public JPEG or PNG URL if not already provided.

    line 50
  5. Distinctive:

    Ask how many dominant colors to extract (default: 5).

    line 54
  6. Distinctive:

    Call the tool with the URL and parameters.

    line 58
  7. Distinctive:

    Ask for a natural language description if not already provided (mood, brand, context, or specific colors.

    line 84
  8. Distinctive:

    Call the tool with the prompt string.

    line 88
  9. Distinctive:

    Ask for a hex base color if not already provided.

    line 113
  10. Distinctive:

    Ask which harmony type: Complementary (2 colors), Compound (3), Analogous (3), Triadic (3), Tetradic (4), Square (4), or All.

    line 119
  11. Very specific:

    Call the tool with the Channel object, selected type, and returnFormat: "both".

    line 123
  12. Distinctive:

    If the source (selection vs styles) is ambiguous, ask: "Should I extract from your current selection, or from the file's style library / …

    line 166
  13. Distinctive:

    If the tool is not specified, ask: "Which design tool are you working in — Figma, Penpot, Sketch, or Framer?"

    line 168
  14. Distinctive:

    Design tool extraction: only solid fills are extracted — gradients and image fills are skipped.

    line 179

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Generate Source Colors

Use the ui-color-palette MCP tools to produce source colors before building a full palette.

The output of this skill is a set of ColorConfiguration objects (role name + hex) ready to be passed to ui-color-palette-scale-palette.


Step 0 — Check for existing SourceColors

Before asking anything, check whether a SourceColors slot is already populated in the conversation context.

If SourceColors exists, show the existing colors (name + hex) and ask: reuse, add more, or start fresh. Wait for reply before proceeding.


Step 1 — Choose a source mode

If the mode is not already clear from context, ask which source to use:

  • Image — extract dominant colors from a photo (requires public URL)
  • Prompt — describe mood/brand in natural language
  • Harmony — derive from a single base color
  • Design tool — extract fills from a current selection in Figma, Penpot, Sketch, or Framer

Wait for reply.


Mode A — Image extraction

Tool: extract_dominant_colors

ParameterTypeRequiredDescription
imageUrlstringYesPublic URL of a JPEG or PNG image
colorCountnumberNoNumber of dominant colors to extract (default: 5)
maxIterationsnumberNoMax iterations for k-means clustering
tolerancenumberNoConvergence tolerance
skipTransparentbooleanNoSkip transparent pixels (default: true)

Step A1 — Collect the image URL

Ask for a public JPEG or PNG URL if not already provided.

Step A2 — Color count (optional)

Ask how many dominant colors to extract (default: 5).

Step A3 — Call extract_dominant_colors

Call the tool with the URL and parameters. The tool returns colors as hex and/or RGB (0–255 per channel).

Step A4 — Show results and assign roles

Show the extracted colors as swatches (hex + preview). Ask the user to assign a role name (primary, neutral, accent, error) to each color they want to keep, and discard the rest.

Step A5 — Normalize to ColorConfiguration

Convert each kept color to a ColorConfiguration object:

  • id = omit — the server generates it automatically via uid()
  • name = the role name the user provided
  • rgb = divide each 0–255 channel by 255 → { r: R/255, g: G/255, b: B/255 }
  • Apply defaults: hue: { shift: 0, isLocked: false }, chroma: { shift: 100, isLocked: false }, alpha: { isEnabled: false, backgroundColor: "#FFFFFF" }

Mode B — Prompt generation

Tool: generate_colors_from_prompt

ParameterTypeRequiredDescription
promptstringYesNatural language description of the desired palette

Step B1 — Collect the prompt

Ask for a natural language description if not already provided (mood, brand, context, or specific colors; e.g. "a calm fintech app with deep blues and warm neutrals").

Step B2 — Call generate_colors_from_prompt

Call the tool with the prompt string. The tool uses AI (Mistral) to return a set of colors.

Step B3 — Show results and assign roles

Show the suggested colors as swatches. Ask the user to assign a role name to each color they want to keep and discard the rest.

Step B4 — Normalize to ColorConfiguration

Convert each kept color to a ColorConfiguration object using the same mapping as Step A5.


Mode C — Harmony derivation

Tool: create_color_harmony

ParameterTypeRequiredDescription
baseColorarrayYesAn RGB Channel tuple: [r, g, b] — values 0–255
typeenumNoALL, COMPLEMENTARY, ANALOGOUS, TRIADIC, TETRADIC, SQUARE, COMPOUND (default: ALL)
analogousSpreadnumberNoSpread angle in degrees for analogous harmonies (default: 30)
returnFormatenumNorgb, hex, or both (default: both)

Step C1 — Collect the base color

Ask for a hex base color if not already provided. Convert to an RGB Channel tuple:

  • Parse hex → [r, g, b] with values 0–255
  • Example: #3B82F6 → [59, 130, 246]

Step C2 — Choose harmony type

Ask which harmony type: Complementary (2 colors), Compound (3), Analogous (3), Triadic (3), Tetradic (4), Square (4), or All.

Step C3 — Call create_color_harmony

Call the tool with the Channel object, selected type, and returnFormat: "both".

Step C4 — Show results and assign roles

Show harmony colors as swatches (grouped by type if ALL). Ask the user to pick and assign a role name to each color they want to keep.

Step C5 — Normalize to ColorConfiguration

Convert each kept color to a ColorConfiguration object using the same mapping as Step A5.


Output

Once role names are confirmed, present the final source color set as a readable list:

Source colors ready:

  primary   #3B82F6
  neutral   #6B7280
  accent    #F59E0B

Session state: Store this result as the SourceColors slot. It will be reused automatically by ui-color-palette-scale-palette — the user will not need to re-enter the colors.

Then hand off to ui-color-palette-scale-palette to build the full palette.



Mode D — Design tool selection

Route to the matching design-tool reference file based on which tool the user has open and whether they want colors from the current selection or from the styles/library.

ToolFrom selectionFrom styles / library
Figmaui-color-palette-figma/references/extract-source-colors.mdui-color-palette-figma/references/extract-styles-colors.md
Penpotui-color-palette-penpot/references/extract-source-colors.mdui-color-palette-penpot/references/extract-styles-colors.md
Sketchui-color-palette-sketch/references/extract-source-colors.mdui-color-palette-sketch/references/extract-styles-colors.md
Framerui-color-palette-framer/references/extract-source-colors.mdui-color-palette-framer/references/extract-styles-colors.md

If the source (selection vs styles) is ambiguous, ask: "Should I extract from your current selection, or from the file's style library / local colors?"

If the tool is not specified, ask: "Which design tool are you working in — Figma, Penpot, Sketch, or Framer?"

Each reference file handles the tool-specific extraction and normalizes the result to ColorConfiguration objects using the same Step A5 mapping. The role assignment and SourceColors slot storage are also handled there.


Tips

  • Combine modes: e.g. extract from a design tool selection, then harmonize one of the extracted colors with Mode C.
  • Hex conversions: Channel tuple → [r, g, b] 0–255 (e.g. #3B82F6 → [59, 130, 246]); rgb 0–1 → divide by 255 (e.g. { r: 0.23, g: 0.51, b: 0.96 }).
  • Color count: 2–5 ideal (1 primary, 1 neutral, ≤3 accents/semantics). Image URL must be publicly accessible (no auth, no CORS).
  • Design tool extraction: only solid fills are extracted — gradients and image fills are skipped. Select diverse layers for better coverage.

Arguments

$ARGUMENTS can specify the source mode directly:

  • /ui-color-palette:generate-source-colors image — jump straight to image URL prompt
  • /ui-color-palette:generate-source-colors prompt warm sunset palette — use the rest as the prompt
  • /ui-color-palette:generate-source-colors harmony #3B82F6 — use the hex as the base color
  • /ui-color-palette:generate-source-colors figma — extract from current Figma selection
  • /ui-color-palette:generate-source-colors figma styles — extract from Figma paint styles
  • /ui-color-palette:generate-source-colors penpot — extract from current Penpot selection
  • /ui-color-palette:generate-source-colors penpot styles — extract from Penpot local color library
  • /ui-color-palette:generate-source-colors sketch — extract from current Sketch selection
  • /ui-color-palette:generate-source-colors sketch styles — extract from Sketch shared layer styles
  • /ui-color-palette:generate-source-colors framer — extract from current Framer selection
  • /ui-color-palette:generate-source-colors framer styles — extract from Framer color styles

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.