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

@chiarapassaro/color-palettes-range

v2.0.4

Published

Now you can generate more than three or five colors palette: take a Complementary Palette or a Random Dominant Palette, and you can decide how many colors you want!

Downloads

60

Readme

@chiarapassaro/color-palettes-range

Color Palette

Are you bored with classic color palettes?

Now you can generate more than three or five colors palette: take a Complementary Palette or a Random Dominant Palette, and you can decide how many colors you want!

V2.0.4

Update

Added Gradient from BaseColor to EndColor

##Install

$ npm init
$ npm install @chiarapassaro/color-palettes-range

##Usage

var ColorPalettesRange = require("@chiarapassaro/color-palettes-range/src/js");

Functionality

Create Hsl color:

var baseColor = new ColorPalettesRange.Hsl(
    {
        hue, 
        saturation, 
        brightness
    }
);
Props:

Hue degree (1-360) Saturation (1-100) Brightness (1-100)

Methods:
baseColor.getHue() -> number
baseColor.getSaturation() -> number
baseColor.getBrightness() -> number
baseColor.setHue(number)
baseColor.setSaturation(number)
baseColor.setBrightness(number)
baseColor.printHsl() -> string hsl(hue, saturation% , brightness%)
baseColor.printRgb() -> string rgb(value, value , value)
baseColor.printHex() -> string #RRGGBB

Create palettes:

var palettes = new ColorPalettesRange.SetColorPalette(baseColor)
Arguments:

Base Color [obj Hsl]

Methods:

Base Color

palettes.getBasecolor() -> obj Hsl()
updateColorPalette(newColor)

Triadic:

Create Triadic scheme:

palettes.triad()
Return:
Array [obj Hsl(), obj Hsl(), ...]

Get palettes Triadic

palettes.getTriad()
Return:
Array [obj Hsl(), obj Hsl(), ...]

Create Complementary palettes:

palettes.complementar(
    {
        numColor, 
        stepDegree
    }
);
Props:

Color number - even Step degree between colors Max degree numColor*step = 140

Return:
Array [obj Hsl(), obj Hsl(), ...]

Get palettes complementary colors

palettes.getComplementar()
Return:
Array [obj Hsl(), obj Hsl(), ...]

Create Split complementary palettes:

palettes.splitComplementar()
Return:
Array [obj Hsl(), obj Hsl()]

Get palettes Split complementary colors

palettes.splitComplementar()
Return:
Array [obj Hsl(), obj Hsl(), ...]

Create Analogous palettes:

palettes.analogous(
    {
        typeScheme, 
        numColor, 
        stepDegree
    }
);
Props:

Scheme Type: 'allArch', 'cold', 'warm' Colors number - even Step degree between colors Max degree numColor*step = 60

Return:
Array [obj Hsl(), obj Hsl(), ...]

Get analogous colors

palettes.getAnalogous()
Return:
Array [obj Hsl(), obj Hsl(), ...]

Create tetradic palettes:

palettes.tetradic()
Return:
Array [obj Hsl(), obj Hsl()]

Get Tradic Colors

palettes.getTetradic()
Return:
Array [obj Hsl(), obj Hsl(), ...]

Create Square palettes:

palettes.square()
Return:
Array [obj Hsl(), obj Hsl()]

Get Square colors

palettes.getSquare()
Return:
Array [obj Hsl(), obj Hsl(), ...]

Create Monochrome palettes:

palettes.mono (
    {
        numColor, 
        stepDegree, 
        typeScheme
    }
)'
Props:

Colors number - even Step degree between colors Max degree numColor*step = 100 Scheme type = saturation / brightness

Return:
Array [obj Hsl(), obj Hsl()]

Get Monochrome colors

palettes.getMono()
Return:
Array [obj Hsl(), obj Hsl(), ...]

Create Random with Dominat Color palettes

palettes.randomDominant(
    {
        numColor, 
        percDominant
    }
);
Props:

Colors number - even (1-360) Color Dominant Percentage (1-100)

Return:
Array [obj Hsl(), obj Hsl()]

Get Random Dominant colors

palettes.getRandomDominant()
Return:
Array [obj Hsl(), obj Hsl(), ...]

Create Gradient Palette

palette.gradient({ numColors, endColor })
Props:

Colors number (1-100) EndColor obj Hsl()

Return:
Array [obj Hsl(), obj Hsl()]

Get Gradient Palette

palettes.getGradient()
Return:
Array [obj Hsl(), obj Hsl(), ...]

Conversion Utilities

Convert Hsl color:

var color = new ColorPalettesRange.HslConvert(
    {
        hue, 
        saturation, 
        brightness
    }
)
Props:

hue (1-360) saturation (1-100) brightness (1-100)

Methods:
color.getRgb() -> [Obj] new Rgb(r, g, b)
color.getRed() -> number
color.getGreen() -> number
color.getBlue() -> number
color.getHex() -> [Obj] new Hex(#RRGGBB)

Convert Rgb color:

var color = new ColorPalettesRange.RgbConvert(
    {
        red, 
        green,
        blue
    }
);
Props:

red (1-255) green (1-255) blue (1-255)

Methods:
color.getHsl() -> [Obj] new Hsl({hue, saturation, brightness})
color.getHue() -> number
color.getSaturation() -> number
color.getBrightness() -> number
color.getHex() -> [Obj] new Hex(#RRGGBB)

Convert Hex color:

var color = new ColorPalettesRange.HexConvert(#RRGGBB)
Arguments:

hex (#RRGGBB)

Methods:
color.getRgb() -> [Obj] new Rgb(r, g, b)
color.getRed() -> number
color.getGreen() -> number
color.getBlue() -> number
color.getHsl() -> [Obj] new Hsl({hue, saturation, brightness})
color.getHue() -> number
color.getSaturation() -> number
color.getBrightness() -> number

Create Rgb color:

var color = new ColorPalettesRange.Rgb(
    {
        red, 
        green, 
        blue
    }
);
Props:

Red (1-255) Green (1-255) Blue (1-255)

Methods:
color.getRed() -> number
color.getGreen() -> number
color.getBlue() -> number
color.printHsl() -> string rgb(r, g , b)
color.setRed(number)
color.setBlue(number)
color.setGreen(number)

Create Hex color:

var color = new ColorPalettesRange.Hex(#RRGGBB)
Arguments:

#RRGGBB

Methods:
color.printHex() -> string #RRGGBB
color.setHex(#RRGGBB)

#Example with ChartJs Wheels Color Palette