# lokesh/color-thief

Grab the color palette from an image using just Javascript.  Works in the browser and in Node.

Repository: https://github.com/lokesh/color-thief
Canonical: https://ross.abutalabs.com/products/color-thief
Homepage: https://lokeshdhakar.com/projects/color-thief/
Language: TypeScript
License: MIT
License Family: permissive
Last push: 2026-08-03T06:06:03+00:00

## Health v2 (maintenance only)
Score: 96/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 95, release rhythm 96, longevity 100
- inputs: {"age_days": 5419, "days_push": 30, "days_rel": 31, "gap_med": 0, "n_releases_24m": 12}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 13615, forks 1313 (observed 2026-08-28T04:11:03.659467+00:00)

## What it is
Color Thief is a TypeScript library that extracts dominant colors and palettes from images and video in the browser and Node.js, with a small CLI included. It offers perceptual OKLCH quantization, semantic swatches, WCAG contrast helpers, and reactive palette updates via an observe() API.

## Use cases
- extract dominant color from an image in javascript
- generate a color palette from a photo
- get vibrant and muted swatches from an image
- dynamically theme a page based on an image's colors
- extract palettes from video frames reactively
- check text contrast against an image's dominant color
- get a color palette from an image in node.js

## When to choose
- you need dominant colors or palettes from images in browser or Node with zero dependencies
- you want perceptually uniform palettes (OKLCH) or semantic swatches like Vibrant/Muted
- you need WCAG contrast ratios and text color recommendations from extracted colors
- you want live palette updates from video or canvas elements

## When to avoid
- you need full image editing or manipulation, not just color extraction
- you work outside JavaScript/TypeScript ecosystems
- you need server-side processing of very large image batches where a native tool would be faster

## Facets
- artifact type: library
- maturity: active
- function: image-processing, data-visualization
- domain: image-processing, frontend, web-development, graphics
- platform: browser, cli, cross-platform
- tags: color-palette, color-extraction, typescript, oklch, dominant-color, zero-dependencies, wcag-contrast, nodejs

## Member repositories
- lokesh/color-thief (main) score 96

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:11:03.659467+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T17:13:09.506046+00:00, confidence not recorded.
  - readme: https://github.com/lokesh/color-thief (fetched 2026-08-28T04:11:03.659467+00:00, sha b2d82fa56ef6)
  - homepage: https://lokeshdhakar.com/projects/color-thief/ (fetched 2026-08-29T08:08:06.372316+00:00, sha 161f16c3ce01)
- Data as of 2026-08-30T08:39:29.467469+00:00.
