Logo Color Previewer: colour variations with a WCAG contrast check
Upload a logo, generate colour variations from curated palettes, check accessibility contrast and export your favourites as one high-resolution ZIP; nothing leaves the browser.
- Period
- Apr 2026
- Technologies
- 4
- Diagrams
- 1
- Reading time
- 1 min
Next.jsReactTypeScriptTailwind CSS
Source & download: Preview a Logo in 100+ Color Palettes and Export a ZIP
Purpose (owner's portfolio text)
“Logo workflows need a separate file for every colour variation and often skip accessibility testing.” The tool is a canvas workspace that parses SVG / PNG logos into editable objects, applies 100+ palettes in one click, checks WCAG contrast live and exports favourites as a high-resolution ZIP, all in the browser.
Build timeline
01-12: create-next-app → dev check → SSR fix (Fabric is browser-only) → full initial UI → error fixes · 01-13: colour apply → canvas size settings → restore resize → preserve layers + undo / redo → export fix → docs.
Stack
Next.js 16.1, React 19.2, Fabric.js 7.1 (canvas objects / layers), chroma-js 3.2 (palette and contrast maths), react-colorful (picker), @dnd-kit core / sortable (drag-reorder layers / objects), Zustand 5 (workspace store with history), JSZip + file-saver (ZIP export), react-dropzone (upload), Zod 4, nanoid, next-themes, sonner, react-intersection-observer, Radix (alert-dialog, dialog, dropdown-menu, label, popover, radio-group, select, slider, slot, switch) + CVA / clsx / tailwind-merge.
Architecture
Routes: / (landing), /dashboard, /sandbox, /settings. Components: canvas/{CanvasWorkspace, LayerList, ObjectList}, palettes/{PaletteLibrary, PaletteCard, PaletteSearch}, preview/{PreviewGrid, PreviewCard}, tools/{ToolsPanel, UploadButton, ExportDialog}, providers/error-handler, ui/* (shadcn-style incl. colour picker, error boundary).
Diagram as text
flowchart LR UP[Drop SVG/PNG] --> PARSE[Fabric: parse into objects/layers] PARSE --> WS[CanvasWorkspace + layer/object lists (dnd-kit)] PAL[Palette library 100+ / search] --> APPLY[apply palette → recolour objects] APPLY --> WS WS --> WCAG[chroma-js contrast vs backgrounds] WS --> GRID[PreviewGrid variations] GRID --> ZIP[ExportDialog → JSZip high-res ZIP] WS <--> HIST[Zustand store: undo / redo, preserved layers]
Algorithm notes
WCAG contrast ratio (L1 + 0.05) / (L2 + 0.05) from relative luminance (chroma-js) against light / dark backgrounds, flagged per AA / AAA thresholds; palettes are mapped to the logo’s distinct fill colours in luminance order.
Related projects
Munz Cake: e-commerce, baking academy and cake configurator
A Medusa v2 headless shop with a custom LMS module for baking courses, and a 2026 Next.js 16 cake catalogue and configurator.
Medusa commerceNext.jsReactTypeScript+3Red Wings Travels: online visa-application platform
A production visa-agency platform: applicant wizard, group applications, three payment gateways and an admin console.
ReactTypeScriptTailwind CSSshadcn / Radix UI+2AI and LLM experiments
Experiments with LLM APIs: a Flask chat over several providers, speech-to-text and model tests, and a React and shadcn debugging sandbox.
PythonFastAPI / FlaskLLM integrationReact+1Want to discuss this project?
Happy to walk through the architecture, trade-offs or the code.