Custom PNG Palette Creator
Create custom color palettes and export them as PNG swatch images, CSS variables, SCSS, and JSON. Pick colors, generate harmonies, and download production-ready palette files.
About
Color palette inconsistency across design systems causes measurable production waste. A single mismatched hex value between a Figma file and a CSS stylesheet can propagate through hundreds of components. This tool generates palette files in multiple output formats - PNG swatch strips, CSS custom properties, SCSS maps, and raw JSON - from a single source of truth you define here. It calculates WCAG 2.1 contrast ratios against white and black backgrounds for every color, so you can validate accessibility compliance before committing to a design token set. Color harmony algorithms rotate hue values in HSL space at fixed angular intervals: complementary at 180°, triadic at 120°, analogous at 30°. The PNG export writes actual pixel data to a Canvas element via ImageData, producing a lossless raster file - not a screenshot, not a simulation.
Limitation: the named-color matching uses a dictionary of 148 CSS named colors and approximates perceptual distance via CIE76 ΔE. This is adequate for design work but not for colorimetry or print proofing where CIE2000 is required. Pro tip: export your palette as CSS variables early in a project and import the file into your design system tokens - retrofitting palette changes across 50+ components is the kind of technical debt that compounds silently.
Formulas
Contrast ratio between two colors is derived from their relative luminance values. The formula follows WCAG 2.1 specification:
Where L1 is the relative luminance of the lighter color and L2 is the relative luminance of the darker color. Relative luminance is computed from linearized sRGB channels:
Each sRGB channel is linearized by the inverse companding function:
Color harmony generation rotates the hue component in HSL space. For a base hue H:
Where θ is the rotation angle specific to the harmony type. CIE76 perceptual color distance for nearest named color matching:
Where L, a, b are coordinates in CIELAB color space.
Reference Data
| Harmony Type | Hue Rotation | Count | Use Case | Visual Character |
|---|---|---|---|---|
| Complementary | 180° | 2 | High contrast CTAs, alerts | Maximum tension, vibrant |
| Analogous | ±30° | 3 | Backgrounds, gradients | Harmonious, serene |
| Triadic | 120° | 3 | Dashboards, infographics | Balanced, colorful |
| Split-Complementary | 150° & 210° | 3 | Web design, UI themes | Contrast with less tension |
| Tetradic (Rectangle) | 60°, 180°, 240° | 4 | Complex illustrations | Rich, needs balance |
| Square | 90° | 4 | Data visualization | Even distribution |
| Monochromatic | 0° (vary S/L) | 5 | Minimalist UI, text hierarchy | Subtle, professional |
| WCAG Level | Min Ratio (Normal Text) | Min Ratio (Large Text) | Applies To |
|---|---|---|---|
| AA | 4.5:1 | 3:1 | Body text, inputs, labels |
| AAA | 7:1 | 4.5:1 | Enhanced accessibility targets |
| Non-text | 3:1 | 3:1 | Icons, borders, focus rings |
| Export Format | Extension | Content Type | Best For |
|---|---|---|---|
| PNG Swatch Strip | .png | Raster image | Presentations, mood boards |
| CSS Custom Properties | .css | Text | Web projects, design systems |
| SCSS Variables | .scss | Text | Sass/SCSS preprocessor projects |
| JSON Tokens | .json | Application/json | Design token pipelines, APIs |
| Tailwind Config | .js | Text | Tailwind CSS theme extension |
| Plain Text List | .txt | Text | Documentation, quick reference |