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

colorise

v1.0.5

Published

A small JavaScript library for color manipulation.

Downloads

5

Readme

colorise.js

A small JavaScript library for color manipulation. Inspired by color.js but I'm aiming to write simplified and robust source code with some different functionalities.

Installation in npm

npm i colorise --save

Usage

const colorise = require('colorise');

// create instance of class
let c = new colorise();

// use different functions 
let result = c.getColorName('#7cb9e8'); 
console.log(result); // 'Aero'

|Function Name|Description|Parameters|returns| |---|---|---|---| | getColorName(colorCode) |function to get name of color from hex-color-code. |hex-color-code : string |color : string | |getColorCode(colorName) |function to get hexadecimal color code from color name |color : string |hex-color-code : string | |rgbPercentage(r,g,b) |function to calculate r,g,b percentage in color |r : number,g : number,b : number |returns array | | hexToRgb(hexCode) |function to get r,g,b values from hexCode |r : number,g : number,b : number | returns array | |rgbToCMYK(r,g,b) | function to get cyan, magneta, yellow, black values from r,g,b values |r : number,g : number,b : number |return array | | rgbToHsl(r,g,b) | function to get hue, saturation and lightness from r,g,b values |r : number,g : number, b : number |returns object | | rgbToHwb(r,g,b) |function to get hue, whiteness and blackness values from r,g,b |r : number, g : number, b : number | returns object| | whitenColor(r,g,b,ratio),darkenColor(r,g,b,ratio), lightenColor(r,g,b,ratio),blackenColor(r,g,b,ratio) |these functions perform whitening, darkening, lightning and blackening r,g,b color as per given ratio |r : number, g : number, b : number, ratio : number < 0 | returns array/object | |negateColor(r,g,b) |function takes negation of color |r : number,g : number,b : number|returns array | |hslToRgb(h,s,l) |function to get r,g,b color from h,s,l values |0<=hue<=360,0<=s<=100, 0<=l<=100|returns array | |rgbToHex(r,g,b) |function to get hex-color-code from rgb|r : number,g : number,b : number |returns string |

Disclaimer

This code is originally written and no part can be copied/used/modified/changed/improved without permission of author. The code is licensed under MIT License Copyright (C) 2020.

For writing some conversion functions the functions are learned from 'https://www.rapidtables.com/' The color-data used in code is provided by Jonathan Neal on his github which is obvious, how can anyone know all these color codes and their names XD. All right.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change. If anyone finds that something in code need to changed/improved/modified please drop mail.

Please make sure to update tests as appropriate.

License

MIT

Recent Updates

  • Feb 2020 : Raw functions are created. The code is very much raw and library is currently under development.
  • March 2020 : Required changes done. small code is published.

Dependancies

  • No external dependancies till date.