Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

color-stringify

dfcreative108.4kMIT1.2.1

Build up a css string from color values

color, stringify, color-string

readme

color-stringify Build Status Code Climate

Stringify passed values into a color string.

$ npm install color-stringify

var stringify = require('color-stringify');

stringify([120,100,100,.4], 'hsl'); //hsla(120, 100%, 100%, .4)

API

stringify(<values>, <type>?)

<values> is an array or an object from css-parse

<type> is an optional string:

  • <input checked="" disabled="" type="checkbox"> 'hex'#RRGGBB or #RGB if possible.
  • <input checked="" disabled="" type="checkbox"> 'keyword'red, see the list of supported names.
  • <input checked="" disabled="" type="checkbox"> 'percent'rgb(10%, 20%, 30%, 0.1).
  • <input checked="" disabled="" type="checkbox"> 'adobe1'R:0, G:0, B:0.
  • <input checked="" disabled="" type="checkbox"> 'adobe2'(R0 / G0 / B0).
  • <input disabled="" type="checkbox"> 'websafe'request feature.
  • <input disabled="" type="checkbox"> 'pantone'request feature.
  • <input checked="" disabled="" type="checkbox"> undefinedrgba(10, 20, 30, 0.2).
  • <input checked="" disabled="" type="checkbox"> Any other string — <type>(<value1>, <value2>, <value3>, ...).

NPM