first commit
This commit is contained in:
11
build/node_modules/color-string/CHANGELOG.md
generated
vendored
Normal file
11
build/node_modules/color-string/CHANGELOG.md
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
# 0.3.0
|
||||
|
||||
- Fixed: HSL alpha channel ([#16](https://github.com/harthur/color-string/pull/16))
|
||||
- Fixed: ability to parse signed number ([#15](https://github.com/harthur/color-string/pull/15))
|
||||
- Removed: component.json
|
||||
- Removed: browser build
|
||||
- Added: license field to package.json ([#17](https://github.com/harthur/color-string/pull/17))
|
||||
|
||||
---
|
||||
|
||||
Check out commit logs for earlier releases
|
||||
21
build/node_modules/color-string/LICENSE
generated
vendored
Normal file
21
build/node_modules/color-string/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
Copyright (c) 2011 Heather Arthur <fayearthur@gmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
36
build/node_modules/color-string/README.md
generated
vendored
Normal file
36
build/node_modules/color-string/README.md
generated
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
# color-string
|
||||
color-string is a library for parsing and generating CSS color strings.
|
||||
|
||||
#### parsing:
|
||||
```javascript
|
||||
colorString.getRgb("#FFF") // [255, 255, 255]
|
||||
colorString.getRgb("blue") // [0, 0, 255]
|
||||
|
||||
colorString.getRgba("rgba(200, 60, 60, 0.3)") // [200, 60, 60, 0.3]
|
||||
colorString.getRgba("rgb(200, 200, 200)") // [200, 200, 200, 1]
|
||||
|
||||
colorString.getHsl("hsl(360, 100%, 50%)") // [360, 100, 50]
|
||||
colorString.getHsla("hsla(360, 60%, 50%, 0.4)") // [360, 60, 50, 0.4]
|
||||
|
||||
colorString.getAlpha("rgba(200, 0, 12, 0.6)") // 0.6
|
||||
```
|
||||
#### generating:
|
||||
```javascript
|
||||
colorString.hexString([255, 255, 255]) // "#FFFFFF"
|
||||
colorString.rgbString([255, 255, 255]) // "rgb(255, 255, 255)"
|
||||
colorString.rgbString([0, 0, 255, 0.4]) // "rgba(0, 0, 255, 0.4)"
|
||||
colorString.rgbString([0, 0, 255], 0.4) // "rgba(0, 0, 255, 0.4)"
|
||||
colorString.percentString([0, 0, 255]) // "rgb(0%, 0%, 100%)"
|
||||
colorString.keyword([255, 255, 0]) // "yellow"
|
||||
colorString.hslString([360, 100, 100]) // "hsl(360, 100%, 100%)"
|
||||
```
|
||||
|
||||
# Install
|
||||
|
||||
### node
|
||||
For [node](http://nodejs.org) with [npm](http://npmjs.org):
|
||||
|
||||
npm install color-string
|
||||
|
||||
### browser
|
||||
Download the latest [color-string.js](https://github.com/harthur/color-string/tree/gh-pages). The `colorString` object is exported.
|
||||
221
build/node_modules/color-string/color-string.js
generated
vendored
Normal file
221
build/node_modules/color-string/color-string.js
generated
vendored
Normal file
@@ -0,0 +1,221 @@
|
||||
/* MIT license */
|
||||
var colorNames = require('color-name');
|
||||
|
||||
module.exports = {
|
||||
getRgba: getRgba,
|
||||
getHsla: getHsla,
|
||||
getRgb: getRgb,
|
||||
getHsl: getHsl,
|
||||
getHwb: getHwb,
|
||||
getAlpha: getAlpha,
|
||||
|
||||
hexString: hexString,
|
||||
rgbString: rgbString,
|
||||
rgbaString: rgbaString,
|
||||
percentString: percentString,
|
||||
percentaString: percentaString,
|
||||
hslString: hslString,
|
||||
hslaString: hslaString,
|
||||
hwbString: hwbString,
|
||||
keyword: keyword
|
||||
}
|
||||
|
||||
function getRgba(string) {
|
||||
if (!string) {
|
||||
return;
|
||||
}
|
||||
var abbr = /^#([a-fA-F0-9]{3})$/,
|
||||
hex = /^#([a-fA-F0-9]{6})$/,
|
||||
rgba = /^rgba?\(\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/,
|
||||
per = /^rgba?\(\s*([+-]?[\d\.]+)\%\s*,\s*([+-]?[\d\.]+)\%\s*,\s*([+-]?[\d\.]+)\%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/,
|
||||
keyword = /(\D+)/;
|
||||
|
||||
var rgb = [0, 0, 0],
|
||||
a = 1,
|
||||
match = string.match(abbr);
|
||||
if (match) {
|
||||
match = match[1];
|
||||
for (var i = 0; i < rgb.length; i++) {
|
||||
rgb[i] = parseInt(match[i] + match[i], 16);
|
||||
}
|
||||
}
|
||||
else if (match = string.match(hex)) {
|
||||
match = match[1];
|
||||
for (var i = 0; i < rgb.length; i++) {
|
||||
rgb[i] = parseInt(match.slice(i * 2, i * 2 + 2), 16);
|
||||
}
|
||||
}
|
||||
else if (match = string.match(rgba)) {
|
||||
for (var i = 0; i < rgb.length; i++) {
|
||||
rgb[i] = parseInt(match[i + 1]);
|
||||
}
|
||||
a = parseFloat(match[4]);
|
||||
}
|
||||
else if (match = string.match(per)) {
|
||||
for (var i = 0; i < rgb.length; i++) {
|
||||
rgb[i] = Math.round(parseFloat(match[i + 1]) * 2.55);
|
||||
}
|
||||
a = parseFloat(match[4]);
|
||||
}
|
||||
else if (match = string.match(keyword)) {
|
||||
if (match[1] == "transparent") {
|
||||
return [0, 0, 0, 0];
|
||||
}
|
||||
rgb = colorNames[match[1]];
|
||||
if (!rgb) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
for (var i = 0; i < rgb.length; i++) {
|
||||
rgb[i] = scale(rgb[i], 0, 255);
|
||||
}
|
||||
if (!a && a != 0) {
|
||||
a = 1;
|
||||
}
|
||||
else {
|
||||
a = scale(a, 0, 1);
|
||||
}
|
||||
rgb[3] = a;
|
||||
return rgb;
|
||||
}
|
||||
|
||||
function getHsla(string) {
|
||||
if (!string) {
|
||||
return;
|
||||
}
|
||||
var hsl = /^hsla?\(\s*([+-]?\d+)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)/;
|
||||
var match = string.match(hsl);
|
||||
if (match) {
|
||||
var alpha = parseFloat(match[4]);
|
||||
var h = scale(parseInt(match[1]), 0, 360),
|
||||
s = scale(parseFloat(match[2]), 0, 100),
|
||||
l = scale(parseFloat(match[3]), 0, 100),
|
||||
a = scale(isNaN(alpha) ? 1 : alpha, 0, 1);
|
||||
return [h, s, l, a];
|
||||
}
|
||||
}
|
||||
|
||||
function getHwb(string) {
|
||||
if (!string) {
|
||||
return;
|
||||
}
|
||||
var hwb = /^hwb\(\s*([+-]?\d+)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)/;
|
||||
var match = string.match(hwb);
|
||||
if (match) {
|
||||
var alpha = parseFloat(match[4]);
|
||||
var h = scale(parseInt(match[1]), 0, 360),
|
||||
w = scale(parseFloat(match[2]), 0, 100),
|
||||
b = scale(parseFloat(match[3]), 0, 100),
|
||||
a = scale(isNaN(alpha) ? 1 : alpha, 0, 1);
|
||||
return [h, w, b, a];
|
||||
}
|
||||
}
|
||||
|
||||
function getRgb(string) {
|
||||
var rgba = getRgba(string);
|
||||
return rgba && rgba.slice(0, 3);
|
||||
}
|
||||
|
||||
function getHsl(string) {
|
||||
var hsla = getHsla(string);
|
||||
return hsla && hsla.slice(0, 3);
|
||||
}
|
||||
|
||||
function getAlpha(string) {
|
||||
var vals = getRgba(string);
|
||||
if (vals) {
|
||||
return vals[3];
|
||||
}
|
||||
else if (vals = getHsla(string)) {
|
||||
return vals[3];
|
||||
}
|
||||
else if (vals = getHwb(string)) {
|
||||
return vals[3];
|
||||
}
|
||||
}
|
||||
|
||||
// generators
|
||||
function hexString(rgb) {
|
||||
return "#" + hexDouble(rgb[0]) + hexDouble(rgb[1])
|
||||
+ hexDouble(rgb[2]);
|
||||
}
|
||||
|
||||
function rgbString(rgba, alpha) {
|
||||
if (alpha < 1 || (rgba[3] && rgba[3] < 1)) {
|
||||
return rgbaString(rgba, alpha);
|
||||
}
|
||||
return "rgb(" + rgba[0] + ", " + rgba[1] + ", " + rgba[2] + ")";
|
||||
}
|
||||
|
||||
function rgbaString(rgba, alpha) {
|
||||
if (alpha === undefined) {
|
||||
alpha = (rgba[3] !== undefined ? rgba[3] : 1);
|
||||
}
|
||||
return "rgba(" + rgba[0] + ", " + rgba[1] + ", " + rgba[2]
|
||||
+ ", " + alpha + ")";
|
||||
}
|
||||
|
||||
function percentString(rgba, alpha) {
|
||||
if (alpha < 1 || (rgba[3] && rgba[3] < 1)) {
|
||||
return percentaString(rgba, alpha);
|
||||
}
|
||||
var r = Math.round(rgba[0]/255 * 100),
|
||||
g = Math.round(rgba[1]/255 * 100),
|
||||
b = Math.round(rgba[2]/255 * 100);
|
||||
|
||||
return "rgb(" + r + "%, " + g + "%, " + b + "%)";
|
||||
}
|
||||
|
||||
function percentaString(rgba, alpha) {
|
||||
var r = Math.round(rgba[0]/255 * 100),
|
||||
g = Math.round(rgba[1]/255 * 100),
|
||||
b = Math.round(rgba[2]/255 * 100);
|
||||
return "rgba(" + r + "%, " + g + "%, " + b + "%, " + (alpha || rgba[3] || 1) + ")";
|
||||
}
|
||||
|
||||
function hslString(hsla, alpha) {
|
||||
if (alpha < 1 || (hsla[3] && hsla[3] < 1)) {
|
||||
return hslaString(hsla, alpha);
|
||||
}
|
||||
return "hsl(" + hsla[0] + ", " + hsla[1] + "%, " + hsla[2] + "%)";
|
||||
}
|
||||
|
||||
function hslaString(hsla, alpha) {
|
||||
if (alpha === undefined) {
|
||||
alpha = (hsla[3] !== undefined ? hsla[3] : 1);
|
||||
}
|
||||
return "hsla(" + hsla[0] + ", " + hsla[1] + "%, " + hsla[2] + "%, "
|
||||
+ alpha + ")";
|
||||
}
|
||||
|
||||
// hwb is a bit different than rgb(a) & hsl(a) since there is no alpha specific syntax
|
||||
// (hwb have alpha optional & 1 is default value)
|
||||
function hwbString(hwb, alpha) {
|
||||
if (alpha === undefined) {
|
||||
alpha = (hwb[3] !== undefined ? hwb[3] : 1);
|
||||
}
|
||||
return "hwb(" + hwb[0] + ", " + hwb[1] + "%, " + hwb[2] + "%"
|
||||
+ (alpha !== undefined && alpha !== 1 ? ", " + alpha : "") + ")";
|
||||
}
|
||||
|
||||
function keyword(rgb) {
|
||||
return reverseNames[rgb.slice(0, 3)];
|
||||
}
|
||||
|
||||
// helpers
|
||||
function scale(num, min, max) {
|
||||
return Math.min(Math.max(min, num), max);
|
||||
}
|
||||
|
||||
function hexDouble(num) {
|
||||
var str = num.toString(16).toUpperCase();
|
||||
return (str.length < 2) ? "0" + str : str;
|
||||
}
|
||||
|
||||
|
||||
//create a list of reverse color names
|
||||
var reverseNames = {};
|
||||
for (var name in colorNames) {
|
||||
reverseNames[colorNames[name]] = name;
|
||||
}
|
||||
69
build/node_modules/color-string/package.json
generated
vendored
Normal file
69
build/node_modules/color-string/package.json
generated
vendored
Normal file
@@ -0,0 +1,69 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"color-string@0.3.0",
|
||||
"/Users/asciidisco/Desktop/asciidisco.com/build"
|
||||
]
|
||||
],
|
||||
"_from": "color-string@0.3.0",
|
||||
"_id": "color-string@0.3.0",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-J9RvtnAlxcL6JZk7+/V55HhBuZE=",
|
||||
"_location": "/color-string",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "color-string@0.3.0",
|
||||
"name": "color-string",
|
||||
"escapedName": "color-string",
|
||||
"rawSpec": "0.3.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "0.3.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/color"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/color-string/-/color-string-0.3.0.tgz",
|
||||
"_spec": "0.3.0",
|
||||
"_where": "/Users/asciidisco/Desktop/asciidisco.com/build",
|
||||
"author": {
|
||||
"name": "Heather Arthur",
|
||||
"email": "fayearthur@gmail.com"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/harthur/color-string/issues"
|
||||
},
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Maxime Thirouin"
|
||||
},
|
||||
{
|
||||
"name": "Dyma Ywanov",
|
||||
"email": "dfcreative@gmail.com"
|
||||
}
|
||||
],
|
||||
"dependencies": {
|
||||
"color-name": "^1.0.0"
|
||||
},
|
||||
"description": "Parser and generator for CSS color strings",
|
||||
"devDependencies": {},
|
||||
"homepage": "https://github.com/harthur/color-string#readme",
|
||||
"keywords": [
|
||||
"color",
|
||||
"colour",
|
||||
"rgb",
|
||||
"css"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "./color-string",
|
||||
"name": "color-string",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+ssh://git@github.com/harthur/color-string.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "node test/basic.js"
|
||||
},
|
||||
"version": "0.3.0"
|
||||
}
|
||||
93
build/node_modules/color-string/test/basic.js
generated
vendored
Normal file
93
build/node_modules/color-string/test/basic.js
generated
vendored
Normal file
@@ -0,0 +1,93 @@
|
||||
var string = require("../color-string"),
|
||||
assert = require("assert");
|
||||
|
||||
|
||||
assert.deepEqual(string.getRgba("#fef"), [255, 238, 255, 1]);
|
||||
assert.deepEqual(string.getRgba("#fffFEF"), [255, 255, 239,1]);
|
||||
assert.deepEqual(string.getRgba("rgb(244, 233, 100)"), [244, 233, 100, 1]);
|
||||
assert.deepEqual(string.getRgba("rgb(100%, 30%, 90%)"), [255, 77, 229, 1]);
|
||||
assert.deepEqual(string.getRgba("transparent"), [0, 0, 0, 0]);
|
||||
assert.deepEqual(string.getHsla("hsl(240, 100%, 50.5%)"), [240, 100, 50.5, 1]);
|
||||
assert.deepEqual(string.getHsla("hsl(240deg, 100%, 50.5%)"), [240, 100, 50.5, 1]);
|
||||
assert.deepEqual(string.getHwb("hwb(240, 100%, 50.5%)"), [240, 100, 50.5, 1]);
|
||||
assert.deepEqual(string.getHwb("hwb(240deg, 100%, 50.5%)"), [240, 100, 50.5, 1]);
|
||||
|
||||
// with sign
|
||||
assert.deepEqual(string.getRgba("rgb(-244, +233, -100)"), [0, 233, 0, 1]);
|
||||
assert.deepEqual(string.getHsla("hsl(+240, 100%, 50.5%)"), [240, 100, 50.5, 1]);
|
||||
assert.deepEqual(string.getRgba("rgba(200, +20, -233, -0.0)"), [200, 20, 0, 0]);
|
||||
assert.deepEqual(string.getRgba("rgba(200, +20, -233, -0.0)"), [200, 20, 0, 0]);
|
||||
assert.deepEqual(string.getHsla("hsla(+200, 100%, 50%, -0.2)"), [200, 100, 50, 0]);
|
||||
assert.deepEqual(string.getHwb("hwb(+240, 100%, 50.5%)"), [240, 100, 50.5, 1]);
|
||||
assert.deepEqual(string.getHwb("hwb(-240deg, 100%, 50.5%)"), [0, 100, 50.5, 1]);
|
||||
assert.deepEqual(string.getHwb("hwb(-240deg, 100%, 50.5%, +0.6)"), [0, 100, 50.5, 0.6]);
|
||||
|
||||
//subsequent return values should not change array
|
||||
assert.deepEqual(string.getRgba("blue"), [0, 0, 255, 1]);
|
||||
assert.deepEqual(string.getRgba("blue"), [0, 0, 255, 1]);
|
||||
|
||||
assert.equal(string.getAlpha("rgb(244, 233, 100)"), 1);
|
||||
assert.equal(string.getAlpha("rgba(244, 233, 100, 0.5)"), 0.5);
|
||||
assert.equal(string.getAlpha("hsla(244, 100%, 100%, 0.6)"), 0.6);
|
||||
assert.equal(string.getAlpha("hwb(244, 100%, 100%, 0.6)"), 0.6);
|
||||
assert.equal(string.getAlpha("hwb(244, 100%, 100%)"), 1);
|
||||
|
||||
// alpha
|
||||
assert.deepEqual(string.getRgba("rgba(200, 20, 233, 0.2)"), [200, 20, 233, 0.2]);
|
||||
assert.deepEqual(string.getRgba("rgba(200, 20, 233, 0)"), [200, 20, 233, 0]);
|
||||
assert.deepEqual(string.getRgba("rgba(100%, 30%, 90%, 0.2)"), [255, 77, 229, 0.2]);
|
||||
assert.deepEqual(string.getHsla("hsla(200, 20%, 33%, 0.2)"), [200, 20, 33, 0.2]);
|
||||
assert.deepEqual(string.getHwb("hwb(200, 20%, 33%, 0.2)"), [200, 20, 33, 0.2]);
|
||||
|
||||
// no alpha
|
||||
assert.deepEqual(string.getRgb("#fef"), [255, 238, 255]);
|
||||
assert.deepEqual(string.getRgb("rgba(200, 20, 233, 0.2)"), [200, 20, 233]);
|
||||
assert.deepEqual(string.getHsl("hsl(240, 100%, 50.5%)"), [240, 100, 50.5]);
|
||||
assert.deepEqual(string.getRgba('rgba(0,0,0,0)'), [0, 0, 0, 0]);
|
||||
assert.deepEqual(string.getHsla('hsla(0,0%,0%,0)'), [0, 0, 0, 0]);
|
||||
assert.deepEqual(string.getHwb("hwb(400, 10%, 200%, 0)"), [360, 10, 100, 0]);
|
||||
|
||||
// range
|
||||
assert.deepEqual(string.getRgba("rgba(300, 600, 100, 3)"), [255, 255, 100, 1]);
|
||||
assert.deepEqual(string.getRgba("rgba(8000%, 100%, 333%, 88)"), [255, 255, 255, 1]);
|
||||
assert.deepEqual(string.getHsla("hsla(400, 10%, 200%, 10)"), [360, 10, 100, 1]);
|
||||
assert.deepEqual(string.getHwb("hwb(400, 10%, 200%, 10)"), [360, 10, 100, 1]);
|
||||
|
||||
// invalid
|
||||
assert.strictEqual(string.getRgba("yellowblue"), undefined);
|
||||
assert.strictEqual(string.getRgba("hsl(100, 10%, 10%)"), undefined);
|
||||
assert.strictEqual(string.getRgba("hwb(100, 10%, 10%)"), undefined);
|
||||
|
||||
// generators
|
||||
assert.equal(string.hexString([255, 10, 35]), "#FF0A23");
|
||||
|
||||
assert.equal(string.rgbString([255, 10, 35]), "rgb(255, 10, 35)");
|
||||
assert.equal(string.rgbString([255, 10, 35, 0.3]), "rgba(255, 10, 35, 0.3)");
|
||||
assert.equal(string.rgbString([255, 10, 35], 0.3), "rgba(255, 10, 35, 0.3)");
|
||||
assert.equal(string.rgbaString([255, 10, 35, 0.3]), "rgba(255, 10, 35, 0.3)");
|
||||
assert.equal(string.rgbaString([255, 10, 35], 0.3), "rgba(255, 10, 35, 0.3)");
|
||||
assert.equal(string.rgbaString([255, 10, 35]), "rgba(255, 10, 35, 1)");
|
||||
assert.equal(string.rgbaString([255, 10, 35, 0]), "rgba(255, 10, 35, 0)");
|
||||
|
||||
assert.equal(string.percentString([255, 10, 35]), "rgb(100%, 4%, 14%)");
|
||||
assert.equal(string.percentString([255, 10, 35, 0.3]), "rgba(100%, 4%, 14%, 0.3)");
|
||||
assert.equal(string.percentString([255, 10, 35], 0.3), "rgba(100%, 4%, 14%, 0.3)");
|
||||
assert.equal(string.percentaString([255, 10, 35, 0.3]), "rgba(100%, 4%, 14%, 0.3)");
|
||||
assert.equal(string.percentaString([255, 10, 35], 0.3), "rgba(100%, 4%, 14%, 0.3)");
|
||||
assert.equal(string.percentaString([255, 10, 35]), "rgba(100%, 4%, 14%, 1)");
|
||||
|
||||
assert.equal(string.hslString([280, 40, 60]), "hsl(280, 40%, 60%)");
|
||||
assert.equal(string.hslString([280, 40, 60, 0.3]), "hsla(280, 40%, 60%, 0.3)");
|
||||
assert.equal(string.hslString([280, 40, 60], 0.3), "hsla(280, 40%, 60%, 0.3)");
|
||||
assert.equal(string.hslaString([280, 40, 60, 0.3]), "hsla(280, 40%, 60%, 0.3)");
|
||||
assert.equal(string.hslaString([280, 40, 60], 0.3), "hsla(280, 40%, 60%, 0.3)");
|
||||
assert.equal(string.hslaString([280, 40, 60], 0), "hsla(280, 40%, 60%, 0)");
|
||||
assert.equal(string.hslaString([280, 40, 60]), "hsla(280, 40%, 60%, 1)");
|
||||
|
||||
assert.equal(string.hwbString([280, 40, 60]), "hwb(280, 40%, 60%)");
|
||||
assert.equal(string.hwbString([280, 40, 60, 0.3]), "hwb(280, 40%, 60%, 0.3)");
|
||||
assert.equal(string.hwbString([280, 40, 60], 0.3), "hwb(280, 40%, 60%, 0.3)");
|
||||
assert.equal(string.hwbString([280, 40, 60], 0), "hwb(280, 40%, 60%, 0)");
|
||||
|
||||
assert.equal(string.keyword([255, 255, 0]), "yellow");
|
||||
assert.equal(string.keyword([100, 255, 0]), undefined);
|
||||
Reference in New Issue
Block a user