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 🙏

© 2024 – Pkg Stats / Ryan Hefner

colorshop

v0.0.1

Published

ColorShop is used to manage and manipulate colors.

Downloads

4

Readme

ColorShop is used to manage and manipulate colors.

Usage

ColorShop can be used with node or a web browser. Usage of each are slightly different from one another.

Node

With node require is used to include ColorShop like this:

const { color } = require('colorshop')
let red = color.red

Web Browser

With a web browser the script tag is used to include ColorShop.

When using a web browser, all calls are contained within the colorshop namespace and can be called like this:

<script src="/js/colorshop.min.js"></script>
<script>
  let red = colorshop.color.red
</script>

Color

Manage, manipulate and export a single color. Adjust the color's lightness, darkness, hue, saturation and more.

Contains 141 preset colors

Create a color

// Create from a preset
let red   = color.red

// Create from a hex color
let white = color.hex('#ffffff')

// Create from an rgb color
let blue      = color.rgb(0, 0, 255)
let blueAlpha = color.rgb(0, 0, 255, 0.5)

// Create from an hsl color
let yellow      = color.hsl(50, 100, 100)
let yellowAlpha = color.hsl(50, 100, 100, 0.25)

Manipulate a color

// Create a starting color
let red = color.red
// Invert the color and adjust the hue 90 degrees
let purple = red.invert().adjustHue(90)
console.log(purple.toHex()) // #7f00ff

Gradient

Creates a gradient that can be looped over.

// Creates a grayscale gradient (black-white)
let gradient = gradient.grayscale()
// Get the color at the halfway mark (a gray)
let color = gradient.evaluate(0.5)
// Write the hex color to the console
console.log(color.toHex())

Blender

Blend two colors together using one of 25 different blends.

// Create the first color
let color1 = color.red
// Create the second color
let color2 = color.blue
// Blend the two colors
let color3 = blender.screen(color1, color2)
// Log the results
console.log(
  color1.toHex(),
  color2.toHex(),
  color3.toHex()
)
  • normal
  • lighten
  • darken
  • multiply
  • average
  • add
  • subtract
  • difference
  • negation
  • screen
  • exclusion
  • overlay
  • softLight
  • hardLight
  • colorDodge
  • colorBurn
  • linearDodge
  • linearBurn
  • linearLight
  • vividLight
  • pinLight
  • hardMix
  • reflect
  • glow
  • phoenix