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

chromametry

v0.1.0

Published

Web-accessible Color Palette Metrics

Readme

Chromametry

A metrics framework for evaluating web-accessible sequential color palettes.

Web-accessible Palette Ranking Figure 1. Web-accessible Palette Ranking

Metric Definitions

  1. Contrast Efficiency: Measures how efficiently contrast space is used to achieve WCAG 4.5:1 contrast.
  2. Lightness Linearity: Evaluates the linearity of lightness (with Helmholtz–Kohlrausch correction).
  3. Chroma Smoothness: Checks for artifacts and kinks in the saturation curve using Monotone Cubic Splines.
  4. Hue Stability: Quantifies hue shift/drift across the lightness ramp.
  5. Spacing Uniformity: Measures the consistency of color spacing (DeltaE 2000).

Read full Methodology

All lightness, chroma, hue, and DeltaE2000 computations are performed in the CIELAB color space.

Benchmark Rankings

Comparison of popular design systems based on Chromametry metrics.

| Rank | Design System | Steps | Span (K) | Contrast Efficiency | Lightness Linearity | Chroma Smoothness | Hue Stability | Spacing Uniformity | SCORE | | :---: | :------------------------- | :---: | :--------: | :-----------------: | :-----------------: | :---------------: | :-----------: | :----------------: | :-------: | | 🥇 | IBM Carbon | 12 | 6 | 0.906 | 0.932 | 0.864 | 0.930 | 0.794 | 88.36 | | 🥈 | Adobe Spectrum | 18 | 9 | 0.929 | 0.935 | 0.871 | 0.917 | 0.775 | 88.33 | | 🥉 | U.S. Web Design System | 12 | 6 | 0.906 | 0.936 | 0.805 | 0.942 | 0.801 | 87.58 | | 4 | Salesforce Lightning 2 | 14 | 7 | 0.916 | 0.921 | 0.839 | 0.938 | 0.712 | 86.06 | | 5 | GitHub Primer Brand | 12 | 6 | 0.906 | 0.926 | 0.838 | 0.946 | 0.685 | 85.43 | | 6 | Atlassian | 14 | 8 | 0.785 | 0.897 | 0.914 | 0.950 | 0.714 | 84.72 | | 7 | Tailwind CSS | 13 | 8 | 0.774 | 0.873 | 0.849 | 0.918 | 0.677 | 81.37 | | 8 | Ant Design | 12 | 9 | 0.698 | 0.860 | 0.861 | 0.913 | 0.656 | 79.08 | | 9 | Material UI | 12 | 11 | 0.554 | 0.797 | 0.773 | 0.931 | 0.550 | 70.56 | | 10 | Radix UI | 13 | 10 | 0.533 | 0.800 | 0.745 | 0.947 | 0.520 | 68.98 | | 11 | Shopify Polaris | 17 | 15 | 0.349 | 0.730 | 0.642 | 0.920 | 0.467 | 58.78 |

Table 1. Benchmark ranking of design systems evaluated using Chromametry metrics.

Note: Design systems like Bootstrap,Google Material 3, Apple Human Interface or Fluent UI are excluded as they define discrete semantic tokens rather than algorithmic sequential ramps.

Overall Score is computed as the weighted mean of the five normalized metrics, using equal weights by default.

Example: A Typical Report

IBM Carbon Color Palette Figure 2. IBM Carbon Color Palette.

IBM Carbon Palette Metrics Figure 3. IBM Carbon Palette Metrics.

IBM Carbon Palette Charts Figure 4. IBM Carbon Palette Charts.

Benchmark result page

  • Online Report : Benchmark page
  • Local /benchmarks/monochromatic/output/index.html (double click)

Analyze Palettes

Installation

NPM Package:

npm install chromametry

CDN (Browser) ESM:

<script type="module">
  import { analyzeMonochromaticPalette } from 'https://esm.sh/chromametry';
</script>
  const result = Chromametry.analyzeMonochromaticPalette({ ... });
</script>

CDN (Browser) Global:

<script src="https://unpkg.com/chromametry/dist/index.global.js"></script>
<script>
  const result = Chromametry.analyzeMonochromaticPalette({ ... });
</script>

Usage

import { analyzeMonochromaticPalette } from 'chromametry';

// 1. Define your colors (must include white/black anchors for accurate scoring)
const colors = {
  yellow: ["#ffffff","#fcf4d6","#fddc69","#f1c21b","#d2a106","#b28600","#8e6a00","#684e00","#483700","#302400","#1c1500","#000000"],
  orange: ["#ffffff","#fff2e8","#ffd9be","#ffb784","#ff832b","#eb6200","#ba4e00","#8a3800","#5e2900","#3e1a00","#231000","#000000"]
};

// 2. Define step names corresponding to the array length
const stepNames = [0, 100, 200, 300, 400, 500, 600, 700, 800, 900, 950,1000];

// 3. Run analysis
const result = analyzeMonochromaticPalette({
    name: "My Custom Brand",
    stepNames: stepNames,
    colors: colors
});

console.log(result.metrics); 
console.log(`System Score: ${result.score}`);

Reproducing Benchmarks

To run the benchmark generator locally:

git clone https://github.com/chromametry/chromametry.git
cd chromametry
npm install
npm run generate

Adding Custom Palettes to Benchmark

Create a new .ts file in benchmarks/monochromatic/input/ (e.g., my-palette.ts).

import { MonochromaticPaletteData } from "../../../src/index.js";
import { red, volcano, gold } from '@ant-design/colors';

// Define colors (imported or inline object)
let colors: Record<string, string[]> = { red, volcano, gold };

// Ensure white/black anchors exist if your ramp misses them
for (let name in colors) {
    if (colors[name][0] !== "#ffffff") colors[name].unshift("#ffffff");
    if (colors[name][colors[name].length - 1] !== "#000000") colors[name].push("#000000");
}

const stepNames = Object.keys(Object.values(colors)[0]);

const palette: MonochromaticPaletteData = {
    name: "Ant Design",
    stepNames, // string[]
    colors     // Record<string, string[]> 
};

export default palette;

Then regenerate the report:

npm run generate

Input Requirements

  • Equal Steps: All color ramps must have the same number of steps.

  • Format: Colors must be Hex strings.

  • Monotonicity: Lightness must strictly increase or decrease (sorted).

  • Anchors: Start/End colors should ideally be Black and White.