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

oklch-kit

v0.0.2

Published

Practical OKLCH color utilities for interfaces and visual systems.

Readme

OKLCH Kit

Practical OKLCH utilities for interfaces and visual systems.

TypeScript Module Status

colormix.dev

Blend two colours by averaging their sRGB channels and the midpoint comes out darker and duller than either end — blue to orange passes through grey. sRGB channel values are display voltages, not perceived colour, so the arithmetic mean of two of them is not the colour halfway between. OKLCH is perceptually uniform, so it is.

This is a small dependency-free set of helpers for doing that: convert into OKLCH, mix there, convert back.

Usage

import { mixOklch, oklchFromRgb, oklchToRgb } from "oklch-kit";

const blue = oklchFromRgb({ r: 0, g: 82, b: 255 });
const orange = oklchFromRgb({ r: 255, g: 150, b: 0 });

oklchToRgb(mixOklch(blue, orange, 0.5));
// { r: 226, g: 70, b: 177 } — a saturated magenta, not the grey sRGB gives you

API

| Export | Purpose | | --- | --- | | formatOklch(color) | OklchColor to a CSS oklch(L C H) string. | | parseOklch(value) | A CSS oklch() string to OklchColor. % lightness is normalised to 0–1. | | mixHue(from, to, progress) | Interpolates hue the short way around the wheel. | | mixOklch(from, to, progress) | Blends two OklchColors. progress is not clamped, so easing may overshoot. | | oklchFromRgb(rgb) | sRGB { r, g, b } (0–255) to OklchColor. | | oklchToRgb(color) | OklchColor back to sRGB, clipped per channel to the display gamut. |

OklchColor is { lightness, chroma, hue } — lightness 0–1, chroma from 0, hue in degrees. Conversions follow Björn Ottosson's OKLab reference and are tested against its published values.

Development

npm run build --workspace=oklch-kit
npm test --workspace=oklch-kit

MIT.