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

@jonnytizz/simple-color-lib

v0.1.0

Published

Simple, 0 dependency, color manipulation library, meant for learning and probably not production 😅

Readme

Simple Color Lib 🎨

This is a real simple colour util package. It's an excuse to have a play with things that I would normally rely on a library for.

So, why?

I first built this within another project, where I wanted easy colour shifting for highlights and shadows in my UI but was trying to avoid just npm installing my way out of a problem. It turned out to be a pretty fun excursion down colour theory and maths even though I settled on a simple and lossy approach. When I came to another project and found myself wanting the same functionality, I decided to make this a little reusable library for myself.

If you're reading this looking for something to use in your project or app, I'd recommend a quick search on NPM for something like color.

Usage

Install

npm install @jonnytizz/simple-color-lib

Import

import { shiftHexColor } from '@jonnytizz/simple-color-lib';

Note: this package is ESM-only right now.

Hex manipulation

Use shiftHexColor(hexColor: string, shift: number): string to lighten (positive shift) or darken (negative shift) a hex colour.

It splits hexColor into RGB channels and adjusts each by the provided shift value, before returning the adjusted hex string. It clamps the channels between 0 and 255.

shiftHexColor('#942ccc', -10); // '#8a22c2'

shiftHexColor('#abc', 10); // '#b4c5d6' - Short hex expanded to 6 char code

shiftHexColor('#942ccc34', 10); // '#9e36d634' - alpha value is unchanged

shiftHexColor('nope', 10); // 'nope' - invalid hex is returned unchanged

It's worth noting:

  • 3 or 4 character hex strings will be expanded to their 6 or 8 version counterparts.
  • Alpha channels are unshifted.
  • Invalid hex input is returned unchanged.
  • ⚠️ This is only good for simple shifts or where colour accuracy doesn't matter. Shifting all colour channels by the same amount doesn't match how humans perceive lightness and colour.

Development

  • Install dependencies:
npm install
  • Run the unit tests:
npm run test
  • Build the library:
npm run build
  • Publish the library
npm publish --access public