color-stringify

1.2.1 • Public • Published

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:

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

NPM

Package Sidebar

Install

npm i color-stringify

Weekly Downloads

23,585

Version

1.2.1

License

MIT

Last publish

Collaborators

  • dfcreative
  • jamen