genart.dev
MCP ToolsParameters

set_colors

Update the runtime color palette values of a sketch's current state.

Input Schema

ParameterTypeRequiredDescription
sketchIdstringyesID of the sketch to update
colorsRecord<string, string>yesColor key-value pairs to set (hex strings)

Output Shape

{
  "success": true,
  "sketchId": "noise-grid",
  "updated": ["bg", "accent"],
  "colorPalette": ["#0A0F1C", "#22D3EE"]
}

Side Effects

  • Updates sketch state.colorPalette in memory
  • Saves sketch to disk
  • Sends sketch:updated sidecar notification

Error Cases

ConditionError
No workspace open"No workspace is currently open"
Unknown sketch ID"Sketch not found: 'bad-id'"
Unknown color key"Unknown color: 'foo'. Valid keys: bg, accent"
Invalid hex color"Invalid hex color for 'bg': 'not-a-color'"

Golden Path Example

Request:

{ "sketchId": "noise-grid", "colors": { "bg": "#0A0F1C" } }

Response:

{
  "success": true,
  "sketchId": "noise-grid",
  "updated": ["bg"],
  "colorPalette": ["#0A0F1C"]
}