Skip to content

Repository files navigation

PaletteForge

A minimal web app for identifying the dominant colour in an image. Upload any image file and instantly get its dominant colour displayed by name, with hex, RGB, and OKLCH values ready to copy.

Features

  • Upload a local image file (JPEG, PNG, WebP, GIF, BMP)
  • Identifies the dominant colour using ColorThief
  • Resolves the nearest human-readable colour name from a library of 30,000+ named colours
  • Displays the colour as a full-bleed card with automatic light/dark text contrast
  • One-click copying of hex, RGB, and OKLCH values
  • Uploaded image becomes the full-page background

Tech Stack

Getting Started

Prerequisites

  • Node.js 18+
  • npm

Install dependencies

npm install

Run the dev server

npm run dev

Open http://localhost:5173 in your browser.

Build for production

npm run build

The output is written to dist/.

Preview the production build

npm run preview

Project Structure

src/
├── App.tsx                              # Root component — image processing logic and state
├── main.tsx                             # React entry point
├── global.d.ts                          # Global type declarations
├── components/
│   ├── layout/
│   │   ├── ImageSelectionWindow.tsx     # File upload form
│   │   ├── ImageViewerWindow.tsx        # Dominant colour display card
│   │   └── CopyButton.tsx              # Copy-to-clipboard button with confirmation state
│   └── ui/                              # shadcn/ui primitive components
├── lib/
│   └── utils.ts                         # cn() class merging helper
└── styles/
    └── index.css                        # Global styles and Tailwind theme tokens

Usage

  1. Click Load Image and select an image file from your computer.
  2. The dominant colour is displayed as a full card — name, hex, RGB, and OKLCH values shown.
  3. Click the copy icon next to any value to copy it to the clipboard.
  4. Click Change Image to start over with a new file.

Linting

npm run lint

About

Minimal web app for identifying the dominant colour in an image.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages