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

postcss-helmlab

v0.2.1

Published

PostCSS plugin to use Helmlab color spaces in CSS — helmlab(), helmlch(), helmgen(), helmgenlch() with rgb() fallback plus @supports-wrapped color(display-p3 …) and color(rec2020 …) overrides

Downloads

310

Readme

postcss-helmlab

PostCSS plugin for Helmlab color spaces. Transforms helmlab(), helmlch(), helmgen(), helmgenlch() CSS functions into rgb()/rgba() fallbacks plus color(display-p3 …) and color(rec2020 …) wide-gamut overrides — wrapped in @supports queries so the cascade survives modern CSS minifiers (Lightning CSS, cssnano).

// postcss.config.mjs
import helmlab from 'postcss-helmlab';
export default { plugins: [helmlab({ outputMode: 'all' })] };

| Mode | Output | |-----------|-------------------------------------------------------------------| | srgb | rgb() / rgba() only | | p3 | color(display-p3 …) only | | rec2020 | color(rec2020 …) only | | both | sRGB inline + @supports (color: color(display-p3 …)) block | | all | sRGB inline + P3 @supports + Rec2020 @supports blocks |

both is the default.

Why?

Helmlab is a data-driven color space family trained on 64,000+ human color perception observations. It provides two spaces:

  • MetricSpace — 20% lower STRESS than CIEDE2000 on perceptual distance measurement
  • GenSpace — wins 21-10 vs OKLab on 50 ColorBench metrics for color generation

This plugin lets you use Helmlab color spaces in CSS today, without waiting for browser support.

Installation

npm install postcss-helmlab

Usage

Add postcss-helmlab to your PostCSS config:

// postcss.config.js
module.exports = {
  plugins: [
    require('postcss-helmlab'),
  ],
};

Or with PostCSS API:

const postcss = require('postcss');
const helmlab = require('postcss-helmlab');

const result = await postcss([helmlab]).process(css);

Syntax

Color functions

/* Input */
.card {
  color: helmlab(0.78 0.52 -0.20);
  background: helmgen(0.60 0.22 0.03);
  border-color: helmlch(0.78 0.56 338.7deg);
  outline-color: helmgenlch(0.60 0.15 30deg);
}

/* Output */
.card {
  color: rgb(255, 76, 119);
  background: rgb(196, 107, 68);
  border-color: rgb(255, 67, 131);
  outline-color: rgb(175, 120, 91);
}

Alpha

/* Input */
.overlay { background: helmlab(0.78 0.52 -0.20 / 0.5); }

/* Output */
.overlay { background: rgba(255, 76, 119, 0.5); }

Gradients

Interpolate gradients through Helmlab spaces with perceptually uniform steps:

/* Input */
.gradient {
  background: linear-gradient(in helmgen, #e63946, #457b9d);
}

/* Output — 10 perceptually spaced stops */
.gradient {
  background: linear-gradient(#e63946 0.0%, #c7555e 11.1%, ..., #457b9d 100.0%);
}

Color mixing

/* Input */
.mix { color: color-mix(in helmgen, #e63946 50%, #457b9d); }

/* Output */
.mix { color: rgb(147, 93, 111); }

Supported spaces

| Function | Space | Best for | |----------|-------|----------| | helmlab(L a b) | MetricSpace | Perceptual distance, accessibility | | helmlch(L C h) | MetricSpace (cylindrical) | Hue-based selection | | helmgen(L a b) | GenSpace | Gradients, palettes | | helmgenlch(L C h) | GenSpace (cylindrical) | Hue-based generation |

Links

License

MIT