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

color-schemes-js

v0.1.2

Published

Pre-defined color schemes and color evaluation tools, inspired by Julia's ColorSchemes.jl, in TypeScript.

Readme

color-schemes-js

npm version license

Pre-defined color schemes and continuous color evaluation tools for TypeScript and JavaScript, inspired by Julia's ColorSchemes.jl.

Features

  • 🎨 Hundreds of Palettes: Scientific colormaps (Matplotlib, ColorCET, cmocean, cmasher), popular UI themes (Catppuccin, Nord, Ghibli, Wes Anderson), Seaborn, ColorBrewer, and more.
  • 📐 Continuous Evaluation: Sample colors smooth across $[0, 1]$ or map matrix data using 'clamp', 'extrema', or 'centered' scaling.
  • 🔄 Resampling & Inversion: Extract sub-palettes, invert color order, or discretize continuous schemes into discrete steps.
  • 📦 Zero Dependencies: Lightweight ESM and CommonJS library written in TypeScript with full type safety.

Installation

npm install color-schemes-js

Quick Start

1. Sampling Colors

import { viridis, nord, get } from 'color-schemes-js';

// Sample a color at t = 0.5 (midpoint)
const color = viridis.get(0.5);

console.log(color.toHex()); // "#21918c"
console.log(color.toCss()); // "rgb(33, 145, 140)"
console.log(color.toRgb255()); // { r: 33, g: 145, b: 140, a: 1 }

// Alternative functional syntax
const nordColor = get(nord, 0.25);

2. Mapping Data Arrays

import { viridis } from 'color-schemes-js';

const elevationData = [
  [10, 45, 89],
  [34, 67, 100],
];

// Scale colors across min..max range of data ('extrema')
const colors = viridis.getArray(elevationData, 'extrema');

3. Finding & Loading Schemes

import { findColorScheme, loadColorScheme } from 'color-schemes-js';

// Search catalog by query string
const matches = findColorScheme('catppuccin');

// Load scheme by exact name
const magma = loadColorScheme('magma');

4. Custom Schemes & Transformations

import { ColorScheme, rgb } from 'color-schemes-js';

// Create a custom scheme
const myScheme = new ColorScheme(
  [rgb(1, 0, 0), rgb(0, 1, 0), rgb(0, 0, 1)],
  'custom',
  'Primary RGB Palette'
);

// Invert color scheme
const inverted = myScheme.getInverse();

// Resample continuous scheme into N discrete colors
const palette10 = myScheme.resample(10);

Acknowledgements

This project is a JavaScript/TypeScript port of the original Julia library ColorSchemes.jl. We are deeply grateful to all the authors and contributors who created, curated, and maintained these color schemes over the years.

Special thanks to the contributors of ColorSchemes.jl:

@cormullion, @rafaqz, @asinghvi17, @ViralBShah, @gustaphe, @max-de-rooij, @ValentinKaisermayer, @andrew-saydjari, @t-bltg, @daviehh, @stelmo, @lwabeke, @jarredclloyd, @davibarreira, @agchesebro, @tkelman, @tlienart, @tecosaur, @kellertuer, @NHDaly, @maucejo, @adrhill, @guo-yong-zhi, @waldyrious, @timholy, @StefanKarpinski, @sebastiantk, @nealmckee, @musoke, @mortenpi, @Moelf, @mileslucas, @evetion, @hellemo, @kdyrhage, @ranocha, @staticfloat, and @daschw.

For a complete and up-to-date list, visit the ColorSchemes.jl Contributors Graph.

License

MIT — Inspired by ColorSchemes.jl.