npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

colx

v1.1.1

Published

Scan and visualize Tailwind arbitrary color values with CSS variable consolidation suggestions

Readme

Tailwind Color Visualizer

A CLI tool that scans TypeScript/JSX files for Tailwind arbitrary color values, visualizes them in a coolors.co-style web UI, and provides suggestions for CSS variable consolidation and color merging opportunities.

Features

  • 🔍 Scan .tsx and .jsx files for Tailwind arbitrary color values
  • 🎨 Visualize colors in a beautiful web interface (similar to coolors.co)
  • 💡 Suggest CSS variable consolidation for duplicate colors
  • 🔬 Detect similar colors and suggest merges using Delta E color difference
  • 📊 Statistics about color usage across your codebase

Installation

npm install -g colx

Or use with npx (no installation required):

npx colx [directory]

Usage

Basic Usage

Scan the current directory:

colx

Or specify a directory:

colx ./src

Options

  • --port <number> - Server port (default: 6969)
  • --no-open - Don't open browser automatically
  • --threshold <number> - Color similarity threshold for merge suggestions (default: 5)

Examples

# Scan a specific directory
colx ./my-project/src

# Use a custom port
colx --port 8080

# Don't open browser automatically
colx --no-open

# Adjust similarity threshold (lower = more strict)
colx --threshold 3

Supported Color Formats

The tool detects Tailwind arbitrary values in the following formats:

  • Hex: bg-[#ff5733], text-[#ABC]
  • RGB: bg-[rgb(255,87,51)]
  • RGBA: bg-[rgba(255,87,51,0.5)]
  • HSL: bg-[hsl(9,100%,50%)]
  • HSLA: bg-[hsla(9,100%,50%,0.5)]

What It Does

  1. Scans your codebase for .tsx and .jsx files
  2. Extracts all Tailwind arbitrary color values
  3. Normalizes colors to hex format for comparison
  4. Analyzes color similarities using Delta E (CIEDE2000)
  5. Suggests CSS variable consolidation for duplicate colors
  6. Suggests color merges for visually similar colors
  7. Displays everything in a beautiful web interface

Output

The tool launches a web server and opens your browser to display:

  • Color Palette: Grid view of all unique colors found
  • Color Details: Click any color to see where it's used
  • Filter by Utility Class: Filter colors by bg, text, border, etc.
  • Merge Suggestions: Groups of similar colors that could be merged

Development

# Install dependencies
npm install

# Build TypeScript
npm run build

# Run in development mode (with Bun)
bun run src/index.ts

# Or with Node.js
npm run dev

Requirements

  • Node.js >= 16 (or Bun)
  • TypeScript projects with .tsx or .jsx files