Provides HSV/HSB, HSV, HWB and HSI spaces.
With node previously installed:
npm install @zokugun/lang.color.alvy
Use it with JavaScript
:
require('kaoscript/register');
const { Color, Space } = require('@zokugun/lang.color.alvy')();
const c = new Color('hsl(90, 100%, 50%)');
Use it with kaoscript
:
import '@zokugun/lang.color.alvy'
const c = new Color('hsl(90, 100%, 50%)')
A color is defined in a color space. If you try to access it into another space, the color will be automatically converted into the new space.
hue()
: Numberhue(Number)
: Colorsaturation()
: Numbersaturation(Number)
: Colorlightness()
: Numberlightness(Number)
: Color
hue()
: Numberhue(Number)
: Colorsaturation()
: Numbersaturation(Number)
: Colorintensity()
: Numberintensity(Number)
: Color
hue()
: Numberhue(Number)
: Colorsaturation()
: Numbersaturation(Number)
: Colorbrightness()
: Numberbrightness(Number)
: Color
hue()
: Numberhue(Number)
: Colorwhiteness()
: Numberwhiteness(Number)
: Colorblackness()
: Numberblackness(Number)
: Color
darken(Number)
: Colorlighten(Number)
: Colordesaturate(Number)
: Colorshift(Number)
: Colorunshift(Number)
: Color
hsla?(hue, saturation, lightness, alpha?)
hue: from 0 to 100, no decimal
saturation: from 0 to 100, up to 1 decimal place
lightness: from 0 to 100, up to 1 decimal place
alpha: from 0 to 1, up to 3 decimal places
hsl(60, 100%, 50%)
hsl(100grad, 100%, 50%)
hsl(yellow, 100%, 50%)
hsia?(hue, saturation, intensity, alpha?)
hue: from 0 to 100, no decimal
saturation: from 0 to 100, up to 1 decimal place
intensity: from 0 to 255, no decimal
alpha: from 0 to 1, up to 3 decimal places
hsba?(hue, saturation, brightness, alpha?)
hue: from 0 to 100, no decimal
saturation: from 0 to 100, up to 1 decimal place
brightness: from 0 to 100, up to 1 decimal place
alpha: from 0 to 1, up to 3 decimal places
hwba?(hue, whiteness, blackness, alpha?)
hue: from 0 to 100, no decimal
whiteness: from 0 to 100, up to 1 decimal place
blackness: from 0 to 100, up to 1 decimal place
alpha: from 0 to 1, up to 3 decimal places
MIT © Baptiste Augrain