Giter Club home page Giter Club logo

lang.color.alvy's Introduction

kaoscript License NPM Version Dependency Status Build Status CircleCI Coverage Status

Provides HSV/HSB, HSV, HWB and HSI spaces.

Getting Started

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%)')

Methods

Properties

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.

hsl

  • hue(): Number
  • hue(Number): Color
  • saturation(): Number
  • saturation(Number): Color
  • lightness(): Number
  • lightness(Number): Color

hsi

  • hue(): Number
  • hue(Number): Color
  • saturation(): Number
  • saturation(Number): Color
  • intensity(): Number
  • intensity(Number): Color

hsb/hsv

  • hue(): Number
  • hue(Number): Color
  • saturation(): Number
  • saturation(Number): Color
  • brightness(): Number
  • brightness(Number): Color

hwb

  • hue(): Number
  • hue(Number): Color
  • whiteness(): Number
  • whiteness(Number): Color
  • blackness(): Number
  • blackness(Number): Color

Transformers

  • darken(Number): Color
  • lighten(Number): Color
  • desaturate(Number): Color
  • shift(Number): Color
  • unshift(Number): Color

Syntax

hsl

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%)

hsi

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

hsb

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

hwb

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

License

MIT © Baptiste Augrain

lang.color.alvy's People

Contributors

daiyam avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.