README
@chiarapassaro/color-palettes-range
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.0
Install
$ npm init
$ npm install @chiarapassaro/color-palettes-range
Usage
var ColorPalettesRange = require("@chiarapassaro/color-palettes-range/src/js");
Functionality
var baseColor = new ColorPalettesRange.Hsl(
{
hue,
saturation,
brightness
}
);
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
var palettes = new ColorPalettesRange.SetColorPalette(baseColor)
Base Color [obj Hsl]
Methods:
Base Color
palettes.getBasecolor() -> obj Hsl()
updateColorPalette(newColor)
palettes.triad()
Return:
Array [obj Hsl(), obj Hsl(), ...]
Get palettes Triadic
palettes.getTriad()
Return:
Array [obj Hsl(), obj Hsl(), ...]
palettes.complementar(
{
numColor,
stepDegree
}
);
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(), ...]
palettes.splitComplementar()
Return:
Array [obj Hsl(), obj Hsl()]
Get palettes Split complementary colors
palettes.splitComplementar()
Return:
Array [obj Hsl(), obj Hsl(), ...]
palettes.analogous(
{
typeScheme,
numColor,
stepDegree
}
);
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(), ...]
palettes.tetradic()
Return:
Array [obj Hsl(), obj Hsl()]
Get Tradic Colors
palettes.getTetradic()
Return:
Array [obj Hsl(), obj Hsl(), ...]
palettes.square()
Return:
Array [obj Hsl(), obj Hsl()]
Get Square colors
palettes.getSquare()
Return:
Array [obj Hsl(), obj Hsl(), ...]
palettes.mono (
{
numColor,
stepDegree,
typeScheme
}
)'
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
}
);
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(), ...]
Conversion Utilities
var color = new ColorPalettesRange.HslConvert(
{
hue,
saturation,
brightness
}
)
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)
var color = new ColorPalettesRange.RgbConvert(
{
red,
green,
blue
}
);
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)
var color = new ColorPalettesRange.HexConvert(#RRGGBB)
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
var color = new ColorPalettesRange.Rgb(
{
red,
green,
blue
}
);
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)
var color = new ColorPalettesRange.Hex(#RRGGBB)
#RRGGBB
Methods:
color.printHex() -> string #RRGGBB
color.setHex(#RRGGBB)