Skip to content

LESS plugin that lets you specify colors in HSLuv color space.

License

Notifications You must be signed in to change notification settings

klippersubs/less-hsluv

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

less-hsluv

LESS plugin that lets you specify colors in HSLuv color space.

See http://hsluv.org for details.

Installation

With npm:

npm i -D less-hsluv

…or clone the repo, then run npm i.

Example

@hue        : 180;
@saturation :  75;
@lightness  :  66;

@my-color   : hsluv(@hue, @saturation, @lightness);

API

new LessHusl()

Creates new plugin instance.

Functions

hsluv(@h, @s, @l)

Arguments:

  • @h : 0..360,
  • @s : 0..100,
  • @l : 0..100.

Aliases: husl.

hpluv(@h, @s, @l)

Arguments: see above.

Aliases: huslp, hpl.

hsluva(@h, @s, @l, @a)

Arguments:

  • @h : 0..360,
  • @s : 0..100,
  • @l : 0..100,
  • @a : 0..1.

Aliases: husla.

hpluva(@h, @s, @l, @a)

Arguments:

  • @h : 0..360,
  • @s : 0..100,
  • @l : 0..100,
  • @a : 0..1.

Aliases: huslpa, hpla.

Usage

With webpack 2

const LessHsluv         = require('less-hsluv');
const ExtractTextPlugin = require('extract-text-webpack-plugin');

module.exports = {
  ...foo,
  module : {
    rules : [
      {
        test : /\.less$/,
        use  : ExtractTextPlugin.extract({
          use      : [
            'css-loader',
            {
              loader  : 'less-loader',
              options : {
                plugins : [new LessHsluv()],
              },
            }
          ],
          fallback : 'style-loader/useable'
        })
      }
    ]
  },
  ...bar
};

About

LESS plugin that lets you specify colors in HSLuv color space.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%