Sha256: 7ef8af75bbc0b76304649219e45e7cbb1e315b46e1323c749e6788750fb6e545

Contents?: true

Size: 661 Bytes

Versions: 39

Compression:

Stored size: 661 Bytes

Contents

var utils = require('../utils')
  , nodes = require('../nodes')
  , hsla = require('./hsla');

/**
 * Convert the given `color` to an `HSLA` node,
 * or h,s,l component values.
 *
 * Examples:
 *
 *    hsl(10, 50, 30)
 *    // => HSLA
 *
 *    hsl(#ffcc00)
 *    // => HSLA
 *
 * @param {Unit|HSLA|RGBA} hue
 * @param {Unit} saturation
 * @param {Unit} lightness
 * @return {HSLA}
 * @api public
 */

module.exports = function hsl(hue, saturation, lightness){
  if (1 == arguments.length) {
    utils.assertColor(hue, 'color');
    return hue.hsla;
  } else {
    return hsla(
        hue
      , saturation
      , lightness
      , new nodes.Unit(1));
  }
};

Version data entries

39 entries across 20 versions & 2 rubygems

Version Path
ela-4.1.6 node_modules/stylus/lib/functions/hsl.js
ela-4.1.6 node_modules/nib/node_modules/stylus/lib/functions/hsl.js
ela-4.1.5 node_modules/stylus/lib/functions/hsl.js
ela-4.1.5 node_modules/nib/node_modules/stylus/lib/functions/hsl.js
ela-4.1.4 node_modules/nib/node_modules/stylus/lib/functions/hsl.js
ela-4.1.4 node_modules/stylus/lib/functions/hsl.js
ela-4.1.3 node_modules/stylus/lib/functions/hsl.js
ela-4.1.3 node_modules/nib/node_modules/stylus/lib/functions/hsl.js
ela-4.1.2 node_modules/stylus/lib/functions/hsl.js
ela-4.1.2 node_modules/nib/node_modules/stylus/lib/functions/hsl.js
ela-4.1.1 node_modules/stylus/lib/functions/hsl.js
ela-4.1.1 node_modules/nib/node_modules/stylus/lib/functions/hsl.js
ela-4.1.0 node_modules/stylus/lib/functions/hsl.js
ela-4.1.0 node_modules/nib/node_modules/stylus/lib/functions/hsl.js
ela-4.0.0 node_modules/stylus/lib/functions/hsl.js
ela-4.0.0 node_modules/nib/node_modules/stylus/lib/functions/hsl.js
ela-3.4.3 node_modules/stylus/lib/functions/hsl.js
ela-3.4.3 node_modules/nib/node_modules/stylus/lib/functions/hsl.js
ela-3.4.2 node_modules/nib/node_modules/stylus/lib/functions/hsl.js
ela-3.4.2 node_modules/stylus/lib/functions/hsl.js