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

nidea-colors

v1.0.1

Published

A great package to mix colors and get funny!

Readme

🎨 nidea-colors

A tool written in TypeScript for generating, manipulating, and serializing color palettes. Ideal for creative projects that require control and randomness over color composition.

🚀 Installation

npm install nidea-colors

🗖️ Features

  • Create colors from RGB(A) or hexadecimal values.
  • Generate random colors.
  • Serialize and deserialize palettes.
  • Edit palettes: add or remove colors.
  • Built-in validations to avoid common mistakes.
  • Support for different palette types: monochromatic, analogous, complementary, etc.

🔧 Basic Usage

Create a color manually

import { Color } from "nidea-colors";

const red = new Color({ red: 255, green: 0, blue: 0 });
console.log(red.hexColor); // ff0000

Create a color from a hexadecimal value

const blue = Color.fromHexColor("0000ff");

Generate a random color

const randomColor = Color.generateRandomColor();

Create a palette

import { Palette } from "nidea-colors";

const palette = new Palette([red, blue]);
console.log(palette.toString()); // JSON with colors in hexadecimal

Add or remove colors

palette.addColor(randomColor);
palette.removeColor(red);

Clone a palette

const copy = palette.clone();

🧪 Palette Generator

You can use PaletteFactory to automatically generate custom palettes:

import { PaletteFactory, PaletteType } from "nidea-colors";

const factory = new PaletteFactory();

const generator = factory.getPaletteGenerator();

const palette = generator({
  paletteType: PaletteType.MONOCHROMATIC,
  lockedColors: [],
  colorsQuantity: 4,
  baseColor: Color.fromHexColor("3498db"),
});

✏️ Edit palettes

import { PaletteFactory, PaletteEditType } from "nidea-colors";

PaletteFactory.editPalette({
  type: PaletteEditType.ADD_COLOR,
  palette,
  baseColor: newColor,
});

📚 Supported palette types

  • RANDOM
  • MONOCHROMATIC
  • ANALOGOUS
  • COMPLEMENTARY
  • TRIADIC
  • COMPOUND

👀 Real example 🌈

🫵 can see and test the funcionalities 👉here👈.

🛠️ Custom Types

Check out the available types in the types.ts file, such as:

  • PaletteType
  • PaletteEditType
  • PaletteEditionOptions
  • generatePaletteOptions

⚠️ Validations

This library includes built-in validations for:

  • Invalid hexadecimal colors.
  • Invalid number of colors in the palette.
  • Missing or incorrect parameters during generation.

🔧 Known issues

  • This cromatic circle is based on RGB color model, so the colors generated will be different from the ones you can see on traditional color pickers.

    Traditional pickers are based on additive color model, as RYB (🟥​🟨​🟦​), the goal its improve it later.


📄 License

MIT