Mashdun
AI GrowthWorkCapabilitiesIntegrationsProcessLabsMarketplaceBlogAbout
Get in Touch
Mashdun

Full-stack web developer, AI engineer & growth marketer. Building production-grade apps and intelligent solutions.

Navigation

  • Portfolio
  • Capabilities
  • Process
  • Labs
  • About

Resources

  • Blog / Notes
  • Marketplace
  • Contact
  • RSS Feed

Legal

  • Terms of Service
  • Privacy Policy
  • Cookie Policy
  • Do Not Sell or Share
  • Delete my data

© 2026 Mashdun. All rights reserved.

Built with Next.js, Tailwind CSS & Prisma

    All Labs
    Tooling
    On-device
    WCAG contrast
    Tailwind tokens
    No upload

    Color Palette Extractor

    Fully on-device: the image is decoded to a canvas, pixels are quantized into RGB buckets and ranked by coverage, then each dominant color is matched to its nearest Tailwind token and scored for WCAG 2.1 contrast against white and black. Nothing is uploaded, and the AA verdicts are computed rather than eyeballed.

    Color Palette Extractor

    On-device
    WCAG contrast
    Tailwind tokens
    No upload

    How it works

    1. Drop in an image — it's decoded and drawn to a canvas in your browser
    2. Every pixel is split into an accent or a neutral by saturation and lightness
    3. Accents are clustered by hue, so a glossy gradient reads as one color instead of forty
    4. Accents and neutrals are ranked separately, with most of the palette reserved for accents
    5. Each color is matched to its nearest Tailwind token, with WCAG 2.1 contrast against white and black

    Why frequency ranking doesn't work

    The first version of this ranked colors by pixel count, which is the obvious approach and is wrong in a way that only shows up on real images. Feed it a product shot on white — the most common thing anyone tries — and you get white, four greys, and black, while the brand color that made the image worth sampling never appears. Two effects stack: the background owns most of the frame, and the accent is split across dozens of quantization buckets because every highlight and shadow of a glossy surface lands in a different one. An orange covering a tenth of the image loses to a grey covering a fiftieth. Clustering accents by hue re-unites the gradient, and ranking them apart from neutrals stops the background competing for slots it was never a candidate for. The contrast column is still the half that saves you money — brand palettes handed over in a style guide routinely fail AA for body text, and nobody notices until the audit.

    Check a page's performance