color_palette
Create an aesthetic color palette with hex codes and mood description. Optionally provide a mood to match your desired vibe.
Instructions
Get a curated, named aesthetic color palette with hex codes and mood description. Free.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mood | No | Optional mood to match: cozy, vibrant, calm, dark, warm, etc. |
Implementation Reference
- server.js:221-240 (handler)The tool handler for 'color_palette'. It takes an optional 'mood' parameter, looks up a matching palette from the 'palettes' array (or picks one at random if no mood given), and returns the palette name, hex colors, mood description, and CSS variables with a store promo.
server.tool( "color_palette", "Get a curated, named aesthetic color palette with hex codes and mood description. Free.", { mood: z.string().optional().describe("Optional mood to match: cozy, vibrant, calm, dark, warm, etc.") }, async ({ mood }) => { let palette; if (mood) { const m = mood.toLowerCase(); palette = palettes.find(p => p.mood.toLowerCase().includes(m) || p.name.toLowerCase().includes(m)) || pick(palettes); } else { palette = pick(palettes); } return { content: [{ type: "text", text: `🎨 Color Palette: "${palette.name}"\n\nColors: ${palette.colors.join(" ")}\nMood: ${palette.mood}\n\nCSS Variables:\n${palette.colors.map((c, i) => ` --color-${i + 1}: ${c};`).join("\n")}\n${storePromo()}`, }], }; } ); - server.js:224-224 (schema)Input schema for the color_palette tool: an optional 'mood' string parameter validated with Zod.
{ mood: z.string().optional().describe("Optional mood to match: cozy, vibrant, calm, dark, warm, etc.") }, - server.js:221-240 (registration)Registration of the 'color_palette' tool on the MCP server via server.tool(...). This binds the tool name, description, schema, and handler.
server.tool( "color_palette", "Get a curated, named aesthetic color palette with hex codes and mood description. Free.", { mood: z.string().optional().describe("Optional mood to match: cozy, vibrant, calm, dark, warm, etc.") }, async ({ mood }) => { let palette; if (mood) { const m = mood.toLowerCase(); palette = palettes.find(p => p.mood.toLowerCase().includes(m) || p.name.toLowerCase().includes(m)) || pick(palettes); } else { palette = pick(palettes); } return { content: [{ type: "text", text: `🎨 Color Palette: "${palette.name}"\n\nColors: ${palette.colors.join(" ")}\nMood: ${palette.mood}\n\nCSS Variables:\n${palette.colors.map((c, i) => ` --color-${i + 1}: ${c};`).join("\n")}\n${storePromo()}`, }], }; } ); - server.js:91-100 (helper)The 'palettes' data array containing 8 curated color palettes with name, hex color codes, and mood description. Used as the data source for the color_palette tool.
const palettes = [ { name: "Sunset Over Pittsburgh", colors: ["#F4845F", "#F7B267", "#F25C54", "#F9DC5C", "#2D3047"], mood: "Warm, nostalgic, golden hour" }, { name: "Midnight Emerald", colors: ["#0B3D2E", "#145A42", "#1B7A5A", "#23996E", "#2ECC71"], mood: "Deep, luxurious, mysterious" }, { name: "Tokyo Neon", colors: ["#FF006E", "#8338EC", "#3A86FF", "#FFBE0B", "#FB5607"], mood: "Electric, bold, futuristic" }, { name: "Rainy Day Jazz", colors: ["#2B2D42", "#8D99AE", "#EDF2F4", "#EF233C", "#D90429"], mood: "Moody, sophisticated, soulful" }, { name: "Northern Lights", colors: ["#0B0C10", "#1F2833", "#45A29E", "#66FCF1", "#C5C6C7"], mood: "Ethereal, awe-inspiring, cosmic" }, { name: "Campfire Stories", colors: ["#1C1C1E", "#FF9500", "#FF6B00", "#FFD60A", "#3A3A3C"], mood: "Intimate, warm, adventurous" }, { name: "Cherry Blossom", colors: ["#FFB7C5", "#FF69B4", "#FF1493", "#C71585", "#FFF0F5"], mood: "Delicate, joyful, ephemeral" }, { name: "Deep Space", colors: ["#0D1B2A", "#1B2838", "#2D4059", "#415A77", "#778DA9"], mood: "Infinite, contemplative, vast" }, ];