/** * Pixel Art Library - Color Palettes * * Predefined color palettes for common pixel art styles */ import type { ColorPalette } from '@/lib/pixel-art/types'; export const PALETTES: Record = { warm: { name: 'Warm Tones', colors: { background: '#FFF8DC', crustLight: '#F4E4BC', crustMedium: '#E8C547', crustDark: '#D4A574', crustDarker: '#B8864A', crustEdge: '#8B4513', meatLight: '#DC143C', meatMedium: '#B22222', meatDark: '#8B0000', onionLight: '#FFFACD', onionMedium: '#F0E68C', steam: '#FFFFFF', stars: '#FFD700', sparkles: '#FFFFFF', heart: '#FF69B4', }, }, cool: { name: 'Cool Tones', colors: { background: '#F0F8FF', primary: '#4169E1', secondary: '#87CEEB', accent: '#00CED1', dark: '#191970', light: '#E0F6FF', }, }, earth: { name: 'Earth Tones', colors: { background: '#F5F5DC', brown: '#8B4513', tan: '#D2B48C', green: '#556B2F', darkGreen: '#2F4F2F', beige: '#F5DEB3', }, }, vibrant: { name: 'Vibrant', colors: { background: '#FFFFFF', red: '#FF0000', blue: '#0000FF', green: '#00FF00', yellow: '#FFFF00', purple: '#800080', orange: '#FFA500', }, }, monochrome: { name: 'Monochrome', colors: { white: '#FFFFFF', lightGray: '#E0E0E0', gray: '#808080', darkGray: '#404040', black: '#000000', }, }, }; /** * Get a color from a palette */ export function getColor(palette: ColorPalette, colorName: string): string { return palette.colors[colorName] || '#000000'; } /** * Create a custom palette */ export function createPalette(name: string, colors: Record): ColorPalette { return { name, colors }; } /** * Merge multiple palettes */ export function mergePalettes(...palettes: ColorPalette[]): ColorPalette { const merged: Record = {}; palettes.forEach((palette) => { Object.assign(merged, palette.colors); }); return { name: 'Merged', colors: merged, }; }