# 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.

URL: https://thuyavan.netlify.app/projects/logo-color-previewer
Updated: 2026-10-12

- Period: 2026-04
- Technologies: Next.js, React, TypeScript, Tailwind CSS

## 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).

## 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.
