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

radient

v0.0.4

Published

Gradient creation and manipulation library

Readme

radient

Radient makes it easy to take a series of colors and extrapolate information it, whether it be an evenly spaced array of colors, or a color at a specific point. Radient uses Color classes to represent gradient stops.

Install

$ npm install radient

Usage

Passing an Array of colors will generate a gradient with evenly spaced stops (i.e. a three color gradient will have a stop a 0, 50% and 100%)

var gradient = Radient("#00ffff", #ff00ff, #ffff00);

Radient uses the color library to represent colors, so all color representations will work

var gradient = Radient(
  "rgb(225, 241, 101)",
  Color().hsl([56, 60, 88]),
  Color("25b34b"),
  {c: 100, y: 100, m: 0, k: 0}
);

Alternatively, color stops can be set one at a time

var gradient = Radient();
gradient.stop("#ffb90d");
gradient.stop("#cc0045");
gradient.stop("#009980");

Gradients are 1 unit long, so gradient stops should be between 0 and 1

var gradient = Radient();
gradient.stop("#6abfeb", 0);
gradient.stop("#b9d3c3", 0.25);
gradient.stop("#f7e998", 0.5);
gradient.stop("#f4bcac", 0.75);
gradient.stop("#f495b3", 1);

Gradients can also be loaded from a JSON object

var arr = [
  {
    color: "rgb(255, 255, 255)",
    location: 0.5
  },
  {
    color: "#2989cc",
    location: 0
  },
  {
    color: Color("white"),
    location: 1
  },
  {
    color: Color().rgb(144, 106, 0),
    location: 0.52
  },
  {
    color: Color().cymk([16, 37, 100, 1]),
    location: 0.64
  }
];

var gradient = Radient(arr);

Colors

To retrieve information from Radient, you can get a color object from any stop along the gradient.

var gradient = Radient("black", "white");
gradient.color(0.5).rgb(); // {r: 128, g: 128, b: 128}

You can also get a color 'angle' in degrees

gradient.angle(180);

Arrays

You can also get an array of evenly spaced color stops. The default number of stops is 8. Note that this function may result in a loss of precision in your gradient.

var gradient = Radient("#7e11a7", "#55ed20");
gradient.array(5);

/* [
  '#7e11a7',
  '#763d8b',
  '#697f63',
  '#5dc13b',
  '#55ed20'
] */