1- # color-stringify [ ![ Build Status ] ( https://travis-ci.org/dfcreative /color-stringify. svg?branch=master )] ( https://travis-ci.org/dfcreative /color-stringify ) [ ![ Code Climate ] ( https://codeclimate.com/github/dfcreative /color-stringify/badges/gpa.svg ) ]( https://codeclimate.com/github/dfcreative/color-stringify )
1+ # color-stringify [ ![ test ] ( https://github.com/colorjs /color-stringify/actions/workflows/test.js.yml/badge. svg )] ( https://github.com/colorjs /color-stringify/actions/workflows/test.js.yml ) [ ![ size ] ( https://img.shields.io/bundlephobia/minzip /color-stringify?label=size )] ( https://bundlephobia.com/result?p=color-stringify ) ![ stable ] ( https://img.shields.io/badge/stability-stable-green )
22
33Stringify passed values into a color string.
44
55` $ npm install color-stringify `
66
77``` js
8- var stringify = require ( ' color-stringify' ) ;
8+ import stringify from ' color-stringify' ;
99
10- stringify ([120 ,100 ,100 ,.4 ], ' hsl' ); // hsla(120, 100%, 100%, .4)
10+ stringify ([120 ,100 ,100 ,.4 ], ' hsl' ); // hsla(120, 100%, 100%, 0 .4)
1111```
1212
1313## API
1414
1515### ` stringify(<values>, <type>?) `
1616
17- ` <values> ` is an array or an object from [ ` css -parse` ] ( https://npmjs.com/color-parse )
17+ ` <values> ` is an array or an object from [ ` color -parse` ] ( https://npmjs.com/color-parse )
1818
1919` <type> ` is an optional string:
2020
@@ -23,10 +23,7 @@ stringify([120,100,100,.4], 'hsl'); //hsla(120, 100%, 100%, .4)
2323* [x] ` 'percent' ` — ` rgb(10%, 20%, 30%, 0.1) ` .
2424* [x] ` 'adobe1' ` — ` R:0, G:0, B:0 ` .
2525* [x] ` 'adobe2' ` — ` (R0 / G0 / B0) ` .
26- * [ ] ` 'websafe' ` — [ request feature] ( https://github.com/dfcreative /color-stringify/issues/new/?title=Websafe%20type ) .
27- * [ ] ` 'pantone' ` — [ request feature] ( https://github.com/dfcreative /color-stringify/issues/new/?title=pantone%20type ) .
26+ * [ ] ` 'websafe' ` — [ request feature] ( https://github.com/colorjs /color-stringify/issues/new/?title=Websafe%20type ) .
27+ * [ ] ` 'pantone' ` — [ request feature] ( https://github.com/colorjs /color-stringify/issues/new/?title=pantone%20type ) .
2828* [x] ` undefined ` — ` rgba(10, 20, 30, 0.2) ` .
2929* [x] Any other string — ` <type>(<value1>, <value2>, <value3>, ...) ` .
30-
31-
32- [ ![ NPM] ( https://nodei.co/npm/color-stringify.png?downloads=true&downloadRank=true&stars=true )] ( https://nodei.co/npm/color-stringify/ )
0 commit comments