From 4137dc6cfc3d4f61f0fe1387f9d5857c9ed66282 Mon Sep 17 00:00:00 2001 From: Andreas Lind Date: Thu, 23 Mar 2017 12:00:33 +0100 Subject: [PATCH 01/26] package.json: Remove bogus publishConfig --- package.json | 3 --- 1 file changed, 3 deletions(-) diff --git a/package.json b/package.json index e2721e2..b4e7242 100644 --- a/package.json +++ b/package.json @@ -46,9 +46,6 @@ "minimal.js", "lib" ], - "publishConfig": { - "registry": "http://registry.npmjs.org/" - }, "scripts": { "build": "browserify -p bundle-collapser/plugin -p [ minifyify --map one-color-all.map --output one-color-all.map ] --debug -e index -s one.color > one-color-all.js && browserify -p bundle-collapser/plugin -p [ minifyify --map one-color.map --output one-color.map ] --debug -e minimal -s one.color > one-color.js", "preversion": "npm run lint && npm run build && npm test && bash -c 'git add one-color{-all,}.{js,map}'", From dd5b3cbda0ab563678ee71f900c3e721f2b6e7a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20M=C3=BCller?= Date: Thu, 6 Apr 2017 22:51:51 +0200 Subject: [PATCH 02/26] Replace browserify with rollup. Also test generated bundle --- package.json | 14 +-- rollup.config.js | 14 +++ test/color.js | 262 ++++++++++++++++++++++++++--------------------- 3 files changed, 165 insertions(+), 125 deletions(-) create mode 100644 rollup.config.js diff --git a/package.json b/package.json index b4e7242..e958b38 100644 --- a/package.json +++ b/package.json @@ -24,14 +24,14 @@ } ], "devDependencies": { - "browserify": "13.0.0", - "bundle-collapser": "1.2.1", "coveralls": "2.11.9", "istanbul": "0.4.2", "jshint": "^2.9.1", - "minifyify": "7.3.2", "mocha": "2.4.5", "mocha-lcov-reporter": "1.2.0", + "rollup": "0.41.6", + "rollup-plugin-commonjs": "8.0.2", + "uglify-js": "2.8.21", "unexpected": "10.11.1" }, "engines": { @@ -47,12 +47,14 @@ "lib" ], "scripts": { - "build": "browserify -p bundle-collapser/plugin -p [ minifyify --map one-color-all.map --output one-color-all.map ] --debug -e index -s one.color > one-color-all.js && browserify -p bundle-collapser/plugin -p [ minifyify --map one-color.map --output one-color.map ] --debug -e minimal -s one.color > one-color.js", - "preversion": "npm run lint && npm run build && npm test && bash -c 'git add one-color{-all,}.{js,map}'", + "one-color-all": "rollup -c rollup.config.js index.js && uglifyjs --compress --mangle --in-source-map OUT.js.map --source-map one-color-all.map OUT.js > one-color-all.js; rm OUT.*", + "one-color": "rollup -c rollup.config.js minimal.js && uglifyjs --compress --mangle --in-source-map OUT.js.map --source-map one-color.map OUT.js > one-color.js; rm OUT.*", + "build": "npm run one-color && npm run one-color-all", + "preversion": "npm run lint && npm run build && TEST_BUNDLES=true npm test && bash -c 'git add one-color{-all,}.{js,map}'", "lint": "jshint .", "test": "npm run lint && mocha", "coverage": "istanbul cover _mocha -- --reporter dot", - "travis": "npm run lint && npm run build && npm run coverage" + "travis": "npm run lint && npm run build && TEST_BUNDLES=true npm run coverage" }, "jspm": { "dependencies": {}, diff --git a/rollup.config.js b/rollup.config.js new file mode 100644 index 0000000..237aa63 --- /dev/null +++ b/rollup.config.js @@ -0,0 +1,14 @@ +var commonjs = require('rollup-plugin-commonjs'); + +module.exports = { + // entry: 'index.js', + format: 'umd', + moduleName: 'one.color', + dest: 'OUT.js', + + sourceMap: true, + + plugins: [ + commonjs() + ] +}; diff --git a/test/color.js b/test/color.js index 17542eb..2b2d611 100644 --- a/test/color.js +++ b/test/color.js @@ -1,5 +1,19 @@ var expect = require('unexpected'); -var color = require('../'); +var libs = [ + { + name: 'index.js', + lib: require('../') + } +]; + +if (process.env.TEST_BUNDLES) { + libs.push({ + name: 'Bundle: one-color-all.js', + lib: require('../one-color-all') + }); +} + + var namedColorSamples = require('./samples'); var spaces = [ @@ -29,151 +43,158 @@ var spaces = [ // } ]; +function testLib(libConfig) { + var color = libConfig.lib; -describe('Named colors', function () { - Object.keys(namedColorSamples).forEach(function (namedColor) { - var hex = namedColorSamples[namedColor].toLowerCase(); - it('should parse ' + namedColor + ' as ' + hex, function () { - return expect(color(namedColor).hex(), 'to be', hex); - }); - }); -}); - -spaces.forEach(function (colorSpace) { - describe(colorSpace.name, function () { - var spaceName = colorSpace.name; - - it('should have a constructor function', function () { - expect(color[spaceName], 'to be a function'); - }); - - var clr = colorSpace.name === 'CMYK' ? new color[spaceName](1, 1, 1, 1, 1) : new color[spaceName](0, 0, 0, 1); + describe(libConfig.name, function () { - it('should be constructed correctly', function () { - expect(clr, 'to satisfy', { - isColor: true + describe('Named colors', function () { + Object.keys(namedColorSamples).forEach(function (namedColor) { + var hex = namedColorSamples[namedColor].toLowerCase(); + it('should parse ' + namedColor + ' as ' + hex, function () { + return expect(color(namedColor).hex(), 'to be', hex); + }); }); }); - describe('color space conversion', function () { - spaces.forEach(function (otherSpace) { - - it('should have a ' + otherSpace.name + ' conversion method', function () { - var expected = {}; + spaces.forEach(function (colorSpace) { + describe(colorSpace.name, function () { + var spaceName = colorSpace.name; - expected[otherSpace.name.toLowerCase()] = expect.it('to be a function'); - - expect(clr, 'to satisfy', expected); + it('should have a constructor function', function () { + expect(color[spaceName], 'to be a function'); }); - it('should convert to ' + otherSpace.name, function () { - var expected = { - isColor: true - }; + var clr = colorSpace.name === 'CMYK' ? new color[spaceName](1, 1, 1, 1, 1) : new color[spaceName](0, 0, 0, 1); - otherSpace.channels.forEach(function (channelName) { - expected['_' + channelName] = expect.it('to be a number'); + it('should be constructed correctly', function () { + expect(clr, 'to satisfy', { + isColor: true }); - - expect(clr[otherSpace.name.toLowerCase()](), 'to satisfy', expected); - - // Awaiting unexpected patch - // expect(clr[otherSpace.name.toLowerCase()](), 'to exhaustively satisfy', expected); }); - }); - }); - - describe('equality', function () { - it('should have an equals method', function () { - expect(clr, 'to satisfy', { - equals: expect.it('to be a function').and('to have arity', 2) - }); - }); - - spaces.forEach(function (otherSpace) { - it('should equal same color in ' + otherSpace.name, function () { - if (otherSpace.name === 'CMYK') { - expect(clr.equals(new color[otherSpace.name](1, 1, 1, 1, 1)), 'to be true'); - } else { - expect(clr.equals(new color[otherSpace.name](0, 0, 0, 1)), 'to be true'); - } - }); - }); - }); - - it('should convert to JSON', function () { - var clr = new color[colorSpace.name](Math.random(), Math.random(), Math.random(), Math.random(), Math.random()); - expect(clr.equals(color(clr.toJSON())), 'to be true'); - }); + describe('color space conversion', function () { + spaces.forEach(function (otherSpace) { - describe('color channels', function () { - colorSpace.channels.forEach(function (channel) { - var shortHand = channel === 'black' ? 'k' : channel.charAt(0); + it('should have a ' + otherSpace.name + ' conversion method', function () { + var expected = {}; - describe(channel, function () { - it('should have a "' + channel + '" method', function () { - var expected = {}; + expected[otherSpace.name.toLowerCase()] = expect.it('to be a function'); - expected[channel] = expect.it('to be a function').and('to have arity', 2); + expect(clr, 'to satisfy', expected); + }); - expect(clr, 'to satisfy', expected); - }); + it('should convert to ' + otherSpace.name, function () { + var expected = { + isColor: true + }; - it('should have a "' + shortHand + '" shorthand method', function () { - var expected = {}; + otherSpace.channels.forEach(function (channelName) { + expected['_' + channelName] = expect.it('to be a number'); + }); - expected[shortHand] = expect.it('to be a function').and('to have arity', 2); + expect(clr[otherSpace.name.toLowerCase()](), 'to satisfy', expected); - expect(clr, 'to satisfy', expected); + // Awaiting unexpected patch + // expect(clr[otherSpace.name.toLowerCase()](), 'to exhaustively satisfy', expected); + }); }); + }); - it('should get the "' + channel + '" value', function () { - expect(new color[colorSpace.name](0, 0, 0, 0, 0)[channel](), 'to be', 0); + describe('equality', function () { + it('should have an equals method', function () { + expect(clr, 'to satisfy', { + equals: expect.it('to be a function').and('to have arity', 2) + }); }); - it('should get the "' + channel + '" shorthand "' + shortHand + '" value', function () { - expect(new color[colorSpace.name](0, 0, 0, 0, 0)[channel](), 'to be', 0); + spaces.forEach(function (otherSpace) { + it('should equal same color in ' + otherSpace.name, function () { + if (otherSpace.name === 'CMYK') { + expect(clr.equals(new color[otherSpace.name](1, 1, 1, 1, 1)), 'to be true'); + } else { + expect(clr.equals(new color[otherSpace.name](0, 0, 0, 1)), 'to be true'); + } + }); }); + }); - it('should set the "' + channel + '" value', function () { - expect(clr[channel](0)[channel](), 'to be', 0); - expect(clr[channel](0.5)[channel](), 'to be', 0.5); - - if (channel === 'hue') { - // Hue is considered a circle, and thus has periodic boundary conditions - expect(clr[channel](1)[channel](), 'to be', 0); - expect(clr[channel](-0.1)[channel](), 'to be', 0.9); - expect(clr[channel](1.5)[channel](), 'to be', 0.5); - } else { - expect(clr[channel](1)[channel](), 'to be', 1); - expect(clr[channel](-0.1)[channel](), 'to be', 0); - expect(clr[channel](1.1)[channel](), 'to be', 1); - } - }); + it('should convert to JSON', function () { + var clr = new color[colorSpace.name](Math.random(), Math.random(), Math.random(), Math.random(), Math.random()); - it('should set the "' + channel + '" shorthand "' + shortHand + '" value', function () { - expect(clr[shortHand](0)[channel](), 'to be', 0); - expect(clr[shortHand](0.5)[channel](), 'to be', 0.5); - - if (channel === 'hue') { - // Hue is considered a circle, and thus has periodic boundary conditions - expect(clr[shortHand](1)[channel](), 'to be', 0); - expect(clr[shortHand](-0.1)[channel](), 'to be', 0.9); - expect(clr[shortHand](1.5)[channel](), 'to be', 0.5); - } else { - expect(clr[shortHand](1)[channel](), 'to be', 1); - expect(clr[shortHand](-0.1)[channel](), 'to be', 0); - expect(clr[shortHand](1.1)[channel](), 'to be', 1); - } - }); + expect(clr.equals(color(clr.toJSON())), 'to be true'); + }); - it('should adjust the "' + channel + '" value', function () { - expect(clr[channel](0)[channel](0.5, true)[channel](), 'to be', 0.5); - }); + describe('color channels', function () { + colorSpace.channels.forEach(function (channel) { + var shortHand = channel === 'black' ? 'k' : channel.charAt(0); + + describe(channel, function () { + it('should have a "' + channel + '" method', function () { + var expected = {}; + + expected[channel] = expect.it('to be a function').and('to have arity', 2); + + expect(clr, 'to satisfy', expected); + }); + + it('should have a "' + shortHand + '" shorthand method', function () { + var expected = {}; + + expected[shortHand] = expect.it('to be a function').and('to have arity', 2); + + expect(clr, 'to satisfy', expected); + }); + + it('should get the "' + channel + '" value', function () { + expect(new color[colorSpace.name](0, 0, 0, 0, 0)[channel](), 'to be', 0); + }); + + it('should get the "' + channel + '" shorthand "' + shortHand + '" value', function () { + expect(new color[colorSpace.name](0, 0, 0, 0, 0)[channel](), 'to be', 0); + }); + + it('should set the "' + channel + '" value', function () { + expect(clr[channel](0)[channel](), 'to be', 0); + expect(clr[channel](0.5)[channel](), 'to be', 0.5); + + if (channel === 'hue') { + // Hue is considered a circle, and thus has periodic boundary conditions + expect(clr[channel](1)[channel](), 'to be', 0); + expect(clr[channel](-0.1)[channel](), 'to be', 0.9); + expect(clr[channel](1.5)[channel](), 'to be', 0.5); + } else { + expect(clr[channel](1)[channel](), 'to be', 1); + expect(clr[channel](-0.1)[channel](), 'to be', 0); + expect(clr[channel](1.1)[channel](), 'to be', 1); + } + }); + + it('should set the "' + channel + '" shorthand "' + shortHand + '" value', function () { + expect(clr[shortHand](0)[channel](), 'to be', 0); + expect(clr[shortHand](0.5)[channel](), 'to be', 0.5); + + if (channel === 'hue') { + // Hue is considered a circle, and thus has periodic boundary conditions + expect(clr[shortHand](1)[channel](), 'to be', 0); + expect(clr[shortHand](-0.1)[channel](), 'to be', 0.9); + expect(clr[shortHand](1.5)[channel](), 'to be', 0.5); + } else { + expect(clr[shortHand](1)[channel](), 'to be', 1); + expect(clr[shortHand](-0.1)[channel](), 'to be', 0); + expect(clr[shortHand](1.1)[channel](), 'to be', 1); + } + }); + + it('should adjust the "' + channel + '" value', function () { + expect(clr[channel](0)[channel](0.5, true)[channel](), 'to be', 0.5); + }); + + it('should adjust the "' + channel + '", shorthand "' + shortHand + '" value', function () { + expect(clr[channel](0)[shortHand](0.5, true)[channel](), 'to be', 0.5); + }); + }); - it('should adjust the "' + channel + '", shorthand "' + shortHand + '" value', function () { - expect(clr[channel](0)[shortHand](0.5, true)[channel](), 'to be', 0.5); }); }); @@ -181,4 +202,7 @@ spaces.forEach(function (colorSpace) { }); }); -}); + +} + +libs.forEach(testLib); From 495cfa3502eb6d2e3e3d97de09858e76469470ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20M=C3=BCller?= Date: Thu, 6 Apr 2017 23:23:05 +0200 Subject: [PATCH 03/26] Added size badges to README --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 1c16244..e854f0c 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,10 @@ Package managers: * npm: `npm install onecolor` * bower: `bower install color` +Small sizes: +* one-color.js ![](http://img.badgesize.io/One-com/one-color/master/one-color.js.svg?label=size) ![](http://img.badgesize.io/One-com/one-color/master/one-color.js.svg?label=gzip&compression=gzip) (Basic RGB, HSV, HSL) +* one-color-all.js ![](http://img.badgesize.io/One-com/one-color/master/one-color-all.js.svg?label=size) ![](http://img.badgesize.io/One-com/one-color/master/one-color-all.js.svg?label=gzip&compression=gzip) (Full RGB, HSV, HSL, CMYK, XYZ, LAB, named colors, [helper functions](https://github.com/One-com/one-color/tree/master/lib/plugins)) + Usage ----- From 1463f4718081773fb7fa4664229abeaf7016c4e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20M=C3=BCller?= Date: Fri, 7 Apr 2017 09:48:04 +0200 Subject: [PATCH 04/26] Stop testing in node 0.10 --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 1296a46..1ec7467 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,7 +5,6 @@ cache: directories: - node_modules node_js: - - "0.10" - "0.12" - "1" - "2" From 67aa42a0062d5290cb5f05bc98d84852857f6d70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20M=C3=BCller?= Date: Tue, 21 Nov 2017 19:32:20 +0100 Subject: [PATCH 05/26] Fix: Add missing scope parameter when mapping in .toString method --- lib/color.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/color.js b/lib/color.js index 9336b1a..9155b0f 100644 --- a/lib/color.js +++ b/lib/color.js @@ -163,7 +163,7 @@ color.installColorSpace = function (colorSpaceName, propertyNames, config) { prototype.toString = function () { return '[' + colorSpaceName + ' ' + propertyNames.map(function (propertyName) { return this['_' + propertyName]; - }).join(', ') + ']'; + }, this).join(', ') + ']'; }; // Generate getters and setters From 92bbe2c9ca0f59ecae14fa631cac07ae9f7ebde5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20M=C3=BCller?= Date: Tue, 21 Nov 2017 19:33:03 +0100 Subject: [PATCH 06/26] 3.0.5 --- one-color-all.js | 45 ++------------------------------------------- one-color-all.map | 2 +- one-color.js | 15 ++------------- one-color.map | 2 +- package.json | 2 +- 5 files changed, 7 insertions(+), 59 deletions(-) diff --git a/one-color-all.js b/one-color-all.js index 14fb10f..915ff88 100644 --- a/one-color-all.js +++ b/one-color-all.js @@ -1,43 +1,2 @@ -(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}(g.one || (g.one = {})).color = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o=n?n:2-n);return s=1e-9>n+h?0:2*h/(n+h),new t.HSV(this._hue,s,(n+h)/2,this._alpha)},rgb:function(){return this.hsv().rgb()},fromRgb:function(){return this.hsv().hsl()}})}; -},{"4":4}],4:[function(require,module,exports){ -module.exports=function(a){a.installColorSpace("HSV",["hue","saturation","value","alpha"],{rgb:function(){var e,t,s,h=this._hue,i=this._saturation,r=this._value,n=Math.min(5,Math.floor(6*h)),u=6*h-n,c=r*(1-i),l=r*(1-u*i),o=r*(1-(1-u)*i);switch(n){case 0:e=r,t=o,s=c;break;case 1:e=l,t=r,s=c;break;case 2:e=c,t=r,s=o;break;case 3:e=c,t=l,s=r;break;case 4:e=o,t=c,s=r;break;case 5:e=r,t=c,s=l}return new a.RGB(e,t,s,this._alpha)},hsl:function(){var e,t=(2-this._saturation)*this._value,s=this._saturation*this._value,h=1>=t?t:2-t;return e=1e-9>h?0:s/h,new a.HSL(this._hue,e,t/2,this._alpha)},fromRgb:function(){var e,t=this._red,s=this._green,h=this._blue,i=Math.max(t,s,h),r=Math.min(t,s,h),n=i-r,u=0===i?0:n/i,c=i;if(0===n)e=0;else switch(i){case t:e=(s-h)/n/6+(h>s?1:0);break;case s:e=(h-t)/n/6+1/3;break;case h:e=(t-s)/n/6+2/3}return new a.HSV(e,u,c,this._alpha)}})}; -},{}],5:[function(require,module,exports){ -module.exports=function(t){t.use(require(6)),t.installColorSpace("LAB",["l","a","b","alpha"],{fromRgb:function(){return this.xyz().lab()},rgb:function(){return this.xyz().rgb()},xyz:function(){var r=function(t){var r=Math.pow(t,3);return r>.008856?r:(t-16/116)/7.87},n=(this._l+16)/116,i=this._a/500+n,a=n-this._b/200;return new t.XYZ(95.047*r(i),100*r(n),108.883*r(a),this._alpha)}})}; -},{"6":6}],6:[function(require,module,exports){ -module.exports=function(t){t.installColorSpace("XYZ",["x","y","z","alpha"],{fromRgb:function(){var n=function(t){return t>.04045?Math.pow((t+.055)/1.055,2.4):t/12.92},r=n(this._red),i=n(this._green),h=n(this._blue);return new t.XYZ(.4124564*r+.3575761*i+.1804375*h,.2126729*r+.7151522*i+.072175*h,.0193339*r+.119192*i+.9503041*h,this._alpha)},rgb:function(){var n=this._x,r=this._y,i=this._z,h=function(t){return t>.0031308?1.055*Math.pow(t,1/2.4)-.055:12.92*t};return new t.RGB(h(3.2404542*n+-1.5371385*r+i*-.4985314),h(n*-.969266+1.8760108*r+.041556*i),h(.0556434*n+r*-.2040259+1.0572252*i),this._alpha)},lab:function(){var n=function(t){return t>.008856?Math.pow(t,1/3):7.787037*t+4/29},r=n(this._x/95.047),i=n(this._y/100),h=n(this._z/108.883);return new t.LAB(116*i-16,500*(r-i),200*(i-h),this._alpha)}})}; -},{}],7:[function(require,module,exports){ -function color(r){if(Array.isArray(r)){if("string"==typeof r[0]&&"function"==typeof color[r[0]])return new color[r[0]](r.slice(1,r.length));if(4===r.length)return new color.RGB(r[0]/255,r[1]/255,r[2]/255,r[3]/255)}else if("string"==typeof r){var o=r.toLowerCase();color.namedColors[o]&&(r="#"+color.namedColors[o]),"transparent"===o&&(r="rgba(0,0,0,0)");var e=r.match(cssColorRegExp);if(e){var t=e[1].toUpperCase(),n=undef(e[8])?e[8]:parseFloat(e[8]),a="H"===t[0],s=e[3]?100:a?360:255,i=e[5]||a?100:255,c=e[7]||a?100:255;if(undef(color[t]))throw new Error("color."+t+" is not installed.");return new color[t](parseFloat(e[2])/s,parseFloat(e[4])/i,parseFloat(e[6])/c,n)}r.length<6&&(r=r.replace(/^#?([0-9a-f])([0-9a-f])([0-9a-f])$/i,"$1$1$2$2$3$3"));var l=r.match(/^#?([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])$/i);if(l)return new color.RGB(parseInt(l[1],16)/255,parseInt(l[2],16)/255,parseInt(l[3],16)/255);if(color.CMYK){var u=r.match(new RegExp("^cmyk\\("+percentageChannelRegExp.source+","+percentageChannelRegExp.source+","+percentageChannelRegExp.source+","+percentageChannelRegExp.source+"\\)$","i"));if(u)return new color.CMYK(parseFloat(u[1])/100,parseFloat(u[2])/100,parseFloat(u[3])/100,parseFloat(u[4])/100)}}else if("object"==typeof r&&r.isColor)return r;return!1}var installedColorSpaces=[],undef=function(r){return"undefined"==typeof r},channelRegExp=/\s*(\.\d+|\d+(?:\.\d+)?)(%)?\s*/,percentageChannelRegExp=/\s*(\.\d+|100|\d?\d(?:\.\d+)?)%\s*/,alphaChannelRegExp=/\s*(\.\d+|\d+(?:\.\d+)?)\s*/,cssColorRegExp=new RegExp("^(rgb|hsl|hsv)a?\\("+channelRegExp.source+","+channelRegExp.source+","+channelRegExp.source+"(?:,"+alphaChannelRegExp.source+")?\\)$","i");color.namedColors={},color.installColorSpace=function(r,o,e){function t(r,o){var e={};e[o.toLowerCase()]=function(){return this.rgb()[o.toLowerCase()]()},color[o].propertyNames.forEach(function(r){var t="black"===r?"k":r.charAt(0);e[r]=e[t]=function(e,t){return this[o.toLowerCase()]()[r](e,t)}});for(var t in e)e.hasOwnProperty(t)&&void 0===color[r].prototype[t]&&(color[r].prototype[t]=e[t])}color[r]=function(e){var t=Array.isArray(e)?e:arguments;o.forEach(function(e,n){var a=t[n];if("alpha"===e)this._alpha=isNaN(a)||a>1?1:0>a?0:a;else{if(isNaN(a))throw new Error("["+r+"]: Invalid color: ("+o.join(",")+")");"hue"===e?this._hue=0>a?a-Math.floor(a):a%1:this["_"+e]=0>a?0:a>1?1:a}},this)},color[r].propertyNames=o;var n=color[r].prototype;["valueOf","hex","hexa","css","cssa"].forEach(function(o){n[o]=n[o]||("RGB"===r?n.hex:function(){return this.rgb()[o]()})}),n.isColor=!0,n.equals=function(e,t){undef(t)&&(t=1e-10),e=e[r.toLowerCase()]();for(var n=0;nt)return!1;return!0},n.toJSON=function(){return[r].concat(o.map(function(r){return this["_"+r]},this))};for(var a in e)if(e.hasOwnProperty(a)){var s=a.match(/^from(.*)$/);s?color[s[1].toUpperCase()].prototype[r.toLowerCase()]=e[a]:n[a]=e[a]}return n[r.toLowerCase()]=function(){return this},n.toString=function(){return"["+r+" "+o.map(function(r){return this["_"+r]}).join(", ")+"]"},o.forEach(function(r){var e="black"===r?"k":r.charAt(0);n[r]=n[e]=function(e,t){return"undefined"==typeof e?this["_"+r]:t?new this.constructor(o.map(function(o){return this["_"+o]+(r===o?e:0)},this)):new this.constructor(o.map(function(o){return r===o?e:this["_"+o]},this))}}),installedColorSpaces.forEach(function(o){t(r,o),t(o,r)}),installedColorSpaces.push(r),color},color.pluginList=[],color.use=function(r){return-1===color.pluginList.indexOf(r)&&(this.pluginList.push(r),r(color)),color},color.installMethod=function(r,o){return installedColorSpaces.forEach(function(e){color[e].prototype[r]=o}),this},color.installColorSpace("RGB",["red","green","blue","alpha"],{hex:function(){var r=(65536*Math.round(255*this._red)+256*Math.round(255*this._green)+Math.round(255*this._blue)).toString(16);return"#"+"00000".substr(0,6-r.length)+r},hexa:function(){var r=Math.round(255*this._alpha).toString(16);return"#"+"00".substr(0,2-r.length)+r+this.hex().substr(1,6)},css:function(){return"rgb("+Math.round(255*this._red)+","+Math.round(255*this._green)+","+Math.round(255*this._blue)+")"},cssa:function(){return"rgba("+Math.round(255*this._red)+","+Math.round(255*this._green)+","+Math.round(255*this._blue)+","+this._alpha+")"}}),module.exports=color; -},{}],8:[function(require,module,exports){ -module.exports=function(t){t.installMethod("clearer",function(t){return this.alpha(isNaN(t)?-.1:-t,!0)})}; -},{}],9:[function(require,module,exports){ -module.exports=function(e){e.use(require(3)),e.installMethod("darken",function(e){return this.lightness(isNaN(e)?-.1:-e,!0)})}; -},{"3":3}],10:[function(require,module,exports){ -module.exports=function(t){t.use(require(3)),t.installMethod("desaturate",function(t){return this.saturation(isNaN(t)?-.1:-t,!0)})}; -},{"3":3}],11:[function(require,module,exports){ -module.exports=function(e){function l(){var l=this.rgb(),n=.3*l._red+.59*l._green+.11*l._blue;return new e.RGB(n,n,n,l._alpha)}e.installMethod("greyscale",l).installMethod("grayscale",l)}; -},{}],12:[function(require,module,exports){ -module.exports=function(e){e.use(require(3)),e.installMethod("lighten",function(e){return this.lightness(isNaN(e)?.1:e,!0)})}; -},{"3":3}],13:[function(require,module,exports){ -module.exports=function(e){e.installMethod("mix",function(a,r){a=e(a).rgb(),r=1-(isNaN(r)?.5:r);var _=2*r-1,l=this._alpha-a._alpha,n=((_*l===-1?_:(_+l)/(1+_*l))+1)/2,t=1-n,h=this.rgb();return new e.RGB(h._red*n+a._red*t,h._green*n+a._green*t,h._blue*n+a._blue*t,h._alpha*r+a._alpha*(1-r))})}; -},{}],14:[function(require,module,exports){ -module.exports=function(e){e.namedColors={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgrey:"a9a9a9",darkgreen:"006400",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",grey:"808080",green:"008000",greenyellow:"adff2f",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgrey:"d3d3d3",lightgreen:"90ee90",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370d8",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"d87093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"639",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"}}; -},{}],15:[function(require,module,exports){ -module.exports=function(e){e.installMethod("negate",function(){var n=this.rgb();return new e.RGB(1-n._red,1-n._green,1-n._blue,this._alpha)})}; -},{}],16:[function(require,module,exports){ -module.exports=function(t){t.installMethod("opaquer",function(t){return this.alpha(isNaN(t)?.1:t,!0)})}; -},{}],17:[function(require,module,exports){ -module.exports=function(e){e.use(require(3)),e.installMethod("rotate",function(e){return this.hue((e||0)/360,!0)})}; -},{"3":3}],18:[function(require,module,exports){ -module.exports=function(t){t.use(require(3)),t.installMethod("saturate",function(t){return this.saturation(isNaN(t)?.1:t,!0)})}; -},{"3":3}],19:[function(require,module,exports){ -module.exports=function(a){a.installMethod("toAlpha",function(a){var e=this.rgb(),_=a(a).rgb(),l=1e-10,r=new a.RGB(0,0,0,e._alpha),n=["_red","_green","_blue"];return n.forEach(function(a){e[a]_[a]?r[a]=(e[a]-_[a])/(1-_[a]):e[a]>_[a]?r[a]=(_[a]-e[a])/_[a]:r[a]=0}),r._red>r._green?r._red>r._blue?e._alpha=r._red:e._alpha=r._blue:r._green>r._blue?e._alpha=r._green:e._alpha=r._blue,e._alpha1?1:i<0?0:i;else{if(isNaN(i))throw new Error("["+r+"]: Invalid color: ("+n.join(",")+")");"hue"===e?this._hue=i<0?i-Math.floor(i):i%1:this["_"+e]=i<0?0:i>1?1:i}},this)},e[r].propertyNames=n;var s=e[r].prototype;["valueOf","hex","hexa","css","cssa"].forEach(function(e){s[e]=s[e]||("RGB"===r?s.hex:function(){return this.rgb()[e]()})}),s.isColor=!0,s.equals=function(e,a){t(a)&&(a=1e-10),e=e[r.toLowerCase()]();for(var i=0;ia)return!1;return!0},s.toJSON=function(){return[r].concat(n.map(function(e){return this["_"+e]},this))};for(var f in i)if(i.hasOwnProperty(f)){var u=f.match(/^from(.*)$/);u?e[u[1].toUpperCase()].prototype[r.toLowerCase()]=i[f]:s[f]=i[f]}return s[r.toLowerCase()]=function(){return this},s.toString=function(){return"["+r+" "+n.map(function(e){return this["_"+e]},this).join(", ")+"]"},n.forEach(function(e){var a="black"===e?"k":e.charAt(0);s[e]=s[a]=function(a,t){return void 0===a?this["_"+e]:t?new this.constructor(n.map(function(t){return this["_"+t]+(e===t?a:0)},this)):new this.constructor(n.map(function(t){return e===t?a:this["_"+t]},this))}}),a.forEach(function(e){o(r,e),o(e,r)}),a.push(r),e},e.pluginList=[],e.use=function(a){return-1===e.pluginList.indexOf(a)&&(this.pluginList.push(a),a(e)),e},e.installMethod=function(t,r){return a.forEach(function(a){e[a].prototype[t]=r}),this},e.installColorSpace("RGB",["red","green","blue","alpha"],{hex:function(){var e=(65536*Math.round(255*this._red)+256*Math.round(255*this._green)+Math.round(255*this._blue)).toString(16);return"#"+"00000".substr(0,6-e.length)+e},hexa:function(){var e=Math.round(255*this._alpha).toString(16);return"#"+"00".substr(0,2-e.length)+e+this.hex().substr(1,6)},css:function(){return"rgb("+Math.round(255*this._red)+","+Math.round(255*this._green)+","+Math.round(255*this._blue)+")"},cssa:function(){return"rgba("+Math.round(255*this._red)+","+Math.round(255*this._green)+","+Math.round(255*this._blue)+","+this._alpha+")"}});var o=e,s=function(e){e.installColorSpace("XYZ",["x","y","z","alpha"],{fromRgb:function(){var a=function(e){return e>.04045?Math.pow((e+.055)/1.055,2.4):e/12.92},t=a(this._red),r=a(this._green),n=a(this._blue);return new e.XYZ(.4124564*t+.3575761*r+.1804375*n,.2126729*t+.7151522*r+.072175*n,.0193339*t+.119192*r+.9503041*n,this._alpha)},rgb:function(){var a=this._x,t=this._y,r=this._z,n=function(e){return e>.0031308?1.055*Math.pow(e,1/2.4)-.055:12.92*e};return new e.RGB(n(3.2404542*a+-1.5371385*t+-.4985314*r),n(-.969266*a+1.8760108*t+.041556*r),n(.0556434*a+-.2040259*t+1.0572252*r),this._alpha)},lab:function(){var a=function(e){return e>.008856?Math.pow(e,1/3):7.787037*e+4/29},t=a(this._x/95.047),r=a(this._y/100),n=a(this._z/108.883);return new e.LAB(116*r-16,500*(t-r),200*(r-n),this._alpha)}})},f=function(e){e.use(s),e.installColorSpace("LAB",["l","a","b","alpha"],{fromRgb:function(){return this.xyz().lab()},rgb:function(){return this.xyz().rgb()},xyz:function(){var a=function(e){var a=Math.pow(e,3);return a>.008856?a:(e-16/116)/7.87},t=(this._l+16)/116,r=this._a/500+t,n=t-this._b/200;return new e.XYZ(95.047*a(r),100*a(t),108.883*a(n),this._alpha)}})},u=function(e){e.installColorSpace("HSV",["hue","saturation","value","alpha"],{rgb:function(){var a,t,r,n=this._hue,i=this._saturation,o=this._value,s=Math.min(5,Math.floor(6*n)),f=6*n-s,u=o*(1-i),l=o*(1-f*i),h=o*(1-(1-f)*i);switch(s){case 0:a=o,t=h,r=u;break;case 1:a=l,t=o,r=u;break;case 2:a=u,t=o,r=h;break;case 3:a=u,t=l,r=o;break;case 4:a=h,t=u,r=o;break;case 5:a=o,t=u,r=l}return new e.RGB(a,t,r,this._alpha)},hsl:function(){var a,t=(2-this._saturation)*this._value,r=this._saturation*this._value,n=t<=1?t:2-t;return a=n<1e-9?0:r/n,new e.HSL(this._hue,a,t/2,this._alpha)},fromRgb:function(){var a,t=this._red,r=this._green,n=this._blue,i=Math.max(t,r,n),o=Math.min(t,r,n),s=i-o,f=0===i?0:s/i,u=i;if(0===s)a=0;else switch(i){case t:a=(r-n)/s/6+(rt[e]?r[e]=(a[e]-t[e])/(1-t[e]):a[e]>t[e]?r[e]=(t[e]-a[e])/t[e]:r[e]=0}),r._red>r._green?r._red>r._blue?a._alpha=r._red:a._alpha=r._blue:r._green>r._blue?a._alpha=r._green:a._alpha=r._blue,a._alpha<1e-10?a:(n.forEach(function(e){a[e]=(a[e]-t[e])/a._alpha+t[e]}),a._alpha*=r._alpha,a)})};return o.use(s).use(f).use(u).use(l).use(h).use(c).use(d).use(b).use(p).use(g).use(_).use(m).use(w).use(y).use(v).use(k).use(M)}); +//# sourceMappingURL=one-color-all.map diff --git a/one-color-all.map b/one-color-all.map index f2fa36d..2ede1f2 100644 --- a/one-color-all.map +++ b/one-color-all.map @@ -1 +1 @@ -{"version":3,"sources":["node_modules/browserify/node_modules/browser-pack/_prelude.js","index","lib/plugins/clearer.js","lib/plugins/lighten.js","lib/plugins/desaturate.js","lib/plugins/darken.js","lib/plugins/mix.js","lib/plugins/negate.js","lib/plugins/opaquer.js","lib/plugins/rotate.js","lib/plugins/grayscale.js","lib/plugins/saturate.js","lib/plugins/toAlpha.js","lib/color.js","lib/HSV.js","lib/LAB.js","lib/XYZ.js","lib/HSL.js","lib/CMYK.js","lib/plugins/namedColors.js"],"names":["module","exports","color","installMethod","amount","this","alpha","isNaN","use","require","lightness","saturation","otherColor","weight","rgb","w","a","_alpha","weight1","weight2","RGB","_red","_green","_blue","degrees","hue","gs","val","me","other","epsilon","channels","forEach","channel","obj","Array","isArray","slice","length","lowerCased","toLowerCase","namedColors","matchCssSyntax","match","cssColorRegExp","colorSpaceName","toUpperCase","undef","parseFloat","hasHue","firstChannelDivisor","secondChannelDivisor","thirdChannelDivisor","Error","replace","hexMatch","parseInt","CMYK","cmykMatch","RegExp","percentageChannelRegExp","source","isColor","installedColorSpaces","channelRegExp","alphaChannelRegExp","installColorSpace","propertyNames","config","installForeignMethods","targetColorSpaceName","sourceColorSpaceName","propertyName","shortName","charAt","value","isDelta","prop","hasOwnProperty","undefined","prototype","a1","args","arguments","i","propertyValue","join","_hue","Math","floor","methodName","hex","equals","abs","toJSON","concat","map","matchFromColorSpace","toString","constructor","otherPropertyName","otherColorSpaceName","push","pluginList","plugin","indexOf","name","fn","colorSpace","hexString","round","substr","hexa","alphaString","css","cssa","red","green","blue","_saturation","_value","min","f","p","q","t","hsl","l","sv","svDivisor","HSL","fromRgb","max","delta","HSV","xyz","lab","convert","pow","y","_l","x","_a","z","_b","XYZ","r","g","b","_x","_y","_z","LAB","hsv","_lightness","s","_cyan","_black","_magenta","_yellow","cyan","magenta","yellow","black","aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","blanchedalmond","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","darkblue","darkcyan","darkgoldenrod","darkgray","darkgrey","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgrey","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","lime","limegreen","linen","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellowgreen"],"mappings":"AAAA;ACAA;;AiBAAA,OAAOC,QAAU,SAAcC,GAC3BA,EAAMgE,kBAAkB,QAAS,OAAQ,UAAW,SAAU,QAAS,UACnEpD,IAAK,WACD,MAAO,IAAIZ,GAAMkB,IAAK,EAAIf,KAAKuJ,OAAS,EAAIvJ,KAAKwJ,QAAUxJ,KAAKwJ,OACtC,EAAIxJ,KAAKyJ,UAAY,EAAIzJ,KAAKwJ,QAAUxJ,KAAKwJ,OAC7C,EAAIxJ,KAAK0J,SAAW,EAAI1J,KAAKwJ,QAAUxJ,KAAKwJ,OAC7CxJ,KAAKY,SAGlCkH,QAAS,WAEL,GAAIf,GAAM/G,KAAKgB,KACXgG,EAAQhH,KAAKiB,OACbgG,EAAOjH,KAAKkB,MACZyI,EAAO,EAAI5C,EACX6C,EAAU,EAAI5C,EACd6C,EAAS,EAAI5C,EACb6C,EAAQ,CASZ,OARI/C,IAAOC,GAASC,GAChB6C,EAAQ3E,KAAKiC,IAAIuC,EAAMxE,KAAKiC,IAAIwC,EAASC,IACzCF,GAAQA,EAAOG,IAAU,EAAIA,GAC7BF,GAAWA,EAAUE,IAAU,EAAIA,GACnCD,GAAUA,EAASC,IAAU,EAAIA,IAEjCA,EAAQ,EAEL,GAAIj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,WAAWJ,MAAMH,GAAU,GAAMA,GAAQ;;ACF7DJ,OAAOC,QAAU,SAAiBC,GAC9BA,EAAMC,cAAc,UAAW,SAAUD,GACrC,GAAI0B,GAAKvB,KAAKS,MACVe,EAAQ3B,EAAMA,GAAOY,MACrBgB,EAAU,MACVd,EAAI,GAAId,GAAMkB,IAAI,EAAG,EAAG,EAAGQ,EAAGX,QAC9Bc,GAAY,OAAQ,SAAU,QA0BlC,OAxBAA,GAASC,QAAQ,SAAUC,GACnBL,EAAGK,GAAWH,EACdd,EAAEiB,GAAWL,EAAGK,GACTL,EAAGK,GAAWJ,EAAMI,GAC3BjB,EAAEiB,IAAYL,EAAGK,GAAWJ,EAAMI,KAAa,EAAIJ,EAAMI,IAClDL,EAAGK,GAAWJ,EAAMI,GAC3BjB,EAAEiB,IAAYJ,EAAMI,GAAWL,EAAGK,IAAYJ,EAAMI,GAEpDjB,EAAEiB,GAAW,IAIjBjB,EAAEK,KAAOL,EAAEM,OACPN,EAAEK,KAAOL,EAAEO,MACXK,EAAGX,OAASD,EAAEK,KAEdO,EAAGX,OAASD,EAAEO,MAEXP,EAAEM,OAASN,EAAEO,MACpBK,EAAGX,OAASD,EAAEM,OAEdM,EAAGX,OAASD,EAAEO,MAGdK,EAAGX,OAASa,EACLF,GAGXG,EAASC,QAAQ,SAAUC,GACvBL,EAAGK,IAAYL,EAAGK,GAAWJ,EAAMI,IAAYL,EAAGX,OAASY,EAAMI,KAErEL,EAAGX,QAAUD,EAAEC,OAERW","file":"bundle.js","sourcesContent":["(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require==\"function\"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error(\"Cannot find module '\"+o+\"'\");throw f.code=\"MODULE_NOT_FOUND\",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require==\"function\"&&require;for(var o=0;o other[channel]) {\n a[channel] = (me[channel] - other[channel]) / (1 - other[channel]);\n } else if (me[channel] > other[channel]) {\n a[channel] = (other[channel] - me[channel]) / other[channel];\n } else {\n a[channel] = 0;\n }\n });\n\n if (a._red > a._green) {\n if (a._red > a._blue) {\n me._alpha = a._red;\n } else {\n me._alpha = a._blue;\n }\n } else if (a._green > a._blue) {\n me._alpha = a._green;\n } else {\n me._alpha = a._blue;\n }\n\n if (me._alpha < epsilon) {\n return me;\n }\n\n channels.forEach(function (channel) {\n me[channel] = (me[channel] - other[channel]) / me._alpha + other[channel];\n });\n me._alpha *= a._alpha;\n\n return me;\n });\n};\n","var installedColorSpaces = [],\n undef = function (obj) {\n return typeof obj === 'undefined';\n },\n channelRegExp = /\\s*(\\.\\d+|\\d+(?:\\.\\d+)?)(%)?\\s*/,\n percentageChannelRegExp = /\\s*(\\.\\d+|100|\\d?\\d(?:\\.\\d+)?)%\\s*/,\n alphaChannelRegExp = /\\s*(\\.\\d+|\\d+(?:\\.\\d+)?)\\s*/,\n cssColorRegExp = new RegExp(\n '^(rgb|hsl|hsv)a?' +\n '\\\\(' +\n channelRegExp.source + ',' +\n channelRegExp.source + ',' +\n channelRegExp.source +\n '(?:,' + alphaChannelRegExp.source + ')?' +\n '\\\\)$', 'i');\n\nfunction color(obj) {\n if (Array.isArray(obj)) {\n if (typeof obj[0] === 'string' && typeof color[obj[0]] === 'function') {\n // Assumed array from .toJSON()\n return new color[obj[0]](obj.slice(1, obj.length));\n } else if (obj.length === 4) {\n // Assumed 4 element int RGB array from canvas with all channels [0;255]\n return new color.RGB(obj[0] / 255, obj[1] / 255, obj[2] / 255, obj[3] / 255);\n }\n } else if (typeof obj === 'string') {\n var lowerCased = obj.toLowerCase();\n if (color.namedColors[lowerCased]) {\n obj = '#' + color.namedColors[lowerCased];\n }\n if (lowerCased === 'transparent') {\n obj = 'rgba(0,0,0,0)';\n }\n // Test for CSS rgb(....) string\n var matchCssSyntax = obj.match(cssColorRegExp);\n if (matchCssSyntax) {\n var colorSpaceName = matchCssSyntax[1].toUpperCase(),\n alpha = undef(matchCssSyntax[8]) ? matchCssSyntax[8] : parseFloat(matchCssSyntax[8]),\n hasHue = colorSpaceName[0] === 'H',\n firstChannelDivisor = matchCssSyntax[3] ? 100 : (hasHue ? 360 : 255),\n secondChannelDivisor = (matchCssSyntax[5] || hasHue) ? 100 : 255,\n thirdChannelDivisor = (matchCssSyntax[7] || hasHue) ? 100 : 255;\n if (undef(color[colorSpaceName])) {\n throw new Error('color.' + colorSpaceName + ' is not installed.');\n }\n return new color[colorSpaceName](\n parseFloat(matchCssSyntax[2]) / firstChannelDivisor,\n parseFloat(matchCssSyntax[4]) / secondChannelDivisor,\n parseFloat(matchCssSyntax[6]) / thirdChannelDivisor,\n alpha\n );\n }\n // Assume hex syntax\n if (obj.length < 6) {\n // Allow CSS shorthand\n obj = obj.replace(/^#?([0-9a-f])([0-9a-f])([0-9a-f])$/i, '$1$1$2$2$3$3');\n }\n // Split obj into red, green, and blue components\n var hexMatch = obj.match(/^#?([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])$/i);\n if (hexMatch) {\n return new color.RGB(\n parseInt(hexMatch[1], 16) / 255,\n parseInt(hexMatch[2], 16) / 255,\n parseInt(hexMatch[3], 16) / 255\n );\n }\n\n // No match so far. Lets try the less likely ones\n if (color.CMYK) {\n var cmykMatch = obj.match(new RegExp(\n '^cmyk' +\n '\\\\(' +\n percentageChannelRegExp.source + ',' +\n percentageChannelRegExp.source + ',' +\n percentageChannelRegExp.source + ',' +\n percentageChannelRegExp.source +\n '\\\\)$', 'i'));\n if (cmykMatch) {\n return new color.CMYK(\n parseFloat(cmykMatch[1]) / 100,\n parseFloat(cmykMatch[2]) / 100,\n parseFloat(cmykMatch[3]) / 100,\n parseFloat(cmykMatch[4]) / 100\n );\n }\n }\n } else if (typeof obj === 'object' && obj.isColor) {\n return obj;\n }\n return false;\n}\n\ncolor.namedColors = {};\n\ncolor.installColorSpace = function (colorSpaceName, propertyNames, config) {\n color[colorSpaceName] = function (a1) { // ...\n var args = Array.isArray(a1) ? a1 : arguments;\n propertyNames.forEach(function (propertyName, i) {\n var propertyValue = args[i];\n if (propertyName === 'alpha') {\n this._alpha = (isNaN(propertyValue) || propertyValue > 1) ? 1 : (propertyValue < 0 ? 0 : propertyValue);\n } else {\n if (isNaN(propertyValue)) {\n throw new Error('[' + colorSpaceName + ']: Invalid color: (' + propertyNames.join(',') + ')');\n }\n if (propertyName === 'hue') {\n this._hue = propertyValue < 0 ? propertyValue - Math.floor(propertyValue) : propertyValue % 1;\n } else {\n this['_' + propertyName] = propertyValue < 0 ? 0 : (propertyValue > 1 ? 1 : propertyValue);\n }\n }\n }, this);\n };\n color[colorSpaceName].propertyNames = propertyNames;\n\n var prototype = color[colorSpaceName].prototype;\n\n ['valueOf', 'hex', 'hexa', 'css', 'cssa'].forEach(function (methodName) {\n prototype[methodName] = prototype[methodName] || (colorSpaceName === 'RGB' ? prototype.hex : function () {\n return this.rgb()[methodName]();\n });\n });\n\n prototype.isColor = true;\n\n prototype.equals = function (otherColor, epsilon) {\n if (undef(epsilon)) {\n epsilon = 1e-10;\n }\n\n otherColor = otherColor[colorSpaceName.toLowerCase()]();\n\n for (var i = 0; i < propertyNames.length; i = i + 1) {\n if (Math.abs(this['_' + propertyNames[i]] - otherColor['_' + propertyNames[i]]) > epsilon) {\n return false;\n }\n }\n\n return true;\n };\n\n prototype.toJSON = function () {\n return [colorSpaceName].concat(propertyNames.map(function (propertyName) {\n return this['_' + propertyName];\n }, this));\n };\n\n for (var propertyName in config) {\n if (config.hasOwnProperty(propertyName)) {\n var matchFromColorSpace = propertyName.match(/^from(.*)$/);\n if (matchFromColorSpace) {\n color[matchFromColorSpace[1].toUpperCase()].prototype[colorSpaceName.toLowerCase()] = config[propertyName];\n } else {\n prototype[propertyName] = config[propertyName];\n }\n }\n }\n\n // It is pretty easy to implement the conversion to the same color space:\n prototype[colorSpaceName.toLowerCase()] = function () {\n return this;\n };\n prototype.toString = function () {\n return '[' + colorSpaceName + ' ' + propertyNames.map(function (propertyName) {\n return this['_' + propertyName];\n }).join(', ') + ']';\n };\n\n // Generate getters and setters\n propertyNames.forEach(function (propertyName) {\n var shortName = propertyName === 'black' ? 'k' : propertyName.charAt(0);\n prototype[propertyName] = prototype[shortName] = function (value, isDelta) {\n // Simple getter mode: color.red()\n if (typeof value === 'undefined') {\n return this['_' + propertyName];\n } else if (isDelta) {\n // Adjuster: color.red(+.2, true)\n return new this.constructor(propertyNames.map(function (otherPropertyName) {\n return this['_' + otherPropertyName] + (propertyName === otherPropertyName ? value : 0);\n }, this));\n } else {\n // Setter: color.red(.2);\n return new this.constructor(propertyNames.map(function (otherPropertyName) {\n return (propertyName === otherPropertyName) ? value : this['_' + otherPropertyName];\n }, this));\n }\n };\n });\n\n function installForeignMethods(targetColorSpaceName, sourceColorSpaceName) {\n var obj = {};\n obj[sourceColorSpaceName.toLowerCase()] = function () {\n return this.rgb()[sourceColorSpaceName.toLowerCase()]();\n };\n color[sourceColorSpaceName].propertyNames.forEach(function (propertyName) {\n var shortName = propertyName === 'black' ? 'k' : propertyName.charAt(0);\n obj[propertyName] = obj[shortName] = function (value, isDelta) {\n return this[sourceColorSpaceName.toLowerCase()]()[propertyName](value, isDelta);\n };\n });\n for (var prop in obj) {\n if (obj.hasOwnProperty(prop) && color[targetColorSpaceName].prototype[prop] === undefined) {\n color[targetColorSpaceName].prototype[prop] = obj[prop];\n }\n }\n }\n\n installedColorSpaces.forEach(function (otherColorSpaceName) {\n installForeignMethods(colorSpaceName, otherColorSpaceName);\n installForeignMethods(otherColorSpaceName, colorSpaceName);\n });\n\n installedColorSpaces.push(colorSpaceName);\n return color;\n};\n\ncolor.pluginList = [];\n\ncolor.use = function (plugin) {\n if (color.pluginList.indexOf(plugin) === -1) {\n this.pluginList.push(plugin);\n plugin(color);\n }\n return color;\n};\n\ncolor.installMethod = function (name, fn) {\n installedColorSpaces.forEach(function (colorSpace) {\n color[colorSpace].prototype[name] = fn;\n });\n return this;\n};\n\ncolor.installColorSpace('RGB', ['red', 'green', 'blue', 'alpha'], {\n hex: function () {\n var hexString = (Math.round(255 * this._red) * 0x10000 + Math.round(255 * this._green) * 0x100 + Math.round(255 * this._blue)).toString(16);\n return '#' + ('00000'.substr(0, 6 - hexString.length)) + hexString;\n },\n\n hexa: function () {\n var alphaString = Math.round(this._alpha * 255).toString(16);\n return '#' + '00'.substr(0, 2 - alphaString.length) + alphaString + this.hex().substr(1, 6);\n },\n\n css: function () {\n return 'rgb(' + Math.round(255 * this._red) + ',' + Math.round(255 * this._green) + ',' + Math.round(255 * this._blue) + ')';\n },\n\n cssa: function () {\n return 'rgba(' + Math.round(255 * this._red) + ',' + Math.round(255 * this._green) + ',' + Math.round(255 * this._blue) + ',' + this._alpha + ')';\n }\n});\n\nmodule.exports = color;\n","module.exports = function HSV(color) {\n color.installColorSpace('HSV', ['hue', 'saturation', 'value', 'alpha'], {\n rgb: function () {\n var hue = this._hue,\n saturation = this._saturation,\n value = this._value,\n i = Math.min(5, Math.floor(hue * 6)),\n f = hue * 6 - i,\n p = value * (1 - saturation),\n q = value * (1 - f * saturation),\n t = value * (1 - (1 - f) * saturation),\n red,\n green,\n blue;\n switch (i) {\n case 0:\n red = value;\n green = t;\n blue = p;\n break;\n case 1:\n red = q;\n green = value;\n blue = p;\n break;\n case 2:\n red = p;\n green = value;\n blue = t;\n break;\n case 3:\n red = p;\n green = q;\n blue = value;\n break;\n case 4:\n red = t;\n green = p;\n blue = value;\n break;\n case 5:\n red = value;\n green = p;\n blue = q;\n break;\n }\n return new color.RGB(red, green, blue, this._alpha);\n },\n\n hsl: function () {\n var l = (2 - this._saturation) * this._value,\n sv = this._saturation * this._value,\n svDivisor = l <= 1 ? l : (2 - l),\n saturation;\n\n // Avoid division by zero when lightness approaches zero:\n if (svDivisor < 1e-9) {\n saturation = 0;\n } else {\n saturation = sv / svDivisor;\n }\n return new color.HSL(this._hue, saturation, l / 2, this._alpha);\n },\n\n fromRgb: function () { // Becomes one.color.RGB.prototype.hsv\n var red = this._red,\n green = this._green,\n blue = this._blue,\n max = Math.max(red, green, blue),\n min = Math.min(red, green, blue),\n delta = max - min,\n hue,\n saturation = (max === 0) ? 0 : (delta / max),\n value = max;\n if (delta === 0) {\n hue = 0;\n } else {\n switch (max) {\n case red:\n hue = (green - blue) / delta / 6 + (green < blue ? 1 : 0);\n break;\n case green:\n hue = (blue - red) / delta / 6 + 1 / 3;\n break;\n case blue:\n hue = (red - green) / delta / 6 + 2 / 3;\n break;\n }\n }\n return new color.HSV(hue, saturation, value, this._alpha);\n }\n });\n};\n","module.exports = function LAB(color) {\n color.use(require('./XYZ.js'));\n\n color.installColorSpace('LAB', ['l', 'a', 'b', 'alpha'], {\n fromRgb: function () {\n return this.xyz().lab();\n },\n\n rgb: function () {\n return this.xyz().rgb();\n },\n\n xyz: function () {\n // http://www.easyrgb.com/index.php?X=MATH&H=08#text8\n var convert = function (channel) {\n var pow = Math.pow(channel, 3);\n return pow > 0.008856 ?\n pow :\n (channel - 16 / 116) / 7.87;\n },\n y = (this._l + 16) / 116,\n x = this._a / 500 + y,\n z = y - this._b / 200;\n\n return new color.XYZ(\n convert(x) * 95.047,\n convert(y) * 100.000,\n convert(z) * 108.883,\n this._alpha\n );\n }\n });\n};\n","module.exports = function XYZ(color) {\n color.installColorSpace('XYZ', ['x', 'y', 'z', 'alpha'], {\n fromRgb: function () {\n // http://www.easyrgb.com/index.php?X=MATH&H=02#text2\n var convert = function (channel) {\n return channel > 0.04045 ?\n Math.pow((channel + 0.055) / 1.055, 2.4) :\n channel / 12.92;\n },\n r = convert(this._red),\n g = convert(this._green),\n b = convert(this._blue);\n\n // Reference white point sRGB D65:\n // http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html\n return new color.XYZ(\n r * 0.4124564 + g * 0.3575761 + b * 0.1804375,\n r * 0.2126729 + g * 0.7151522 + b * 0.0721750,\n r * 0.0193339 + g * 0.1191920 + b * 0.9503041,\n this._alpha\n );\n },\n\n rgb: function () {\n // http://www.easyrgb.com/index.php?X=MATH&H=01#text1\n var x = this._x,\n y = this._y,\n z = this._z,\n convert = function (channel) {\n return channel > 0.0031308 ?\n 1.055 * Math.pow(channel, 1 / 2.4) - 0.055 :\n 12.92 * channel;\n };\n\n // Reference white point sRGB D65:\n // http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html\n return new color.RGB(\n convert(x * 3.2404542 + y * -1.5371385 + z * -0.4985314),\n convert(x * -0.9692660 + y * 1.8760108 + z * 0.0415560),\n convert(x * 0.0556434 + y * -0.2040259 + z * 1.0572252),\n this._alpha\n );\n },\n\n lab: function () {\n // http://www.easyrgb.com/index.php?X=MATH&H=07#text7\n var convert = function (channel) {\n return channel > 0.008856 ?\n Math.pow(channel, 1 / 3) :\n 7.787037 * channel + 4 / 29;\n },\n x = convert(this._x / 95.047),\n y = convert(this._y / 100.000),\n z = convert(this._z / 108.883);\n\n return new color.LAB(\n (116 * y) - 16,\n 500 * (x - y),\n 200 * (y - z),\n this._alpha\n );\n }\n });\n};\n","module.exports = function HSL(color) {\n color.use(require('./HSV'));\n\n color.installColorSpace('HSL', ['hue', 'saturation', 'lightness', 'alpha'], {\n hsv: function () {\n // Algorithm adapted from http://wiki.secondlife.com/wiki/Color_conversion_scripts\n var l = this._lightness * 2,\n s = this._saturation * ((l <= 1) ? l : 2 - l),\n saturation;\n\n // Avoid division by zero when l + s is very small (approaching black):\n if (l + s < 1e-9) {\n saturation = 0;\n } else {\n saturation = (2 * s) / (l + s);\n }\n\n return new color.HSV(this._hue, saturation, (l + s) / 2, this._alpha);\n },\n\n rgb: function () {\n return this.hsv().rgb();\n },\n\n fromRgb: function () { // Becomes one.color.RGB.prototype.hsv\n return this.hsv().hsl();\n }\n });\n};\n","module.exports = function CMYK(color) {\n color.installColorSpace('CMYK', ['cyan', 'magenta', 'yellow', 'black', 'alpha'], {\n rgb: function () {\n return new color.RGB((1 - this._cyan * (1 - this._black) - this._black),\n (1 - this._magenta * (1 - this._black) - this._black),\n (1 - this._yellow * (1 - this._black) - this._black),\n this._alpha);\n },\n\n fromRgb: function () { // Becomes one.color.RGB.prototype.cmyk\n // Adapted from http://www.javascripter.net/faq/rgb2cmyk.htm\n var red = this._red,\n green = this._green,\n blue = this._blue,\n cyan = 1 - red,\n magenta = 1 - green,\n yellow = 1 - blue,\n black = 1;\n if (red || green || blue) {\n black = Math.min(cyan, Math.min(magenta, yellow));\n cyan = (cyan - black) / (1 - black);\n magenta = (magenta - black) / (1 - black);\n yellow = (yellow - black) / (1 - black);\n } else {\n black = 1;\n }\n return new color.CMYK(cyan, magenta, yellow, black, this._alpha);\n }\n });\n};\n","module.exports = function namedColors(color) {\n color.namedColors = {\n aliceblue: 'f0f8ff',\n antiquewhite: 'faebd7',\n aqua: '0ff',\n aquamarine: '7fffd4',\n azure: 'f0ffff',\n beige: 'f5f5dc',\n bisque: 'ffe4c4',\n black: '000',\n blanchedalmond: 'ffebcd',\n blue: '00f',\n blueviolet: '8a2be2',\n brown: 'a52a2a',\n burlywood: 'deb887',\n cadetblue: '5f9ea0',\n chartreuse: '7fff00',\n chocolate: 'd2691e',\n coral: 'ff7f50',\n cornflowerblue: '6495ed',\n cornsilk: 'fff8dc',\n crimson: 'dc143c',\n cyan: '0ff',\n darkblue: '00008b',\n darkcyan: '008b8b',\n darkgoldenrod: 'b8860b',\n darkgray: 'a9a9a9',\n darkgrey: 'a9a9a9',\n darkgreen: '006400',\n darkkhaki: 'bdb76b',\n darkmagenta: '8b008b',\n darkolivegreen: '556b2f',\n darkorange: 'ff8c00',\n darkorchid: '9932cc',\n darkred: '8b0000',\n darksalmon: 'e9967a',\n darkseagreen: '8fbc8f',\n darkslateblue: '483d8b',\n darkslategray: '2f4f4f',\n darkslategrey: '2f4f4f',\n darkturquoise: '00ced1',\n darkviolet: '9400d3',\n deeppink: 'ff1493',\n deepskyblue: '00bfff',\n dimgray: '696969',\n dimgrey: '696969',\n dodgerblue: '1e90ff',\n firebrick: 'b22222',\n floralwhite: 'fffaf0',\n forestgreen: '228b22',\n fuchsia: 'f0f',\n gainsboro: 'dcdcdc',\n ghostwhite: 'f8f8ff',\n gold: 'ffd700',\n goldenrod: 'daa520',\n gray: '808080',\n grey: '808080',\n green: '008000',\n greenyellow: 'adff2f',\n honeydew: 'f0fff0',\n hotpink: 'ff69b4',\n indianred: 'cd5c5c',\n indigo: '4b0082',\n ivory: 'fffff0',\n khaki: 'f0e68c',\n lavender: 'e6e6fa',\n lavenderblush: 'fff0f5',\n lawngreen: '7cfc00',\n lemonchiffon: 'fffacd',\n lightblue: 'add8e6',\n lightcoral: 'f08080',\n lightcyan: 'e0ffff',\n lightgoldenrodyellow: 'fafad2',\n lightgray: 'd3d3d3',\n lightgrey: 'd3d3d3',\n lightgreen: '90ee90',\n lightpink: 'ffb6c1',\n lightsalmon: 'ffa07a',\n lightseagreen: '20b2aa',\n lightskyblue: '87cefa',\n lightslategray: '789',\n lightslategrey: '789',\n lightsteelblue: 'b0c4de',\n lightyellow: 'ffffe0',\n lime: '0f0',\n limegreen: '32cd32',\n linen: 'faf0e6',\n magenta: 'f0f',\n maroon: '800000',\n mediumaquamarine: '66cdaa',\n mediumblue: '0000cd',\n mediumorchid: 'ba55d3',\n mediumpurple: '9370d8',\n mediumseagreen: '3cb371',\n mediumslateblue: '7b68ee',\n mediumspringgreen: '00fa9a',\n mediumturquoise: '48d1cc',\n mediumvioletred: 'c71585',\n midnightblue: '191970',\n mintcream: 'f5fffa',\n mistyrose: 'ffe4e1',\n moccasin: 'ffe4b5',\n navajowhite: 'ffdead',\n navy: '000080',\n oldlace: 'fdf5e6',\n olive: '808000',\n olivedrab: '6b8e23',\n orange: 'ffa500',\n orangered: 'ff4500',\n orchid: 'da70d6',\n palegoldenrod: 'eee8aa',\n palegreen: '98fb98',\n paleturquoise: 'afeeee',\n palevioletred: 'd87093',\n papayawhip: 'ffefd5',\n peachpuff: 'ffdab9',\n peru: 'cd853f',\n pink: 'ffc0cb',\n plum: 'dda0dd',\n powderblue: 'b0e0e6',\n purple: '800080',\n rebeccapurple: '639',\n red: 'f00',\n rosybrown: 'bc8f8f',\n royalblue: '4169e1',\n saddlebrown: '8b4513',\n salmon: 'fa8072',\n sandybrown: 'f4a460',\n seagreen: '2e8b57',\n seashell: 'fff5ee',\n sienna: 'a0522d',\n silver: 'c0c0c0',\n skyblue: '87ceeb',\n slateblue: '6a5acd',\n slategray: '708090',\n slategrey: '708090',\n snow: 'fffafa',\n springgreen: '00ff7f',\n steelblue: '4682b4',\n tan: 'd2b48c',\n teal: '008080',\n thistle: 'd8bfd8',\n tomato: 'ff6347',\n turquoise: '40e0d0',\n violet: 'ee82ee',\n wheat: 'f5deb3',\n white: 'fff',\n whitesmoke: 'f5f5f5',\n yellow: 'ff0',\n yellowgreen: '9acd32'\n };\n};\n"]} \ No newline at end of file +{"version":3,"sources":["lib/color.js","lib/XYZ.js","lib/LAB.js","lib/HSV.js","lib/HSL.js","lib/CMYK.js","lib/plugins/namedColors.js","lib/plugins/clearer.js","lib/plugins/darken.js","lib/plugins/desaturate.js","lib/plugins/grayscale.js","lib/plugins/lighten.js","lib/plugins/mix.js","lib/plugins/negate.js","lib/plugins/opaquer.js","lib/plugins/rotate.js","lib/plugins/saturate.js","lib/plugins/toAlpha.js","index.js"],"names":["color","obj","Array","isArray","slice","length","RGB","lowerCased","toLowerCase","namedColors","matchCssSyntax","match","cssColorRegExp","colorSpaceName","toUpperCase","alpha","undef","parseFloat","hasHue","firstChannelDivisor","secondChannelDivisor","thirdChannelDivisor","Error","replace","hexMatch","parseInt","CMYK","cmykMatch","RegExp","percentageChannelRegExp","source","isColor","installedColorSpaces","channelRegExp","installColorSpace","propertyNames","config","installForeignMethods","targetColorSpaceName","sourceColorSpaceName","this","rgb","forEach","propertyName","shortName","charAt","value","isDelta","prop","hasOwnProperty","undefined","prototype","a1","args","arguments","i","propertyValue","_alpha","isNaN","join","_hue","Math","floor","methodName","hex","equals","otherColor","epsilon","abs","toJSON","concat","map","matchFromColorSpace","toString","constructor","otherPropertyName","otherColorSpaceName","push","pluginList","use","plugin","indexOf","installMethod","name","fn","colorSpace","hexString","round","_red","_green","_blue","substr","hexa","alphaString","css","cssa","color_1","XYZ","fromRgb","convert","channel","pow","r","g","b","x","_x","y","_y","z","_z","lab","LAB","require$$0","xyz","_l","_a","_b","HSV","red","green","blue","hue","saturation","_saturation","_value","min","f","p","q","t","hsl","l","sv","svDivisor","HSL","max","delta","hsv","_lightness","s","_cyan","_black","_magenta","_yellow","cyan","magenta","yellow","black","aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","blanchedalmond","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","darkblue","darkcyan","darkgoldenrod","darkgray","darkgrey","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgrey","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","lime","limegreen","linen","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellowgreen","clearer","amount","darken","lightness","desaturate","grayscale","gs","val","lighten","mix","weight","w","a","weight1","weight2","negate","opaquer","rotate","degrees","saturate","toAlpha","me","other","channels","require$$1","require$$2","require$$3","require$$4","require$$5","require$$6","require$$7","require$$8","require$$9","require$$10","require$$11","require$$12","require$$13","require$$14","require$$15","require$$16","require$$17"],"mappings":"sMAgBA,SAASA,GAAMC,GACX,GAAIC,MAAMC,QAAQF,GAAM,CACpB,GAAsB,gBAAXA,GAAI,IAA4C,kBAAlBD,GAAMC,EAAI,IAE/C,MAAO,IAAID,GAAMC,EAAI,IAAIA,EAAIG,MAAM,EAAGH,EAAII,QACvC,IAAmB,IAAfJ,EAAII,OAEX,MAAO,IAAIL,GAAMM,IAAIL,EAAI,GAAK,IAAKA,EAAI,GAAK,IAAKA,EAAI,GAAK,IAAKA,EAAI,GAAK,SAEzE,IAAmB,gBAARA,GAAkB,CAChC,GAAIM,GAAaN,EAAIO,aACjBR,GAAMS,YAAYF,KAClBN,EAAM,IAAMD,EAAMS,YAAYF,IAEf,gBAAfA,IACAN,EAAM,gBAGV,IAAIS,GAAiBT,EAAIU,MAAMC,EAC/B,IAAIF,EAAgB,CAChB,GAAIG,GAAiBH,EAAe,GAAGI,cACnCC,EAAQC,EAAMN,EAAe,IAAMA,EAAe,GAAKO,WAAWP,EAAe,IACjFQ,EAA+B,MAAtBL,EAAe,GACxBM,EAAsBT,EAAe,GAAK,IAAOQ,EAAS,IAAM,IAChEE,EAAwBV,EAAe,IAAMQ,EAAU,IAAM,IAC7DG,EAAuBX,EAAe,IAAMQ,EAAU,IAAM,GAChE,IAAIF,EAAMhB,EAAMa,IACZ,KAAM,IAAIS,OAAM,SAAWT,EAAiB,qBAEhD,OAAO,IAAIb,GAAMa,GACbI,WAAWP,EAAe,IAAMS,EAChCF,WAAWP,EAAe,IAAMU,EAChCH,WAAWP,EAAe,IAAMW,EAChCN,GAIJd,EAAII,OAAS,IAE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AYmN,EAAGnN,GAAWoN,EAAMpN,KAAa,EAAIoN,EAAMpN,IAClDmN,EAAGnN,GAAWoN,EAAMpN,GAC3B0M,EAAE1M,IAAYoN,EAAMpN,GAAWmN,EAAGnN,IAAYoN,EAAMpN,GAEpD0M,EAAE1M,GAAW,IAIjB0M,EAAEtN,KAAOsN,EAAErN,OACPqN,EAAEtN,KAAOsN,EAAEpN,MACX6N,EAAG9P,OAASqP,EAAEtN,KAEd+N,EAAG9P,OAASqP,EAAEpN,MAEXoN,EAAErN,OAASqN,EAAEpN,MACpB6N,EAAG9P,OAASqP,EAAErN,OAEd8N,EAAG9P,OAASqP,EAAEpN,MAGd6N,EAAG9P,OA5BO,MA6BH8P,GAGXE,EAAS/Q,QAAQ,SAAU0D,GACvBmN,EAAGnN,IAAYmN,EAAGnN,GAAWoN,EAAMpN,IAAYmN,EAAG9P,OAAS+P,EAAMpN,KAErEmN,EAAG9P,QAAUqP,EAAErP,OAER8P,YC3CEtM,GACZlC,IAAI2O,GACJ3O,IAAI4O,GACJ5O,IAAI6O,GACJ7O,IAAI8O,GACJ9O,IAAI+O,GAGJ/O,IAAIgP,GACJhP,IAAIiP,GACJjP,IAAIkP,GACJlP,IAAImP,GACJnP,IAAIoP,GACJpP,IAAIqP,GACJrP,IAAIsP,GACJtP,IAAIuP,GACJvP,IAAIwP,GACJxP,IAAIyP,GACJzP,IAAI0P,GACJ1P,IAAI2P","sourcesContent":["var installedColorSpaces = [],\n undef = function (obj) {\n return typeof obj === 'undefined';\n },\n channelRegExp = /\\s*(\\.\\d+|\\d+(?:\\.\\d+)?)(%)?\\s*/,\n percentageChannelRegExp = /\\s*(\\.\\d+|100|\\d?\\d(?:\\.\\d+)?)%\\s*/,\n alphaChannelRegExp = /\\s*(\\.\\d+|\\d+(?:\\.\\d+)?)\\s*/,\n cssColorRegExp = new RegExp(\n '^(rgb|hsl|hsv)a?' +\n '\\\\(' +\n channelRegExp.source + ',' +\n channelRegExp.source + ',' +\n channelRegExp.source +\n '(?:,' + alphaChannelRegExp.source + ')?' +\n '\\\\)$', 'i');\n\nfunction color(obj) {\n if (Array.isArray(obj)) {\n if (typeof obj[0] === 'string' && typeof color[obj[0]] === 'function') {\n // Assumed array from .toJSON()\n return new color[obj[0]](obj.slice(1, obj.length));\n } else if (obj.length === 4) {\n // Assumed 4 element int RGB array from canvas with all channels [0;255]\n return new color.RGB(obj[0] / 255, obj[1] / 255, obj[2] / 255, obj[3] / 255);\n }\n } else if (typeof obj === 'string') {\n var lowerCased = obj.toLowerCase();\n if (color.namedColors[lowerCased]) {\n obj = '#' + color.namedColors[lowerCased];\n }\n if (lowerCased === 'transparent') {\n obj = 'rgba(0,0,0,0)';\n }\n // Test for CSS rgb(....) string\n var matchCssSyntax = obj.match(cssColorRegExp);\n if (matchCssSyntax) {\n var colorSpaceName = matchCssSyntax[1].toUpperCase(),\n alpha = undef(matchCssSyntax[8]) ? matchCssSyntax[8] : parseFloat(matchCssSyntax[8]),\n hasHue = colorSpaceName[0] === 'H',\n firstChannelDivisor = matchCssSyntax[3] ? 100 : (hasHue ? 360 : 255),\n secondChannelDivisor = (matchCssSyntax[5] || hasHue) ? 100 : 255,\n thirdChannelDivisor = (matchCssSyntax[7] || hasHue) ? 100 : 255;\n if (undef(color[colorSpaceName])) {\n throw new Error('color.' + colorSpaceName + ' is not installed.');\n }\n return new color[colorSpaceName](\n parseFloat(matchCssSyntax[2]) / firstChannelDivisor,\n parseFloat(matchCssSyntax[4]) / secondChannelDivisor,\n parseFloat(matchCssSyntax[6]) / thirdChannelDivisor,\n alpha\n );\n }\n // Assume hex syntax\n if (obj.length < 6) {\n // Allow CSS shorthand\n obj = obj.replace(/^#?([0-9a-f])([0-9a-f])([0-9a-f])$/i, '$1$1$2$2$3$3');\n }\n // Split obj into red, green, and blue components\n var hexMatch = obj.match(/^#?([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])$/i);\n if (hexMatch) {\n return new color.RGB(\n parseInt(hexMatch[1], 16) / 255,\n parseInt(hexMatch[2], 16) / 255,\n parseInt(hexMatch[3], 16) / 255\n );\n }\n\n // No match so far. Lets try the less likely ones\n if (color.CMYK) {\n var cmykMatch = obj.match(new RegExp(\n '^cmyk' +\n '\\\\(' +\n percentageChannelRegExp.source + ',' +\n percentageChannelRegExp.source + ',' +\n percentageChannelRegExp.source + ',' +\n percentageChannelRegExp.source +\n '\\\\)$', 'i'));\n if (cmykMatch) {\n return new color.CMYK(\n parseFloat(cmykMatch[1]) / 100,\n parseFloat(cmykMatch[2]) / 100,\n parseFloat(cmykMatch[3]) / 100,\n parseFloat(cmykMatch[4]) / 100\n );\n }\n }\n } else if (typeof obj === 'object' && obj.isColor) {\n return obj;\n }\n return false;\n}\n\ncolor.namedColors = {};\n\ncolor.installColorSpace = function (colorSpaceName, propertyNames, config) {\n color[colorSpaceName] = function (a1) { // ...\n var args = Array.isArray(a1) ? a1 : arguments;\n propertyNames.forEach(function (propertyName, i) {\n var propertyValue = args[i];\n if (propertyName === 'alpha') {\n this._alpha = (isNaN(propertyValue) || propertyValue > 1) ? 1 : (propertyValue < 0 ? 0 : propertyValue);\n } else {\n if (isNaN(propertyValue)) {\n throw new Error('[' + colorSpaceName + ']: Invalid color: (' + propertyNames.join(',') + ')');\n }\n if (propertyName === 'hue') {\n this._hue = propertyValue < 0 ? propertyValue - Math.floor(propertyValue) : propertyValue % 1;\n } else {\n this['_' + propertyName] = propertyValue < 0 ? 0 : (propertyValue > 1 ? 1 : propertyValue);\n }\n }\n }, this);\n };\n color[colorSpaceName].propertyNames = propertyNames;\n\n var prototype = color[colorSpaceName].prototype;\n\n ['valueOf', 'hex', 'hexa', 'css', 'cssa'].forEach(function (methodName) {\n prototype[methodName] = prototype[methodName] || (colorSpaceName === 'RGB' ? prototype.hex : function () {\n return this.rgb()[methodName]();\n });\n });\n\n prototype.isColor = true;\n\n prototype.equals = function (otherColor, epsilon) {\n if (undef(epsilon)) {\n epsilon = 1e-10;\n }\n\n otherColor = otherColor[colorSpaceName.toLowerCase()]();\n\n for (var i = 0; i < propertyNames.length; i = i + 1) {\n if (Math.abs(this['_' + propertyNames[i]] - otherColor['_' + propertyNames[i]]) > epsilon) {\n return false;\n }\n }\n\n return true;\n };\n\n prototype.toJSON = function () {\n return [colorSpaceName].concat(propertyNames.map(function (propertyName) {\n return this['_' + propertyName];\n }, this));\n };\n\n for (var propertyName in config) {\n if (config.hasOwnProperty(propertyName)) {\n var matchFromColorSpace = propertyName.match(/^from(.*)$/);\n if (matchFromColorSpace) {\n color[matchFromColorSpace[1].toUpperCase()].prototype[colorSpaceName.toLowerCase()] = config[propertyName];\n } else {\n prototype[propertyName] = config[propertyName];\n }\n }\n }\n\n // It is pretty easy to implement the conversion to the same color space:\n prototype[colorSpaceName.toLowerCase()] = function () {\n return this;\n };\n prototype.toString = function () {\n return '[' + colorSpaceName + ' ' + propertyNames.map(function (propertyName) {\n return this['_' + propertyName];\n }, this).join(', ') + ']';\n };\n\n // Generate getters and setters\n propertyNames.forEach(function (propertyName) {\n var shortName = propertyName === 'black' ? 'k' : propertyName.charAt(0);\n prototype[propertyName] = prototype[shortName] = function (value, isDelta) {\n // Simple getter mode: color.red()\n if (typeof value === 'undefined') {\n return this['_' + propertyName];\n } else if (isDelta) {\n // Adjuster: color.red(+.2, true)\n return new this.constructor(propertyNames.map(function (otherPropertyName) {\n return this['_' + otherPropertyName] + (propertyName === otherPropertyName ? value : 0);\n }, this));\n } else {\n // Setter: color.red(.2);\n return new this.constructor(propertyNames.map(function (otherPropertyName) {\n return (propertyName === otherPropertyName) ? value : this['_' + otherPropertyName];\n }, this));\n }\n };\n });\n\n function installForeignMethods(targetColorSpaceName, sourceColorSpaceName) {\n var obj = {};\n obj[sourceColorSpaceName.toLowerCase()] = function () {\n return this.rgb()[sourceColorSpaceName.toLowerCase()]();\n };\n color[sourceColorSpaceName].propertyNames.forEach(function (propertyName) {\n var shortName = propertyName === 'black' ? 'k' : propertyName.charAt(0);\n obj[propertyName] = obj[shortName] = function (value, isDelta) {\n return this[sourceColorSpaceName.toLowerCase()]()[propertyName](value, isDelta);\n };\n });\n for (var prop in obj) {\n if (obj.hasOwnProperty(prop) && color[targetColorSpaceName].prototype[prop] === undefined) {\n color[targetColorSpaceName].prototype[prop] = obj[prop];\n }\n }\n }\n\n installedColorSpaces.forEach(function (otherColorSpaceName) {\n installForeignMethods(colorSpaceName, otherColorSpaceName);\n installForeignMethods(otherColorSpaceName, colorSpaceName);\n });\n\n installedColorSpaces.push(colorSpaceName);\n return color;\n};\n\ncolor.pluginList = [];\n\ncolor.use = function (plugin) {\n if (color.pluginList.indexOf(plugin) === -1) {\n this.pluginList.push(plugin);\n plugin(color);\n }\n return color;\n};\n\ncolor.installMethod = function (name, fn) {\n installedColorSpaces.forEach(function (colorSpace) {\n color[colorSpace].prototype[name] = fn;\n });\n return this;\n};\n\ncolor.installColorSpace('RGB', ['red', 'green', 'blue', 'alpha'], {\n hex: function () {\n var hexString = (Math.round(255 * this._red) * 0x10000 + Math.round(255 * this._green) * 0x100 + Math.round(255 * this._blue)).toString(16);\n return '#' + ('00000'.substr(0, 6 - hexString.length)) + hexString;\n },\n\n hexa: function () {\n var alphaString = Math.round(this._alpha * 255).toString(16);\n return '#' + '00'.substr(0, 2 - alphaString.length) + alphaString + this.hex().substr(1, 6);\n },\n\n css: function () {\n return 'rgb(' + Math.round(255 * this._red) + ',' + Math.round(255 * this._green) + ',' + Math.round(255 * this._blue) + ')';\n },\n\n cssa: function () {\n return 'rgba(' + Math.round(255 * this._red) + ',' + Math.round(255 * this._green) + ',' + Math.round(255 * this._blue) + ',' + this._alpha + ')';\n }\n});\n\nmodule.exports = color;\n","module.exports = function XYZ(color) {\n color.installColorSpace('XYZ', ['x', 'y', 'z', 'alpha'], {\n fromRgb: function () {\n // http://www.easyrgb.com/index.php?X=MATH&H=02#text2\n var convert = function (channel) {\n return channel > 0.04045 ?\n Math.pow((channel + 0.055) / 1.055, 2.4) :\n channel / 12.92;\n },\n r = convert(this._red),\n g = convert(this._green),\n b = convert(this._blue);\n\n // Reference white point sRGB D65:\n // http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html\n return new color.XYZ(\n r * 0.4124564 + g * 0.3575761 + b * 0.1804375,\n r * 0.2126729 + g * 0.7151522 + b * 0.0721750,\n r * 0.0193339 + g * 0.1191920 + b * 0.9503041,\n this._alpha\n );\n },\n\n rgb: function () {\n // http://www.easyrgb.com/index.php?X=MATH&H=01#text1\n var x = this._x,\n y = this._y,\n z = this._z,\n convert = function (channel) {\n return channel > 0.0031308 ?\n 1.055 * Math.pow(channel, 1 / 2.4) - 0.055 :\n 12.92 * channel;\n };\n\n // Reference white point sRGB D65:\n // http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html\n return new color.RGB(\n convert(x * 3.2404542 + y * -1.5371385 + z * -0.4985314),\n convert(x * -0.9692660 + y * 1.8760108 + z * 0.0415560),\n convert(x * 0.0556434 + y * -0.2040259 + z * 1.0572252),\n this._alpha\n );\n },\n\n lab: function () {\n // http://www.easyrgb.com/index.php?X=MATH&H=07#text7\n var convert = function (channel) {\n return channel > 0.008856 ?\n Math.pow(channel, 1 / 3) :\n 7.787037 * channel + 4 / 29;\n },\n x = convert(this._x / 95.047),\n y = convert(this._y / 100.000),\n z = convert(this._z / 108.883);\n\n return new color.LAB(\n (116 * y) - 16,\n 500 * (x - y),\n 200 * (y - z),\n this._alpha\n );\n }\n });\n};\n","module.exports = function LAB(color) {\n color.use(require('./XYZ.js'));\n\n color.installColorSpace('LAB', ['l', 'a', 'b', 'alpha'], {\n fromRgb: function () {\n return this.xyz().lab();\n },\n\n rgb: function () {\n return this.xyz().rgb();\n },\n\n xyz: function () {\n // http://www.easyrgb.com/index.php?X=MATH&H=08#text8\n var convert = function (channel) {\n var pow = Math.pow(channel, 3);\n return pow > 0.008856 ?\n pow :\n (channel - 16 / 116) / 7.87;\n },\n y = (this._l + 16) / 116,\n x = this._a / 500 + y,\n z = y - this._b / 200;\n\n return new color.XYZ(\n convert(x) * 95.047,\n convert(y) * 100.000,\n convert(z) * 108.883,\n this._alpha\n );\n }\n });\n};\n","module.exports = function HSV(color) {\n color.installColorSpace('HSV', ['hue', 'saturation', 'value', 'alpha'], {\n rgb: function () {\n var hue = this._hue,\n saturation = this._saturation,\n value = this._value,\n i = Math.min(5, Math.floor(hue * 6)),\n f = hue * 6 - i,\n p = value * (1 - saturation),\n q = value * (1 - f * saturation),\n t = value * (1 - (1 - f) * saturation),\n red,\n green,\n blue;\n switch (i) {\n case 0:\n red = value;\n green = t;\n blue = p;\n break;\n case 1:\n red = q;\n green = value;\n blue = p;\n break;\n case 2:\n red = p;\n green = value;\n blue = t;\n break;\n case 3:\n red = p;\n green = q;\n blue = value;\n break;\n case 4:\n red = t;\n green = p;\n blue = value;\n break;\n case 5:\n red = value;\n green = p;\n blue = q;\n break;\n }\n return new color.RGB(red, green, blue, this._alpha);\n },\n\n hsl: function () {\n var l = (2 - this._saturation) * this._value,\n sv = this._saturation * this._value,\n svDivisor = l <= 1 ? l : (2 - l),\n saturation;\n\n // Avoid division by zero when lightness approaches zero:\n if (svDivisor < 1e-9) {\n saturation = 0;\n } else {\n saturation = sv / svDivisor;\n }\n return new color.HSL(this._hue, saturation, l / 2, this._alpha);\n },\n\n fromRgb: function () { // Becomes one.color.RGB.prototype.hsv\n var red = this._red,\n green = this._green,\n blue = this._blue,\n max = Math.max(red, green, blue),\n min = Math.min(red, green, blue),\n delta = max - min,\n hue,\n saturation = (max === 0) ? 0 : (delta / max),\n value = max;\n if (delta === 0) {\n hue = 0;\n } else {\n switch (max) {\n case red:\n hue = (green - blue) / delta / 6 + (green < blue ? 1 : 0);\n break;\n case green:\n hue = (blue - red) / delta / 6 + 1 / 3;\n break;\n case blue:\n hue = (red - green) / delta / 6 + 2 / 3;\n break;\n }\n }\n return new color.HSV(hue, saturation, value, this._alpha);\n }\n });\n};\n","module.exports = function HSL(color) {\n color.use(require('./HSV'));\n\n color.installColorSpace('HSL', ['hue', 'saturation', 'lightness', 'alpha'], {\n hsv: function () {\n // Algorithm adapted from http://wiki.secondlife.com/wiki/Color_conversion_scripts\n var l = this._lightness * 2,\n s = this._saturation * ((l <= 1) ? l : 2 - l),\n saturation;\n\n // Avoid division by zero when l + s is very small (approaching black):\n if (l + s < 1e-9) {\n saturation = 0;\n } else {\n saturation = (2 * s) / (l + s);\n }\n\n return new color.HSV(this._hue, saturation, (l + s) / 2, this._alpha);\n },\n\n rgb: function () {\n return this.hsv().rgb();\n },\n\n fromRgb: function () { // Becomes one.color.RGB.prototype.hsv\n return this.hsv().hsl();\n }\n });\n};\n","module.exports = function CMYK(color) {\n color.installColorSpace('CMYK', ['cyan', 'magenta', 'yellow', 'black', 'alpha'], {\n rgb: function () {\n return new color.RGB((1 - this._cyan * (1 - this._black) - this._black),\n (1 - this._magenta * (1 - this._black) - this._black),\n (1 - this._yellow * (1 - this._black) - this._black),\n this._alpha);\n },\n\n fromRgb: function () { // Becomes one.color.RGB.prototype.cmyk\n // Adapted from http://www.javascripter.net/faq/rgb2cmyk.htm\n var red = this._red,\n green = this._green,\n blue = this._blue,\n cyan = 1 - red,\n magenta = 1 - green,\n yellow = 1 - blue,\n black = 1;\n if (red || green || blue) {\n black = Math.min(cyan, Math.min(magenta, yellow));\n cyan = (cyan - black) / (1 - black);\n magenta = (magenta - black) / (1 - black);\n yellow = (yellow - black) / (1 - black);\n } else {\n black = 1;\n }\n return new color.CMYK(cyan, magenta, yellow, black, this._alpha);\n }\n });\n};\n","module.exports = function namedColors(color) {\n color.namedColors = {\n aliceblue: 'f0f8ff',\n antiquewhite: 'faebd7',\n aqua: '0ff',\n aquamarine: '7fffd4',\n azure: 'f0ffff',\n beige: 'f5f5dc',\n bisque: 'ffe4c4',\n black: '000',\n blanchedalmond: 'ffebcd',\n blue: '00f',\n blueviolet: '8a2be2',\n brown: 'a52a2a',\n burlywood: 'deb887',\n cadetblue: '5f9ea0',\n chartreuse: '7fff00',\n chocolate: 'd2691e',\n coral: 'ff7f50',\n cornflowerblue: '6495ed',\n cornsilk: 'fff8dc',\n crimson: 'dc143c',\n cyan: '0ff',\n darkblue: '00008b',\n darkcyan: '008b8b',\n darkgoldenrod: 'b8860b',\n darkgray: 'a9a9a9',\n darkgrey: 'a9a9a9',\n darkgreen: '006400',\n darkkhaki: 'bdb76b',\n darkmagenta: '8b008b',\n darkolivegreen: '556b2f',\n darkorange: 'ff8c00',\n darkorchid: '9932cc',\n darkred: '8b0000',\n darksalmon: 'e9967a',\n darkseagreen: '8fbc8f',\n darkslateblue: '483d8b',\n darkslategray: '2f4f4f',\n darkslategrey: '2f4f4f',\n darkturquoise: '00ced1',\n darkviolet: '9400d3',\n deeppink: 'ff1493',\n deepskyblue: '00bfff',\n dimgray: '696969',\n dimgrey: '696969',\n dodgerblue: '1e90ff',\n firebrick: 'b22222',\n floralwhite: 'fffaf0',\n forestgreen: '228b22',\n fuchsia: 'f0f',\n gainsboro: 'dcdcdc',\n ghostwhite: 'f8f8ff',\n gold: 'ffd700',\n goldenrod: 'daa520',\n gray: '808080',\n grey: '808080',\n green: '008000',\n greenyellow: 'adff2f',\n honeydew: 'f0fff0',\n hotpink: 'ff69b4',\n indianred: 'cd5c5c',\n indigo: '4b0082',\n ivory: 'fffff0',\n khaki: 'f0e68c',\n lavender: 'e6e6fa',\n lavenderblush: 'fff0f5',\n lawngreen: '7cfc00',\n lemonchiffon: 'fffacd',\n lightblue: 'add8e6',\n lightcoral: 'f08080',\n lightcyan: 'e0ffff',\n lightgoldenrodyellow: 'fafad2',\n lightgray: 'd3d3d3',\n lightgrey: 'd3d3d3',\n lightgreen: '90ee90',\n lightpink: 'ffb6c1',\n lightsalmon: 'ffa07a',\n lightseagreen: '20b2aa',\n lightskyblue: '87cefa',\n lightslategray: '789',\n lightslategrey: '789',\n lightsteelblue: 'b0c4de',\n lightyellow: 'ffffe0',\n lime: '0f0',\n limegreen: '32cd32',\n linen: 'faf0e6',\n magenta: 'f0f',\n maroon: '800000',\n mediumaquamarine: '66cdaa',\n mediumblue: '0000cd',\n mediumorchid: 'ba55d3',\n mediumpurple: '9370d8',\n mediumseagreen: '3cb371',\n mediumslateblue: '7b68ee',\n mediumspringgreen: '00fa9a',\n mediumturquoise: '48d1cc',\n mediumvioletred: 'c71585',\n midnightblue: '191970',\n mintcream: 'f5fffa',\n mistyrose: 'ffe4e1',\n moccasin: 'ffe4b5',\n navajowhite: 'ffdead',\n navy: '000080',\n oldlace: 'fdf5e6',\n olive: '808000',\n olivedrab: '6b8e23',\n orange: 'ffa500',\n orangered: 'ff4500',\n orchid: 'da70d6',\n palegoldenrod: 'eee8aa',\n palegreen: '98fb98',\n paleturquoise: 'afeeee',\n palevioletred: 'd87093',\n papayawhip: 'ffefd5',\n peachpuff: 'ffdab9',\n peru: 'cd853f',\n pink: 'ffc0cb',\n plum: 'dda0dd',\n powderblue: 'b0e0e6',\n purple: '800080',\n rebeccapurple: '639',\n red: 'f00',\n rosybrown: 'bc8f8f',\n royalblue: '4169e1',\n saddlebrown: '8b4513',\n salmon: 'fa8072',\n sandybrown: 'f4a460',\n seagreen: '2e8b57',\n seashell: 'fff5ee',\n sienna: 'a0522d',\n silver: 'c0c0c0',\n skyblue: '87ceeb',\n slateblue: '6a5acd',\n slategray: '708090',\n slategrey: '708090',\n snow: 'fffafa',\n springgreen: '00ff7f',\n steelblue: '4682b4',\n tan: 'd2b48c',\n teal: '008080',\n thistle: 'd8bfd8',\n tomato: 'ff6347',\n turquoise: '40e0d0',\n violet: 'ee82ee',\n wheat: 'f5deb3',\n white: 'fff',\n whitesmoke: 'f5f5f5',\n yellow: 'ff0',\n yellowgreen: '9acd32'\n };\n};\n","module.exports = function clearer(color) {\n color.installMethod('clearer', function (amount) {\n return this.alpha(isNaN(amount) ? -0.1 : -amount, true);\n });\n};\n","module.exports = function darken(color) {\n color.use(require('../HSL'));\n\n color.installMethod('darken', function (amount) {\n return this.lightness(isNaN(amount) ? -0.1 : -amount, true);\n });\n};\n","module.exports = function desaturate(color) {\n color.use(require('../HSL'));\n\n color.installMethod('desaturate', function (amount) {\n return this.saturation(isNaN(amount) ? -0.1 : -amount, true);\n });\n};\n","module.exports = function grayscale(color) {\n function gs () {\n /*jslint strict:false*/\n var rgb = this.rgb(),\n val = rgb._red * 0.3 + rgb._green * 0.59 + rgb._blue * 0.11;\n\n return new color.RGB(val, val, val, rgb._alpha);\n }\n\n color.installMethod('greyscale', gs).installMethod('grayscale', gs);\n};\n","module.exports = function lighten(color) {\n color.use(require('../HSL'));\n\n color.installMethod('lighten', function (amount) {\n return this.lightness(isNaN(amount) ? 0.1 : amount, true);\n });\n};\n","module.exports = function mix(color) {\n color.installMethod('mix', function (otherColor, weight) {\n otherColor = color(otherColor).rgb();\n weight = 1 - (isNaN(weight) ? 0.5 : weight);\n\n var w = weight * 2 - 1,\n a = this._alpha - otherColor._alpha,\n weight1 = (((w * a === -1) ? w : (w + a) / (1 + w * a)) + 1) / 2,\n weight2 = 1 - weight1,\n rgb = this.rgb();\n\n return new color.RGB(\n rgb._red * weight1 + otherColor._red * weight2,\n rgb._green * weight1 + otherColor._green * weight2,\n rgb._blue * weight1 + otherColor._blue * weight2,\n rgb._alpha * weight + otherColor._alpha * (1 - weight)\n );\n });\n};\n","module.exports = function negate(color) {\n color.installMethod('negate', function () {\n var rgb = this.rgb();\n return new color.RGB(1 - rgb._red, 1 - rgb._green, 1 - rgb._blue, this._alpha);\n });\n};\n","module.exports = function opaquer(color) {\n color.installMethod('opaquer', function (amount) {\n return this.alpha(isNaN(amount) ? 0.1 : amount, true);\n });\n};\n","module.exports = function rotate(color) {\n color.use(require('../HSL'));\n\n color.installMethod('rotate', function (degrees) {\n return this.hue((degrees || 0) / 360, true);\n });\n};\n","module.exports = function saturate(color) {\n color.use(require('../HSL'));\n\n color.installMethod('saturate', function (amount) {\n return this.saturation(isNaN(amount) ? 0.1 : amount, true);\n });\n};\n","// Adapted from http://gimp.sourcearchive.com/documentation/2.6.6-1ubuntu1/color-to-alpha_8c-source.html\n// toAlpha returns a color where the values of the argument have been converted to alpha\nmodule.exports = function toAlpha(color) {\n color.installMethod('toAlpha', function (color) {\n var me = this.rgb(),\n other = color(color).rgb(),\n epsilon = 1e-10,\n a = new color.RGB(0, 0, 0, me._alpha),\n channels = ['_red', '_green', '_blue'];\n\n channels.forEach(function (channel) {\n if (me[channel] < epsilon) {\n a[channel] = me[channel];\n } else if (me[channel] > other[channel]) {\n a[channel] = (me[channel] - other[channel]) / (1 - other[channel]);\n } else if (me[channel] > other[channel]) {\n a[channel] = (other[channel] - me[channel]) / other[channel];\n } else {\n a[channel] = 0;\n }\n });\n\n if (a._red > a._green) {\n if (a._red > a._blue) {\n me._alpha = a._red;\n } else {\n me._alpha = a._blue;\n }\n } else if (a._green > a._blue) {\n me._alpha = a._green;\n } else {\n me._alpha = a._blue;\n }\n\n if (me._alpha < epsilon) {\n return me;\n }\n\n channels.forEach(function (channel) {\n me[channel] = (me[channel] - other[channel]) / me._alpha + other[channel];\n });\n me._alpha *= a._alpha;\n\n return me;\n });\n};\n","module.exports = require('./lib/color')\n .use(require('./lib/XYZ'))\n .use(require('./lib/LAB'))\n .use(require('./lib/HSV'))\n .use(require('./lib/HSL'))\n .use(require('./lib/CMYK'))\n\n // Convenience functions\n .use(require('./lib/plugins/namedColors'))\n .use(require('./lib/plugins/clearer.js'))\n .use(require('./lib/plugins/darken.js'))\n .use(require('./lib/plugins/desaturate.js'))\n .use(require('./lib/plugins/grayscale.js'))\n .use(require('./lib/plugins/lighten.js'))\n .use(require('./lib/plugins/mix.js'))\n .use(require('./lib/plugins/negate.js'))\n .use(require('./lib/plugins/opaquer.js'))\n .use(require('./lib/plugins/rotate.js'))\n .use(require('./lib/plugins/saturate.js'))\n .use(require('./lib/plugins/toAlpha.js'));\n"]} \ No newline at end of file diff --git a/one-color.js b/one-color.js index f09f433..fd29d3b 100644 --- a/one-color.js +++ b/one-color.js @@ -1,13 +1,2 @@ -(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}(g.one || (g.one = {})).color = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o=n?n:2-n);return s=1e-9>n+h?0:2*h/(n+h),new t.HSV(this._hue,s,(n+h)/2,this._alpha)},rgb:function(){return this.hsv().rgb()},fromRgb:function(){return this.hsv().hsl()}})}; -},{"2":2}],2:[function(require,module,exports){ -module.exports=function(a){a.installColorSpace("HSV",["hue","saturation","value","alpha"],{rgb:function(){var e,t,s,h=this._hue,i=this._saturation,r=this._value,n=Math.min(5,Math.floor(6*h)),u=6*h-n,c=r*(1-i),l=r*(1-u*i),o=r*(1-(1-u)*i);switch(n){case 0:e=r,t=o,s=c;break;case 1:e=l,t=r,s=c;break;case 2:e=c,t=r,s=o;break;case 3:e=c,t=l,s=r;break;case 4:e=o,t=c,s=r;break;case 5:e=r,t=c,s=l}return new a.RGB(e,t,s,this._alpha)},hsl:function(){var e,t=(2-this._saturation)*this._value,s=this._saturation*this._value,h=1>=t?t:2-t;return e=1e-9>h?0:s/h,new a.HSL(this._hue,e,t/2,this._alpha)},fromRgb:function(){var e,t=this._red,s=this._green,h=this._blue,i=Math.max(t,s,h),r=Math.min(t,s,h),n=i-r,u=0===i?0:n/i,c=i;if(0===n)e=0;else switch(i){case t:e=(s-h)/n/6+(h>s?1:0);break;case s:e=(h-t)/n/6+1/3;break;case h:e=(t-s)/n/6+2/3}return new a.HSV(e,u,c,this._alpha)}})}; -},{}],3:[function(require,module,exports){ -function color(r){if(Array.isArray(r)){if("string"==typeof r[0]&&"function"==typeof color[r[0]])return new color[r[0]](r.slice(1,r.length));if(4===r.length)return new color.RGB(r[0]/255,r[1]/255,r[2]/255,r[3]/255)}else if("string"==typeof r){var o=r.toLowerCase();color.namedColors[o]&&(r="#"+color.namedColors[o]),"transparent"===o&&(r="rgba(0,0,0,0)");var e=r.match(cssColorRegExp);if(e){var t=e[1].toUpperCase(),n=undef(e[8])?e[8]:parseFloat(e[8]),a="H"===t[0],s=e[3]?100:a?360:255,i=e[5]||a?100:255,c=e[7]||a?100:255;if(undef(color[t]))throw new Error("color."+t+" is not installed.");return new color[t](parseFloat(e[2])/s,parseFloat(e[4])/i,parseFloat(e[6])/c,n)}r.length<6&&(r=r.replace(/^#?([0-9a-f])([0-9a-f])([0-9a-f])$/i,"$1$1$2$2$3$3"));var l=r.match(/^#?([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])$/i);if(l)return new color.RGB(parseInt(l[1],16)/255,parseInt(l[2],16)/255,parseInt(l[3],16)/255);if(color.CMYK){var u=r.match(new RegExp("^cmyk\\("+percentageChannelRegExp.source+","+percentageChannelRegExp.source+","+percentageChannelRegExp.source+","+percentageChannelRegExp.source+"\\)$","i"));if(u)return new color.CMYK(parseFloat(u[1])/100,parseFloat(u[2])/100,parseFloat(u[3])/100,parseFloat(u[4])/100)}}else if("object"==typeof r&&r.isColor)return r;return!1}var installedColorSpaces=[],undef=function(r){return"undefined"==typeof r},channelRegExp=/\s*(\.\d+|\d+(?:\.\d+)?)(%)?\s*/,percentageChannelRegExp=/\s*(\.\d+|100|\d?\d(?:\.\d+)?)%\s*/,alphaChannelRegExp=/\s*(\.\d+|\d+(?:\.\d+)?)\s*/,cssColorRegExp=new RegExp("^(rgb|hsl|hsv)a?\\("+channelRegExp.source+","+channelRegExp.source+","+channelRegExp.source+"(?:,"+alphaChannelRegExp.source+")?\\)$","i");color.namedColors={},color.installColorSpace=function(r,o,e){function t(r,o){var e={};e[o.toLowerCase()]=function(){return this.rgb()[o.toLowerCase()]()},color[o].propertyNames.forEach(function(r){var t="black"===r?"k":r.charAt(0);e[r]=e[t]=function(e,t){return this[o.toLowerCase()]()[r](e,t)}});for(var t in e)e.hasOwnProperty(t)&&void 0===color[r].prototype[t]&&(color[r].prototype[t]=e[t])}color[r]=function(e){var t=Array.isArray(e)?e:arguments;o.forEach(function(e,n){var a=t[n];if("alpha"===e)this._alpha=isNaN(a)||a>1?1:0>a?0:a;else{if(isNaN(a))throw new Error("["+r+"]: Invalid color: ("+o.join(",")+")");"hue"===e?this._hue=0>a?a-Math.floor(a):a%1:this["_"+e]=0>a?0:a>1?1:a}},this)},color[r].propertyNames=o;var n=color[r].prototype;["valueOf","hex","hexa","css","cssa"].forEach(function(o){n[o]=n[o]||("RGB"===r?n.hex:function(){return this.rgb()[o]()})}),n.isColor=!0,n.equals=function(e,t){undef(t)&&(t=1e-10),e=e[r.toLowerCase()]();for(var n=0;nt)return!1;return!0},n.toJSON=function(){return[r].concat(o.map(function(r){return this["_"+r]},this))};for(var a in e)if(e.hasOwnProperty(a)){var s=a.match(/^from(.*)$/);s?color[s[1].toUpperCase()].prototype[r.toLowerCase()]=e[a]:n[a]=e[a]}return n[r.toLowerCase()]=function(){return this},n.toString=function(){return"["+r+" "+o.map(function(r){return this["_"+r]}).join(", ")+"]"},o.forEach(function(r){var e="black"===r?"k":r.charAt(0);n[r]=n[e]=function(e,t){return"undefined"==typeof e?this["_"+r]:t?new this.constructor(o.map(function(o){return this["_"+o]+(r===o?e:0)},this)):new this.constructor(o.map(function(o){return r===o?e:this["_"+o]},this))}}),installedColorSpaces.forEach(function(o){t(r,o),t(o,r)}),installedColorSpaces.push(r),color},color.pluginList=[],color.use=function(r){return-1===color.pluginList.indexOf(r)&&(this.pluginList.push(r),r(color)),color},color.installMethod=function(r,o){return installedColorSpaces.forEach(function(e){color[e].prototype[r]=o}),this},color.installColorSpace("RGB",["red","green","blue","alpha"],{hex:function(){var r=(65536*Math.round(255*this._red)+256*Math.round(255*this._green)+Math.round(255*this._blue)).toString(16);return"#"+"00000".substr(0,6-r.length)+r},hexa:function(){var r=Math.round(255*this._alpha).toString(16);return"#"+"00".substr(0,2-r.length)+r+this.hex().substr(1,6)},css:function(){return"rgb("+Math.round(255*this._red)+","+Math.round(255*this._green)+","+Math.round(255*this._blue)+")"},cssa:function(){return"rgba("+Math.round(255*this._red)+","+Math.round(255*this._green)+","+Math.round(255*this._blue)+","+this._alpha+")"}}),module.exports=color; -},{}],4:[function(require,module,exports){ -module.exports=require(3).use(require(2)).use(require(1)); -},{"1":1,"2":2,"3":3}]},{},[4])(4) -}); - - -//# sourceMappingURL=one-color.map \ No newline at end of file +!function(t,r){"object"==typeof exports&&"undefined"!=typeof module?module.exports=r():"function"==typeof define&&define.amd?define(r):(t.one=t.one||{},t.one.color=r())}(this,function(){"use strict";function t(r){if(Array.isArray(r)){if("string"==typeof r[0]&&"function"==typeof t[r[0]])return new t[r[0]](r.slice(1,r.length));if(4===r.length)return new t.RGB(r[0]/255,r[1]/255,r[2]/255,r[3]/255)}else if("string"==typeof r){var n=r.toLowerCase();t.namedColors[n]&&(r="#"+t.namedColors[n]),"transparent"===n&&(r="rgba(0,0,0,0)");var s=r.match(o);if(s){var i=s[1].toUpperCase(),u=e(s[8])?s[8]:parseFloat(s[8]),h="H"===i[0],c=s[3]?100:h?360:255,f=s[5]||h?100:255,l=s[7]||h?100:255;if(e(t[i]))throw new Error("color."+i+" is not installed.");return new t[i](parseFloat(s[2])/c,parseFloat(s[4])/f,parseFloat(s[6])/l,u)}r.length<6&&(r=r.replace(/^#?([0-9a-f])([0-9a-f])([0-9a-f])$/i,"$1$1$2$2$3$3"));var p=r.match(/^#?([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])$/i);if(p)return new t.RGB(parseInt(p[1],16)/255,parseInt(p[2],16)/255,parseInt(p[3],16)/255);if(t.CMYK){var d=r.match(new RegExp("^cmyk\\("+a.source+","+a.source+","+a.source+","+a.source+"\\)$","i"));if(d)return new t.CMYK(parseFloat(d[1])/100,parseFloat(d[2])/100,parseFloat(d[3])/100,parseFloat(d[4])/100)}}else if("object"==typeof r&&r.isColor)return r;return!1}var r=[],e=function(t){return void 0===t},n=/\s*(\.\d+|\d+(?:\.\d+)?)(%)?\s*/,a=/\s*(\.\d+|100|\d?\d(?:\.\d+)?)%\s*/,o=new RegExp("^(rgb|hsl|hsv)a?\\("+n.source+","+n.source+","+n.source+"(?:,"+/\s*(\.\d+|\d+(?:\.\d+)?)\s*/.source+")?\\)$","i");t.namedColors={},t.installColorSpace=function(n,a,o){function s(r,e){var n={};n[e.toLowerCase()]=function(){return this.rgb()[e.toLowerCase()]()},t[e].propertyNames.forEach(function(t){var r="black"===t?"k":t.charAt(0);n[t]=n[r]=function(r,n){return this[e.toLowerCase()]()[t](r,n)}});for(var a in n)n.hasOwnProperty(a)&&void 0===t[r].prototype[a]&&(t[r].prototype[a]=n[a])}t[n]=function(t){var r=Array.isArray(t)?t:arguments;a.forEach(function(t,e){var o=r[e];if("alpha"===t)this._alpha=isNaN(o)||o>1?1:o<0?0:o;else{if(isNaN(o))throw new Error("["+n+"]: Invalid color: ("+a.join(",")+")");"hue"===t?this._hue=o<0?o-Math.floor(o):o%1:this["_"+t]=o<0?0:o>1?1:o}},this)},t[n].propertyNames=a;var i=t[n].prototype;["valueOf","hex","hexa","css","cssa"].forEach(function(t){i[t]=i[t]||("RGB"===n?i.hex:function(){return this.rgb()[t]()})}),i.isColor=!0,i.equals=function(t,r){e(r)&&(r=1e-10),t=t[n.toLowerCase()]();for(var o=0;or)return!1;return!0},i.toJSON=function(){return[n].concat(a.map(function(t){return this["_"+t]},this))};for(var u in o)if(o.hasOwnProperty(u)){var h=u.match(/^from(.*)$/);h?t[h[1].toUpperCase()].prototype[n.toLowerCase()]=o[u]:i[u]=o[u]}return i[n.toLowerCase()]=function(){return this},i.toString=function(){return"["+n+" "+a.map(function(t){return this["_"+t]},this).join(", ")+"]"},a.forEach(function(t){var r="black"===t?"k":t.charAt(0);i[t]=i[r]=function(r,e){return void 0===r?this["_"+t]:e?new this.constructor(a.map(function(e){return this["_"+e]+(t===e?r:0)},this)):new this.constructor(a.map(function(e){return t===e?r:this["_"+e]},this))}}),r.forEach(function(t){s(n,t),s(t,n)}),r.push(n),t},t.pluginList=[],t.use=function(r){return-1===t.pluginList.indexOf(r)&&(this.pluginList.push(r),r(t)),t},t.installMethod=function(e,n){return r.forEach(function(r){t[r].prototype[e]=n}),this},t.installColorSpace("RGB",["red","green","blue","alpha"],{hex:function(){var t=(65536*Math.round(255*this._red)+256*Math.round(255*this._green)+Math.round(255*this._blue)).toString(16);return"#"+"00000".substr(0,6-t.length)+t},hexa:function(){var t=Math.round(255*this._alpha).toString(16);return"#"+"00".substr(0,2-t.length)+t+this.hex().substr(1,6)},css:function(){return"rgb("+Math.round(255*this._red)+","+Math.round(255*this._green)+","+Math.round(255*this._blue)+")"},cssa:function(){return"rgba("+Math.round(255*this._red)+","+Math.round(255*this._green)+","+Math.round(255*this._blue)+","+this._alpha+")"}});var s=t,i=function(t){t.installColorSpace("HSV",["hue","saturation","value","alpha"],{rgb:function(){var r,e,n,a=this._hue,o=this._saturation,s=this._value,i=Math.min(5,Math.floor(6*a)),u=6*a-i,h=s*(1-o),c=s*(1-u*o),f=s*(1-(1-u)*o);switch(i){case 0:r=s,e=f,n=h;break;case 1:r=c,e=s,n=h;break;case 2:r=h,e=s,n=f;break;case 3:r=h,e=c,n=s;break;case 4:r=f,e=h,n=s;break;case 5:r=s,e=h,n=c}return new t.RGB(r,e,n,this._alpha)},hsl:function(){var r,e=(2-this._saturation)*this._value,n=this._saturation*this._value,a=e<=1?e:2-e;return r=a<1e-9?0:n/a,new t.HSL(this._hue,r,e/2,this._alpha)},fromRgb:function(){var r,e=this._red,n=this._green,a=this._blue,o=Math.max(e,n,a),s=Math.min(e,n,a),i=o-s,u=0===o?0:i/o,h=o;if(0===i)r=0;else switch(o){case e:r=(n-a)/i/6+(n 1) ? 1 : (propertyValue < 0 ? 0 : propertyValue);\n } else {\n if (isNaN(propertyValue)) {\n throw new Error('[' + colorSpaceName + ']: Invalid color: (' + propertyNames.join(',') + ')');\n }\n if (propertyName === 'hue') {\n this._hue = propertyValue < 0 ? propertyValue - Math.floor(propertyValue) : propertyValue % 1;\n } else {\n this['_' + propertyName] = propertyValue < 0 ? 0 : (propertyValue > 1 ? 1 : propertyValue);\n }\n }\n }, this);\n };\n color[colorSpaceName].propertyNames = propertyNames;\n\n var prototype = color[colorSpaceName].prototype;\n\n ['valueOf', 'hex', 'hexa', 'css', 'cssa'].forEach(function (methodName) {\n prototype[methodName] = prototype[methodName] || (colorSpaceName === 'RGB' ? prototype.hex : function () {\n return this.rgb()[methodName]();\n });\n });\n\n prototype.isColor = true;\n\n prototype.equals = function (otherColor, epsilon) {\n if (undef(epsilon)) {\n epsilon = 1e-10;\n }\n\n otherColor = otherColor[colorSpaceName.toLowerCase()]();\n\n for (var i = 0; i < propertyNames.length; i = i + 1) {\n if (Math.abs(this['_' + propertyNames[i]] - otherColor['_' + propertyNames[i]]) > epsilon) {\n return false;\n }\n }\n\n return true;\n };\n\n prototype.toJSON = function () {\n return [colorSpaceName].concat(propertyNames.map(function (propertyName) {\n return this['_' + propertyName];\n }, this));\n };\n\n for (var propertyName in config) {\n if (config.hasOwnProperty(propertyName)) {\n var matchFromColorSpace = propertyName.match(/^from(.*)$/);\n if (matchFromColorSpace) {\n color[matchFromColorSpace[1].toUpperCase()].prototype[colorSpaceName.toLowerCase()] = config[propertyName];\n } else {\n prototype[propertyName] = config[propertyName];\n }\n }\n }\n\n // It is pretty easy to implement the conversion to the same color space:\n prototype[colorSpaceName.toLowerCase()] = function () {\n return this;\n };\n prototype.toString = function () {\n return '[' + colorSpaceName + ' ' + propertyNames.map(function (propertyName) {\n return this['_' + propertyName];\n }).join(', ') + ']';\n };\n\n // Generate getters and setters\n propertyNames.forEach(function (propertyName) {\n var shortName = propertyName === 'black' ? 'k' : propertyName.charAt(0);\n prototype[propertyName] = prototype[shortName] = function (value, isDelta) {\n // Simple getter mode: color.red()\n if (typeof value === 'undefined') {\n return this['_' + propertyName];\n } else if (isDelta) {\n // Adjuster: color.red(+.2, true)\n return new this.constructor(propertyNames.map(function (otherPropertyName) {\n return this['_' + otherPropertyName] + (propertyName === otherPropertyName ? value : 0);\n }, this));\n } else {\n // Setter: color.red(.2);\n return new this.constructor(propertyNames.map(function (otherPropertyName) {\n return (propertyName === otherPropertyName) ? value : this['_' + otherPropertyName];\n }, this));\n }\n };\n });\n\n function installForeignMethods(targetColorSpaceName, sourceColorSpaceName) {\n var obj = {};\n obj[sourceColorSpaceName.toLowerCase()] = function () {\n return this.rgb()[sourceColorSpaceName.toLowerCase()]();\n };\n color[sourceColorSpaceName].propertyNames.forEach(function (propertyName) {\n var shortName = propertyName === 'black' ? 'k' : propertyName.charAt(0);\n obj[propertyName] = obj[shortName] = function (value, isDelta) {\n return this[sourceColorSpaceName.toLowerCase()]()[propertyName](value, isDelta);\n };\n });\n for (var prop in obj) {\n if (obj.hasOwnProperty(prop) && color[targetColorSpaceName].prototype[prop] === undefined) {\n color[targetColorSpaceName].prototype[prop] = obj[prop];\n }\n }\n }\n\n installedColorSpaces.forEach(function (otherColorSpaceName) {\n installForeignMethods(colorSpaceName, otherColorSpaceName);\n installForeignMethods(otherColorSpaceName, colorSpaceName);\n });\n\n installedColorSpaces.push(colorSpaceName);\n return color;\n};\n\ncolor.pluginList = [];\n\ncolor.use = function (plugin) {\n if (color.pluginList.indexOf(plugin) === -1) {\n this.pluginList.push(plugin);\n plugin(color);\n }\n return color;\n};\n\ncolor.installMethod = function (name, fn) {\n installedColorSpaces.forEach(function (colorSpace) {\n color[colorSpace].prototype[name] = fn;\n });\n return this;\n};\n\ncolor.installColorSpace('RGB', ['red', 'green', 'blue', 'alpha'], {\n hex: function () {\n var hexString = (Math.round(255 * this._red) * 0x10000 + Math.round(255 * this._green) * 0x100 + Math.round(255 * this._blue)).toString(16);\n return '#' + ('00000'.substr(0, 6 - hexString.length)) + hexString;\n },\n\n hexa: function () {\n var alphaString = Math.round(this._alpha * 255).toString(16);\n return '#' + '00'.substr(0, 2 - alphaString.length) + alphaString + this.hex().substr(1, 6);\n },\n\n css: function () {\n return 'rgb(' + Math.round(255 * this._red) + ',' + Math.round(255 * this._green) + ',' + Math.round(255 * this._blue) + ')';\n },\n\n cssa: function () {\n return 'rgba(' + Math.round(255 * this._red) + ',' + Math.round(255 * this._green) + ',' + Math.round(255 * this._blue) + ',' + this._alpha + ')';\n }\n});\n\nmodule.exports = color;\n","module.exports = function HSL(color) {\n color.use(require('./HSV'));\n\n color.installColorSpace('HSL', ['hue', 'saturation', 'lightness', 'alpha'], {\n hsv: function () {\n // Algorithm adapted from http://wiki.secondlife.com/wiki/Color_conversion_scripts\n var l = this._lightness * 2,\n s = this._saturation * ((l <= 1) ? l : 2 - l),\n saturation;\n\n // Avoid division by zero when l + s is very small (approaching black):\n if (l + s < 1e-9) {\n saturation = 0;\n } else {\n saturation = (2 * s) / (l + s);\n }\n\n return new color.HSV(this._hue, saturation, (l + s) / 2, this._alpha);\n },\n\n rgb: function () {\n return this.hsv().rgb();\n },\n\n fromRgb: function () { // Becomes one.color.RGB.prototype.hsv\n return this.hsv().hsl();\n }\n });\n};\n"]} \ No newline at end of file +{"version":3,"sources":["lib/color.js","lib/HSV.js","lib/HSL.js","minimal.js"],"names":["color","obj","Array","isArray","slice","length","RGB","lowerCased","toLowerCase","namedColors","matchCssSyntax","match","cssColorRegExp","colorSpaceName","toUpperCase","alpha","undef","parseFloat","hasHue","firstChannelDivisor","secondChannelDivisor","thirdChannelDivisor","Error","replace","hexMatch","parseInt","CMYK","cmykMatch","RegExp","percentageChannelRegExp","source","isColor","installedColorSpaces","channelRegExp","installColorSpace","propertyNames","config","installForeignMethods","targetColorSpaceName","sourceColorSpaceName","this","rgb","forEach","propertyName","shortName","charAt","value","isDelta","prop","hasOwnProperty","undefined","prototype","a1","args","arguments","i","propertyValue","_alpha","isNaN","join","_hue","Math","floor","methodName","hex","equals","otherColor","epsilon","abs","toJSON","concat","map","matchFromColorSpace","toString","constructor","otherPropertyName","otherColorSpaceName","push","pluginList","use","plugin","indexOf","installMethod","name","fn","colorSpace","hexString","round","_red","_green","_blue","substr","hexa","alphaString","css","cssa","color_1","HSV","red","green","blue","hue","saturation","_saturation","_value","min","f","p","q","t","hsl","l","sv","svDivisor","HSL","fromRgb","max","delta","require$$0","hsv","_lightness","s","require$$1","require$$2"],"mappings":"sMAgBA,SAASA,GAAMC,GACX,GAAIC,MAAMC,QAAQF,GAAM,CACpB,GAAsB,gBAAXA,GAAI,IAA4C,kBAAlBD,GAAMC,EAAI,IAE/C,MAAO,IAAID,GAAMC,EAAI,IAAIA,EAAIG,MAAM,EAAGH,EAAII,QACvC,IAAmB,IAAfJ,EAAII,OAEX,MAAO,IAAIL,GAAMM,IAAIL,EAAI,GAAK,IAAKA,EAAI,GAAK,IAAKA,EAAI,GAAK,IAAKA,EAAI,GAAK,SAEzE,IAAmB,gBAARA,GAAkB,CAChC,GAAIM,GAAaN,EAAIO,aACjBR,GAAMS,YAAYF,KAClBN,EAAM,IAAMD,EAAMS,YAAYF,IAEf,gBAAfA,IACAN,EAAM,gBAGV,IAAIS,GAAiBT,EAAIU,MAAMC,EAC/B,IAAIF,EAAgB,CAChB,GAAIG,GAAiBH,EAAe,GAAGI,cACnCC,EAAQC,EAAMN,EAAe,IAAMA,EAAe,GAAKO,WAAWP,EAAe,IACjFQ,EAA+B,MAAtBL,EAAe,GACxBM,EAAsBT,EAAe,GAAK,IAAOQ,EAAS,IAAM,IAChEE,EAAwBV,EAAe,IAAMQ,EAAU,IAAM,IAC7DG,EAAuBX,EAAe,IAAMQ,EAAU,IAAM,GAChE,IAAIF,EAAMhB,EAAMa,IACZ,KAAM,IAAIS,OAAM,SAAWT,EAAiB,qBAEhD,OAAO,IAAIb,GAAMa,GACbI,WAAWP,EAAe,IAA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lB,EAAQC,EAAO,EAAI,EACvD,MACJ,KAAKD,GACDE,GAAOD,EAAOF,GAAOmB,EAAQ,EAAI,EAAI,CACrC,MACJ,KAAKjB,GACDC,GAAOH,EAAMC,GAASkB,EAAQ,EAAI,EAAI,EAI9C,MAAO,IAAIrH,GAAMiG,IAAII,EAAKC,EAAYxD,EAAON,KAAKiB,YCzF9DyD,EAAiB,SAAalH,GAC1BA,EAAM+E,IAAIuC,GAEVtH,EAAMkC,kBAAkB,OAAQ,MAAO,aAAc,YAAa,UAC9DqF,IAAK,WAED,GAEIjB,GAFAS,EAAsB,EAAlBvE,KAAKgF,WACTC,EAAIjF,KAAK+D,aAAgBQ,GAAK,EAAKA,EAAI,EAAIA,EAU/C,OALIT,GADAS,EAAIU,EAAI,KACK,EAEC,EAAIA,GAAMV,EAAIU,GAGzB,GAAIzH,GAAMiG,IAAIzD,KAAKoB,KAAM0C,GAAaS,EAAIU,GAAK,EAAGjF,KAAKiB,SAGlEhB,IAAK,WACD,MAAOD,MAAK+E,MAAM9E,OAGtB0E,QAAS,WACL,MAAO3E,MAAK+E,MAAMT,gBCzBbQ,GACZvC,IAAI2C,GACJ3C,IAAI4C","sourcesContent":["var installedColorSpaces = [],\n undef = function (obj) {\n return typeof obj === 'undefined';\n },\n channelRegExp = /\\s*(\\.\\d+|\\d+(?:\\.\\d+)?)(%)?\\s*/,\n percentageChannelRegExp = /\\s*(\\.\\d+|100|\\d?\\d(?:\\.\\d+)?)%\\s*/,\n alphaChannelRegExp = /\\s*(\\.\\d+|\\d+(?:\\.\\d+)?)\\s*/,\n cssColorRegExp = new RegExp(\n '^(rgb|hsl|hsv)a?' +\n '\\\\(' +\n channelRegExp.source + ',' +\n channelRegExp.source + ',' +\n channelRegExp.source +\n '(?:,' + alphaChannelRegExp.source + ')?' +\n '\\\\)$', 'i');\n\nfunction color(obj) {\n if (Array.isArray(obj)) {\n if (typeof obj[0] === 'string' && typeof color[obj[0]] === 'function') {\n // Assumed array from .toJSON()\n return new color[obj[0]](obj.slice(1, obj.length));\n } else if (obj.length === 4) {\n // Assumed 4 element int RGB array from canvas with all channels [0;255]\n return new color.RGB(obj[0] / 255, obj[1] / 255, obj[2] / 255, obj[3] / 255);\n }\n } else if (typeof obj === 'string') {\n var lowerCased = obj.toLowerCase();\n if (color.namedColors[lowerCased]) {\n obj = '#' + color.namedColors[lowerCased];\n }\n if (lowerCased === 'transparent') {\n obj = 'rgba(0,0,0,0)';\n }\n // Test for CSS rgb(....) string\n var matchCssSyntax = obj.match(cssColorRegExp);\n if (matchCssSyntax) {\n var colorSpaceName = matchCssSyntax[1].toUpperCase(),\n alpha = undef(matchCssSyntax[8]) ? matchCssSyntax[8] : parseFloat(matchCssSyntax[8]),\n hasHue = colorSpaceName[0] === 'H',\n firstChannelDivisor = matchCssSyntax[3] ? 100 : (hasHue ? 360 : 255),\n secondChannelDivisor = (matchCssSyntax[5] || hasHue) ? 100 : 255,\n thirdChannelDivisor = (matchCssSyntax[7] || hasHue) ? 100 : 255;\n if (undef(color[colorSpaceName])) {\n throw new Error('color.' + colorSpaceName + ' is not installed.');\n }\n return new color[colorSpaceName](\n parseFloat(matchCssSyntax[2]) / firstChannelDivisor,\n parseFloat(matchCssSyntax[4]) / secondChannelDivisor,\n parseFloat(matchCssSyntax[6]) / thirdChannelDivisor,\n alpha\n );\n }\n // Assume hex syntax\n if (obj.length < 6) {\n // Allow CSS shorthand\n obj = obj.replace(/^#?([0-9a-f])([0-9a-f])([0-9a-f])$/i, '$1$1$2$2$3$3');\n }\n // Split obj into red, green, and blue components\n var hexMatch = obj.match(/^#?([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])$/i);\n if (hexMatch) {\n return new color.RGB(\n parseInt(hexMatch[1], 16) / 255,\n parseInt(hexMatch[2], 16) / 255,\n parseInt(hexMatch[3], 16) / 255\n );\n }\n\n // No match so far. Lets try the less likely ones\n if (color.CMYK) {\n var cmykMatch = obj.match(new RegExp(\n '^cmyk' +\n '\\\\(' +\n percentageChannelRegExp.source + ',' +\n percentageChannelRegExp.source + ',' +\n percentageChannelRegExp.source + ',' +\n percentageChannelRegExp.source +\n '\\\\)$', 'i'));\n if (cmykMatch) {\n return new color.CMYK(\n parseFloat(cmykMatch[1]) / 100,\n parseFloat(cmykMatch[2]) / 100,\n parseFloat(cmykMatch[3]) / 100,\n parseFloat(cmykMatch[4]) / 100\n );\n }\n }\n } else if (typeof obj === 'object' && obj.isColor) {\n return obj;\n }\n return false;\n}\n\ncolor.namedColors = {};\n\ncolor.installColorSpace = function (colorSpaceName, propertyNames, config) {\n color[colorSpaceName] = function (a1) { // ...\n var args = Array.isArray(a1) ? a1 : arguments;\n propertyNames.forEach(function (propertyName, i) {\n var propertyValue = args[i];\n if (propertyName === 'alpha') {\n this._alpha = (isNaN(propertyValue) || propertyValue > 1) ? 1 : (propertyValue < 0 ? 0 : propertyValue);\n } else {\n if (isNaN(propertyValue)) {\n throw new Error('[' + colorSpaceName + ']: Invalid color: (' + propertyNames.join(',') + ')');\n }\n if (propertyName === 'hue') {\n this._hue = propertyValue < 0 ? propertyValue - Math.floor(propertyValue) : propertyValue % 1;\n } else {\n this['_' + propertyName] = propertyValue < 0 ? 0 : (propertyValue > 1 ? 1 : propertyValue);\n }\n }\n }, this);\n };\n color[colorSpaceName].propertyNames = propertyNames;\n\n var prototype = color[colorSpaceName].prototype;\n\n ['valueOf', 'hex', 'hexa', 'css', 'cssa'].forEach(function (methodName) {\n prototype[methodName] = prototype[methodName] || (colorSpaceName === 'RGB' ? prototype.hex : function () {\n return this.rgb()[methodName]();\n });\n });\n\n prototype.isColor = true;\n\n prototype.equals = function (otherColor, epsilon) {\n if (undef(epsilon)) {\n epsilon = 1e-10;\n }\n\n otherColor = otherColor[colorSpaceName.toLowerCase()]();\n\n for (var i = 0; i < propertyNames.length; i = i + 1) {\n if (Math.abs(this['_' + propertyNames[i]] - otherColor['_' + propertyNames[i]]) > epsilon) {\n return false;\n }\n }\n\n return true;\n };\n\n prototype.toJSON = function () {\n return [colorSpaceName].concat(propertyNames.map(function (propertyName) {\n return this['_' + propertyName];\n }, this));\n };\n\n for (var propertyName in config) {\n if (config.hasOwnProperty(propertyName)) {\n var matchFromColorSpace = propertyName.match(/^from(.*)$/);\n if (matchFromColorSpace) {\n color[matchFromColorSpace[1].toUpperCase()].prototype[colorSpaceName.toLowerCase()] = config[propertyName];\n } else {\n prototype[propertyName] = config[propertyName];\n }\n }\n }\n\n // It is pretty easy to implement the conversion to the same color space:\n prototype[colorSpaceName.toLowerCase()] = function () {\n return this;\n };\n prototype.toString = function () {\n return '[' + colorSpaceName + ' ' + propertyNames.map(function (propertyName) {\n return this['_' + propertyName];\n }, this).join(', ') + ']';\n };\n\n // Generate getters and setters\n propertyNames.forEach(function (propertyName) {\n var shortName = propertyName === 'black' ? 'k' : propertyName.charAt(0);\n prototype[propertyName] = prototype[shortName] = function (value, isDelta) {\n // Simple getter mode: color.red()\n if (typeof value === 'undefined') {\n return this['_' + propertyName];\n } else if (isDelta) {\n // Adjuster: color.red(+.2, true)\n return new this.constructor(propertyNames.map(function (otherPropertyName) {\n return this['_' + otherPropertyName] + (propertyName === otherPropertyName ? value : 0);\n }, this));\n } else {\n // Setter: color.red(.2);\n return new this.constructor(propertyNames.map(function (otherPropertyName) {\n return (propertyName === otherPropertyName) ? value : this['_' + otherPropertyName];\n }, this));\n }\n };\n });\n\n function installForeignMethods(targetColorSpaceName, sourceColorSpaceName) {\n var obj = {};\n obj[sourceColorSpaceName.toLowerCase()] = function () {\n return this.rgb()[sourceColorSpaceName.toLowerCase()]();\n };\n color[sourceColorSpaceName].propertyNames.forEach(function (propertyName) {\n var shortName = propertyName === 'black' ? 'k' : propertyName.charAt(0);\n obj[propertyName] = obj[shortName] = function (value, isDelta) {\n return this[sourceColorSpaceName.toLowerCase()]()[propertyName](value, isDelta);\n };\n });\n for (var prop in obj) {\n if (obj.hasOwnProperty(prop) && color[targetColorSpaceName].prototype[prop] === undefined) {\n color[targetColorSpaceName].prototype[prop] = obj[prop];\n }\n }\n }\n\n installedColorSpaces.forEach(function (otherColorSpaceName) {\n installForeignMethods(colorSpaceName, otherColorSpaceName);\n installForeignMethods(otherColorSpaceName, colorSpaceName);\n });\n\n installedColorSpaces.push(colorSpaceName);\n return color;\n};\n\ncolor.pluginList = [];\n\ncolor.use = function (plugin) {\n if (color.pluginList.indexOf(plugin) === -1) {\n this.pluginList.push(plugin);\n plugin(color);\n }\n return color;\n};\n\ncolor.installMethod = function (name, fn) {\n installedColorSpaces.forEach(function (colorSpace) {\n color[colorSpace].prototype[name] = fn;\n });\n return this;\n};\n\ncolor.installColorSpace('RGB', ['red', 'green', 'blue', 'alpha'], {\n hex: function () {\n var hexString = (Math.round(255 * this._red) * 0x10000 + Math.round(255 * this._green) * 0x100 + Math.round(255 * this._blue)).toString(16);\n return '#' + ('00000'.substr(0, 6 - hexString.length)) + hexString;\n },\n\n hexa: function () {\n var alphaString = Math.round(this._alpha * 255).toString(16);\n return '#' + '00'.substr(0, 2 - alphaString.length) + alphaString + this.hex().substr(1, 6);\n },\n\n css: function () {\n return 'rgb(' + Math.round(255 * this._red) + ',' + Math.round(255 * this._green) + ',' + Math.round(255 * this._blue) + ')';\n },\n\n cssa: function () {\n return 'rgba(' + Math.round(255 * this._red) + ',' + Math.round(255 * this._green) + ',' + Math.round(255 * this._blue) + ',' + this._alpha + ')';\n }\n});\n\nmodule.exports = color;\n","module.exports = function HSV(color) {\n color.installColorSpace('HSV', ['hue', 'saturation', 'value', 'alpha'], {\n rgb: function () {\n var hue = this._hue,\n saturation = this._saturation,\n value = this._value,\n i = Math.min(5, Math.floor(hue * 6)),\n f = hue * 6 - i,\n p = value * (1 - saturation),\n q = value * (1 - f * saturation),\n t = value * (1 - (1 - f) * saturation),\n red,\n green,\n blue;\n switch (i) {\n case 0:\n red = value;\n green = t;\n blue = p;\n break;\n case 1:\n red = q;\n green = value;\n blue = p;\n break;\n case 2:\n red = p;\n green = value;\n blue = t;\n break;\n case 3:\n red = p;\n green = q;\n blue = value;\n break;\n case 4:\n red = t;\n green = p;\n blue = value;\n break;\n case 5:\n red = value;\n green = p;\n blue = q;\n break;\n }\n return new color.RGB(red, green, blue, this._alpha);\n },\n\n hsl: function () {\n var l = (2 - this._saturation) * this._value,\n sv = this._saturation * this._value,\n svDivisor = l <= 1 ? l : (2 - l),\n saturation;\n\n // Avoid division by zero when lightness approaches zero:\n if (svDivisor < 1e-9) {\n saturation = 0;\n } else {\n saturation = sv / svDivisor;\n }\n return new color.HSL(this._hue, saturation, l / 2, this._alpha);\n },\n\n fromRgb: function () { // Becomes one.color.RGB.prototype.hsv\n var red = this._red,\n green = this._green,\n blue = this._blue,\n max = Math.max(red, green, blue),\n min = Math.min(red, green, blue),\n delta = max - min,\n hue,\n saturation = (max === 0) ? 0 : (delta / max),\n value = max;\n if (delta === 0) {\n hue = 0;\n } else {\n switch (max) {\n case red:\n hue = (green - blue) / delta / 6 + (green < blue ? 1 : 0);\n break;\n case green:\n hue = (blue - red) / delta / 6 + 1 / 3;\n break;\n case blue:\n hue = (red - green) / delta / 6 + 2 / 3;\n break;\n }\n }\n return new color.HSV(hue, saturation, value, this._alpha);\n }\n });\n};\n","module.exports = function HSL(color) {\n color.use(require('./HSV'));\n\n color.installColorSpace('HSL', ['hue', 'saturation', 'lightness', 'alpha'], {\n hsv: function () {\n // Algorithm adapted from http://wiki.secondlife.com/wiki/Color_conversion_scripts\n var l = this._lightness * 2,\n s = this._saturation * ((l <= 1) ? l : 2 - l),\n saturation;\n\n // Avoid division by zero when l + s is very small (approaching black):\n if (l + s < 1e-9) {\n saturation = 0;\n } else {\n saturation = (2 * s) / (l + s);\n }\n\n return new color.HSV(this._hue, saturation, (l + s) / 2, this._alpha);\n },\n\n rgb: function () {\n return this.hsv().rgb();\n },\n\n fromRgb: function () { // Becomes one.color.RGB.prototype.hsv\n return this.hsv().hsl();\n }\n });\n};\n","module.exports = require('./lib/color')\n .use(require('./lib/HSV'))\n .use(require('./lib/HSL'));\n"]} \ No newline at end of file diff --git a/package.json b/package.json index e958b38..db4f42a 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "onecolor", "description": "Javascript color object with implicit color space conversions. Supports RGB, HSV, HSL and CMYK with alpha channel.", "repository": "git@github.com:One-com/one-color.git", - "version": "3.0.4", + "version": "3.0.5", "license": "BSD-2-Clause", "keywords": [ "color", From 1816ec564e1a4998db9e39168e563ddb2dcbce5b Mon Sep 17 00:00:00 2001 From: Andreas Lind Date: Sat, 24 Mar 2018 01:35:04 +0100 Subject: [PATCH 07/26] Update author's email --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index db4f42a..7303449 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ }, { "name": "Andreas Lind", - "email": "andreas@one.com" + "email": "andreaslindpetersen@gmail.com" } ], "devDependencies": { From d6937fb4d1769e45eb4e37f2a4283a2a2a841e93 Mon Sep 17 00:00:00 2001 From: Darek Kay Date: Thu, 13 Sep 2018 08:27:21 +0200 Subject: [PATCH 08/26] Add luminance, contrast and darkness values Add plugins to calculate the luminance, contrast ratio and darkness values for colors. This code is based on the [color](https://github.com/Qix-/color/blob/master/index.js) library's code, which unfortunately is not available for browser usage. --- index.js | 4 ++++ lib/plugins/contrast.js | 15 +++++++++++++++ lib/plugins/isDark.js | 10 ++++++++++ lib/plugins/isLight.js | 8 ++++++++ lib/plugins/luminance.js | 12 ++++++++++++ test/contrast.js | 18 ++++++++++++++++++ test/isDark.js | 15 +++++++++++++++ test/isLight.js | 15 +++++++++++++++ test/luminance.js | 13 +++++++++++++ 9 files changed, 110 insertions(+) create mode 100644 lib/plugins/contrast.js create mode 100644 lib/plugins/isDark.js create mode 100644 lib/plugins/isLight.js create mode 100644 lib/plugins/luminance.js create mode 100644 test/contrast.js create mode 100644 test/isDark.js create mode 100644 test/isLight.js create mode 100644 test/luminance.js diff --git a/index.js b/index.js index 54446a1..05a954f 100644 --- a/index.js +++ b/index.js @@ -8,10 +8,14 @@ module.exports = require('./lib/color') // Convenience functions .use(require('./lib/plugins/namedColors')) .use(require('./lib/plugins/clearer.js')) + .use(require('./lib/plugins/contrast.js')) .use(require('./lib/plugins/darken.js')) .use(require('./lib/plugins/desaturate.js')) .use(require('./lib/plugins/grayscale.js')) + .use(require('./lib/plugins/isDark.js')) + .use(require('./lib/plugins/isLight.js')) .use(require('./lib/plugins/lighten.js')) + .use(require('./lib/plugins/luminance.js')) .use(require('./lib/plugins/mix.js')) .use(require('./lib/plugins/negate.js')) .use(require('./lib/plugins/opaquer.js')) diff --git a/lib/plugins/contrast.js b/lib/plugins/contrast.js new file mode 100644 index 0000000..e1e210d --- /dev/null +++ b/lib/plugins/contrast.js @@ -0,0 +1,15 @@ +module.exports = function contrast(color) { + // http://www.w3.org/TR/WCAG20/#contrast-ratiodef + + color.use(require('./luminance')); + + color.installMethod('contrast', function (color2) { + var lum1 = this.luminance(); + var lum2 = color2.luminance(); + if (lum1 > lum2) { + return (lum1 + 0.05) / (lum2 + 0.05); + } + + return (lum2 + 0.05) / (lum1 + 0.05); + }); +}; diff --git a/lib/plugins/isDark.js b/lib/plugins/isDark.js new file mode 100644 index 0000000..c6c0289 --- /dev/null +++ b/lib/plugins/isDark.js @@ -0,0 +1,10 @@ +module.exports = function isDark(color) { + + color.installMethod('isDark', function () { + var rgb = this.rgb(); + + // YIQ equation from http://24ways.org/2010/calculating-color-contrast + var yiq = (rgb._red * 255 * 299 + rgb._green * 255 * 587 + rgb._blue * 255 * 114) / 1000; + return yiq < 128; + }); +}; diff --git a/lib/plugins/isLight.js b/lib/plugins/isLight.js new file mode 100644 index 0000000..8463cbe --- /dev/null +++ b/lib/plugins/isLight.js @@ -0,0 +1,8 @@ +module.exports = function isLight(color) { + + color.use(require('./isDark')); + + color.installMethod('isLight', function () { + return !this.isDark(); + }); +}; diff --git a/lib/plugins/luminance.js b/lib/plugins/luminance.js new file mode 100644 index 0000000..ea6b4ca --- /dev/null +++ b/lib/plugins/luminance.js @@ -0,0 +1,12 @@ +module.exports = function luminance(color) { + // http://www.w3.org/TR/WCAG20/#relativeluminancedef + + function channelLuminance(value) { + return (value <= 0.03928) ? value / 12.92 : Math.pow(((value + 0.055) / 1.055), 2.4); + } + + color.installMethod('luminance', function () { + var rgb = this.rgb(); + return 0.2126 * channelLuminance(rgb._red) + 0.7152 * channelLuminance(rgb._green) + 0.0722 * channelLuminance(rgb._blue); + }); +}; diff --git a/test/contrast.js b/test/contrast.js new file mode 100644 index 0000000..634dffb --- /dev/null +++ b/test/contrast.js @@ -0,0 +1,18 @@ +var color = require('../'); + +var expect = require('unexpected').clone(); + +function contrast(color1, color2) { + var contrast = color(color1).contrast(color(color2)); + return Math.round(contrast * 100) / 100; +} + +describe('contrast', function () { + it('should return the contrast for colors', function () { + expect(contrast('white', 'black'), 'to equal', 21); + expect(contrast('white', 'red'), 'to equal', 4); + expect(contrast('red', 'white'), 'to equal', 4); + expect(contrast('005aff', 'eeeeee'), 'to equal', 4.63); + expect(contrast('blue', 'blue'), 'to equal', 1); + }); +}); diff --git a/test/isDark.js b/test/isDark.js new file mode 100644 index 0000000..dfb4b2a --- /dev/null +++ b/test/isDark.js @@ -0,0 +1,15 @@ +var color = require('../'); + +var expect = require('unexpected').clone(); + +describe('isDark', function () { + it('should return true, if the color is dark', function () { + expect(color('black').isDark(), 'to equal', true); + expect(color('white').isDark(), 'to equal', false); + expect(color('blue').isDark(), 'to equal', true); + expect(color('darkgreen').isDark(), 'to equal', true); + expect(color('pink').isDark(), 'to equal', false); + expect(color('goldenrod').isDark(), 'to equal', false); + expect(color('red').isDark(), 'to equal', true); + }); +}); diff --git a/test/isLight.js b/test/isLight.js new file mode 100644 index 0000000..ace581d --- /dev/null +++ b/test/isLight.js @@ -0,0 +1,15 @@ +var color = require('../'); + +var expect = require('unexpected').clone(); + +describe('isLight', function () { + it('should return true, if the color is light', function () { + expect(color('black').isLight(), 'to equal', false); + expect(color('white').isLight(), 'to equal', true); + expect(color('blue').isLight(), 'to equal', false); + expect(color('darkgreen').isLight(), 'to equal', false); + expect(color('pink').isLight(), 'to equal', true); + expect(color('goldenrod').isLight(), 'to equal', true); + expect(color('red').isLight(), 'to equal', false); + }); +}); diff --git a/test/luminance.js b/test/luminance.js new file mode 100644 index 0000000..a287ba1 --- /dev/null +++ b/test/luminance.js @@ -0,0 +1,13 @@ +var color = require('../'); + +var expect = require('unexpected').clone(); + +describe('luminance', function () { + it('should return the luminance for colors', function () { + expect(color('white').luminance(), 'to equal', 1); + expect(color('black').luminance(), 'to equal', 0); + expect(color('ff0000').luminance(), 'to equal', 0.2126); + expect(color('00ff00').luminance(), 'to equal', 0.7152); + expect(color('0000ff').luminance(), 'to equal', 0.0722); + }); +}); From a5fb8958e88775deab8b636a902fb5e269e8abb7 Mon Sep 17 00:00:00 2001 From: Andreas Lind Date: Fri, 14 Sep 2018 14:02:11 +0200 Subject: [PATCH 09/26] 3.1.0 --- one-color-all.js | 2 +- one-color-all.map | 2 +- package-lock.json | 2577 +++++++++++++++++++++++++++++++++++++++++++++ package.json | 2 +- 4 files changed, 2580 insertions(+), 3 deletions(-) create mode 100644 package-lock.json diff --git a/one-color-all.js b/one-color-all.js index 915ff88..7dde931 100644 --- a/one-color-all.js +++ b/one-color-all.js @@ -1,2 +1,2 @@ -!function(e,a){"object"==typeof exports&&"undefined"!=typeof module?module.exports=a():"function"==typeof define&&define.amd?define(a):(e.one=e.one||{},e.one.color=a())}(this,function(){"use strict";function e(a){if(Array.isArray(a)){if("string"==typeof a[0]&&"function"==typeof e[a[0]])return new e[a[0]](a.slice(1,a.length));if(4===a.length)return new e.RGB(a[0]/255,a[1]/255,a[2]/255,a[3]/255)}else if("string"==typeof a){var r=a.toLowerCase();e.namedColors[r]&&(a="#"+e.namedColors[r]),"transparent"===r&&(a="rgba(0,0,0,0)");var o=a.match(i);if(o){var s=o[1].toUpperCase(),f=t(o[8])?o[8]:parseFloat(o[8]),u="H"===s[0],l=o[3]?100:u?360:255,h=o[5]||u?100:255,c=o[7]||u?100:255;if(t(e[s]))throw new Error("color."+s+" is not installed.");return new e[s](parseFloat(o[2])/l,parseFloat(o[4])/h,parseFloat(o[6])/c,f)}a.length<6&&(a=a.replace(/^#?([0-9a-f])([0-9a-f])([0-9a-f])$/i,"$1$1$2$2$3$3"));var d=a.match(/^#?([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])$/i);if(d)return new e.RGB(parseInt(d[1],16)/255,parseInt(d[2],16)/255,parseInt(d[3],16)/255);if(e.CMYK){var b=a.match(new RegExp("^cmyk\\("+n.source+","+n.source+","+n.source+","+n.source+"\\)$","i"));if(b)return new e.CMYK(parseFloat(b[1])/100,parseFloat(b[2])/100,parseFloat(b[3])/100,parseFloat(b[4])/100)}}else if("object"==typeof a&&a.isColor)return a;return!1}var a=[],t=function(e){return void 0===e},r=/\s*(\.\d+|\d+(?:\.\d+)?)(%)?\s*/,n=/\s*(\.\d+|100|\d?\d(?:\.\d+)?)%\s*/,i=new RegExp("^(rgb|hsl|hsv)a?\\("+r.source+","+r.source+","+r.source+"(?:,"+/\s*(\.\d+|\d+(?:\.\d+)?)\s*/.source+")?\\)$","i");e.namedColors={},e.installColorSpace=function(r,n,i){function o(a,t){var r={};r[t.toLowerCase()]=function(){return this.rgb()[t.toLowerCase()]()},e[t].propertyNames.forEach(function(e){var a="black"===e?"k":e.charAt(0);r[e]=r[a]=function(a,r){return this[t.toLowerCase()]()[e](a,r)}});for(var n in r)r.hasOwnProperty(n)&&void 0===e[a].prototype[n]&&(e[a].prototype[n]=r[n])}e[r]=function(e){var a=Array.isArray(e)?e:arguments;n.forEach(function(e,t){var i=a[t];if("alpha"===e)this._alpha=isNaN(i)||i>1?1:i<0?0:i;else{if(isNaN(i))throw new Error("["+r+"]: Invalid color: ("+n.join(",")+")");"hue"===e?this._hue=i<0?i-Math.floor(i):i%1:this["_"+e]=i<0?0:i>1?1:i}},this)},e[r].propertyNames=n;var s=e[r].prototype;["valueOf","hex","hexa","css","cssa"].forEach(function(e){s[e]=s[e]||("RGB"===r?s.hex:function(){return this.rgb()[e]()})}),s.isColor=!0,s.equals=function(e,a){t(a)&&(a=1e-10),e=e[r.toLowerCase()]();for(var i=0;ia)return!1;return!0},s.toJSON=function(){return[r].concat(n.map(function(e){return this["_"+e]},this))};for(var f in i)if(i.hasOwnProperty(f)){var u=f.match(/^from(.*)$/);u?e[u[1].toUpperCase()].prototype[r.toLowerCase()]=i[f]:s[f]=i[f]}return s[r.toLowerCase()]=function(){return this},s.toString=function(){return"["+r+" "+n.map(function(e){return this["_"+e]},this).join(", ")+"]"},n.forEach(function(e){var a="black"===e?"k":e.charAt(0);s[e]=s[a]=function(a,t){return void 0===a?this["_"+e]:t?new this.constructor(n.map(function(t){return this["_"+t]+(e===t?a:0)},this)):new this.constructor(n.map(function(t){return e===t?a:this["_"+t]},this))}}),a.forEach(function(e){o(r,e),o(e,r)}),a.push(r),e},e.pluginList=[],e.use=function(a){return-1===e.pluginList.indexOf(a)&&(this.pluginList.push(a),a(e)),e},e.installMethod=function(t,r){return a.forEach(function(a){e[a].prototype[t]=r}),this},e.installColorSpace("RGB",["red","green","blue","alpha"],{hex:function(){var e=(65536*Math.round(255*this._red)+256*Math.round(255*this._green)+Math.round(255*this._blue)).toString(16);return"#"+"00000".substr(0,6-e.length)+e},hexa:function(){var e=Math.round(255*this._alpha).toString(16);return"#"+"00".substr(0,2-e.length)+e+this.hex().substr(1,6)},css:function(){return"rgb("+Math.round(255*this._red)+","+Math.round(255*this._green)+","+Math.round(255*this._blue)+")"},cssa:function(){return"rgba("+Math.round(255*this._red)+","+Math.round(255*this._green)+","+Math.round(255*this._blue)+","+this._alpha+")"}});var o=e,s=function(e){e.installColorSpace("XYZ",["x","y","z","alpha"],{fromRgb:function(){var a=function(e){return e>.04045?Math.pow((e+.055)/1.055,2.4):e/12.92},t=a(this._red),r=a(this._green),n=a(this._blue);return new e.XYZ(.4124564*t+.3575761*r+.1804375*n,.2126729*t+.7151522*r+.072175*n,.0193339*t+.119192*r+.9503041*n,this._alpha)},rgb:function(){var a=this._x,t=this._y,r=this._z,n=function(e){return e>.0031308?1.055*Math.pow(e,1/2.4)-.055:12.92*e};return new e.RGB(n(3.2404542*a+-1.5371385*t+-.4985314*r),n(-.969266*a+1.8760108*t+.041556*r),n(.0556434*a+-.2040259*t+1.0572252*r),this._alpha)},lab:function(){var a=function(e){return e>.008856?Math.pow(e,1/3):7.787037*e+4/29},t=a(this._x/95.047),r=a(this._y/100),n=a(this._z/108.883);return new e.LAB(116*r-16,500*(t-r),200*(r-n),this._alpha)}})},f=function(e){e.use(s),e.installColorSpace("LAB",["l","a","b","alpha"],{fromRgb:function(){return this.xyz().lab()},rgb:function(){return this.xyz().rgb()},xyz:function(){var a=function(e){var a=Math.pow(e,3);return a>.008856?a:(e-16/116)/7.87},t=(this._l+16)/116,r=this._a/500+t,n=t-this._b/200;return new e.XYZ(95.047*a(r),100*a(t),108.883*a(n),this._alpha)}})},u=function(e){e.installColorSpace("HSV",["hue","saturation","value","alpha"],{rgb:function(){var a,t,r,n=this._hue,i=this._saturation,o=this._value,s=Math.min(5,Math.floor(6*n)),f=6*n-s,u=o*(1-i),l=o*(1-f*i),h=o*(1-(1-f)*i);switch(s){case 0:a=o,t=h,r=u;break;case 1:a=l,t=o,r=u;break;case 2:a=u,t=o,r=h;break;case 3:a=u,t=l,r=o;break;case 4:a=h,t=u,r=o;break;case 5:a=o,t=u,r=l}return new e.RGB(a,t,r,this._alpha)},hsl:function(){var a,t=(2-this._saturation)*this._value,r=this._saturation*this._value,n=t<=1?t:2-t;return a=n<1e-9?0:r/n,new e.HSL(this._hue,a,t/2,this._alpha)},fromRgb:function(){var a,t=this._red,r=this._green,n=this._blue,i=Math.max(t,r,n),o=Math.min(t,r,n),s=i-o,f=0===i?0:s/i,u=i;if(0===s)a=0;else switch(i){case t:a=(r-n)/s/6+(rt[e]?r[e]=(a[e]-t[e])/(1-t[e]):a[e]>t[e]?r[e]=(t[e]-a[e])/t[e]:r[e]=0}),r._red>r._green?r._red>r._blue?a._alpha=r._red:a._alpha=r._blue:r._green>r._blue?a._alpha=r._green:a._alpha=r._blue,a._alpha<1e-10?a:(n.forEach(function(e){a[e]=(a[e]-t[e])/a._alpha+t[e]}),a._alpha*=r._alpha,a)})};return o.use(s).use(f).use(u).use(l).use(h).use(c).use(d).use(b).use(p).use(g).use(_).use(m).use(w).use(y).use(v).use(k).use(M)}); +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e.one=e.one||{},e.one.color=t())}(this,function(){"use strict";function e(t){if(Array.isArray(t)){if("string"==typeof t[0]&&"function"==typeof e[t[0]])return new e[t[0]](t.slice(1,t.length));if(4===t.length)return new e.RGB(t[0]/255,t[1]/255,t[2]/255,t[3]/255)}else if("string"==typeof t){var r=t.toLowerCase();e.namedColors[r]&&(t="#"+e.namedColors[r]),"transparent"===r&&(t="rgba(0,0,0,0)");var o=t.match(i);if(o){var s=o[1].toUpperCase(),f=a(o[8])?o[8]:parseFloat(o[8]),u="H"===s[0],l=o[3]?100:u?360:255,h=o[5]||u?100:255,c=o[7]||u?100:255;if(a(e[s]))throw new Error("color."+s+" is not installed.");return new e[s](parseFloat(o[2])/l,parseFloat(o[4])/h,parseFloat(o[6])/c,f)}t.length<6&&(t=t.replace(/^#?([0-9a-f])([0-9a-f])([0-9a-f])$/i,"$1$1$2$2$3$3"));var d=t.match(/^#?([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])$/i);if(d)return new e.RGB(parseInt(d[1],16)/255,parseInt(d[2],16)/255,parseInt(d[3],16)/255);if(e.CMYK){var b=t.match(new RegExp("^cmyk\\("+n.source+","+n.source+","+n.source+","+n.source+"\\)$","i"));if(b)return new e.CMYK(parseFloat(b[1])/100,parseFloat(b[2])/100,parseFloat(b[3])/100,parseFloat(b[4])/100)}}else if("object"==typeof t&&t.isColor)return t;return!1}var t=[],a=function(e){return void 0===e},r=/\s*(\.\d+|\d+(?:\.\d+)?)(%)?\s*/,n=/\s*(\.\d+|100|\d?\d(?:\.\d+)?)%\s*/,i=new RegExp("^(rgb|hsl|hsv)a?\\("+r.source+","+r.source+","+r.source+"(?:,"+/\s*(\.\d+|\d+(?:\.\d+)?)\s*/.source+")?\\)$","i");e.namedColors={},e.installColorSpace=function(r,n,i){function o(t,a){var r={};r[a.toLowerCase()]=function(){return this.rgb()[a.toLowerCase()]()},e[a].propertyNames.forEach(function(e){var t="black"===e?"k":e.charAt(0);r[e]=r[t]=function(t,r){return this[a.toLowerCase()]()[e](t,r)}});for(var n in r)r.hasOwnProperty(n)&&void 0===e[t].prototype[n]&&(e[t].prototype[n]=r[n])}e[r]=function(e){var t=Array.isArray(e)?e:arguments;n.forEach(function(e,a){var i=t[a];if("alpha"===e)this._alpha=isNaN(i)||i>1?1:i<0?0:i;else{if(isNaN(i))throw new Error("["+r+"]: Invalid color: ("+n.join(",")+")");"hue"===e?this._hue=i<0?i-Math.floor(i):i%1:this["_"+e]=i<0?0:i>1?1:i}},this)},e[r].propertyNames=n;var s=e[r].prototype;["valueOf","hex","hexa","css","cssa"].forEach(function(e){s[e]=s[e]||("RGB"===r?s.hex:function(){return this.rgb()[e]()})}),s.isColor=!0,s.equals=function(e,t){a(t)&&(t=1e-10),e=e[r.toLowerCase()]();for(var i=0;it)return!1;return!0},s.toJSON=function(){return[r].concat(n.map(function(e){return this["_"+e]},this))};for(var f in i)if(i.hasOwnProperty(f)){var u=f.match(/^from(.*)$/);u?e[u[1].toUpperCase()].prototype[r.toLowerCase()]=i[f]:s[f]=i[f]}return s[r.toLowerCase()]=function(){return this},s.toString=function(){return"["+r+" "+n.map(function(e){return this["_"+e]},this).join(", ")+"]"},n.forEach(function(e){var t="black"===e?"k":e.charAt(0);s[e]=s[t]=function(t,a){return void 0===t?this["_"+e]:a?new this.constructor(n.map(function(a){return this["_"+a]+(e===a?t:0)},this)):new this.constructor(n.map(function(a){return e===a?t:this["_"+a]},this))}}),t.forEach(function(e){o(r,e),o(e,r)}),t.push(r),e},e.pluginList=[],e.use=function(t){return-1===e.pluginList.indexOf(t)&&(this.pluginList.push(t),t(e)),e},e.installMethod=function(a,r){return t.forEach(function(t){e[t].prototype[a]=r}),this},e.installColorSpace("RGB",["red","green","blue","alpha"],{hex:function(){var e=(65536*Math.round(255*this._red)+256*Math.round(255*this._green)+Math.round(255*this._blue)).toString(16);return"#"+"00000".substr(0,6-e.length)+e},hexa:function(){var e=Math.round(255*this._alpha).toString(16);return"#"+"00".substr(0,2-e.length)+e+this.hex().substr(1,6)},css:function(){return"rgb("+Math.round(255*this._red)+","+Math.round(255*this._green)+","+Math.round(255*this._blue)+")"},cssa:function(){return"rgba("+Math.round(255*this._red)+","+Math.round(255*this._green)+","+Math.round(255*this._blue)+","+this._alpha+")"}});var o=e,s=function(e){e.installColorSpace("XYZ",["x","y","z","alpha"],{fromRgb:function(){var t=function(e){return e>.04045?Math.pow((e+.055)/1.055,2.4):e/12.92},a=t(this._red),r=t(this._green),n=t(this._blue);return new e.XYZ(.4124564*a+.3575761*r+.1804375*n,.2126729*a+.7151522*r+.072175*n,.0193339*a+.119192*r+.9503041*n,this._alpha)},rgb:function(){var t=this._x,a=this._y,r=this._z,n=function(e){return e>.0031308?1.055*Math.pow(e,1/2.4)-.055:12.92*e};return new e.RGB(n(3.2404542*t+-1.5371385*a+-.4985314*r),n(-.969266*t+1.8760108*a+.041556*r),n(.0556434*t+-.2040259*a+1.0572252*r),this._alpha)},lab:function(){var t=function(e){return e>.008856?Math.pow(e,1/3):7.787037*e+4/29},a=t(this._x/95.047),r=t(this._y/100),n=t(this._z/108.883);return new e.LAB(116*r-16,500*(a-r),200*(r-n),this._alpha)}})},f=function(e){e.use(s),e.installColorSpace("LAB",["l","a","b","alpha"],{fromRgb:function(){return this.xyz().lab()},rgb:function(){return this.xyz().rgb()},xyz:function(){var t=function(e){var t=Math.pow(e,3);return t>.008856?t:(e-16/116)/7.87},a=(this._l+16)/116,r=this._a/500+a,n=a-this._b/200;return new e.XYZ(95.047*t(r),100*t(a),108.883*t(n),this._alpha)}})},u=function(e){e.installColorSpace("HSV",["hue","saturation","value","alpha"],{rgb:function(){var t,a,r,n=this._hue,i=this._saturation,o=this._value,s=Math.min(5,Math.floor(6*n)),f=6*n-s,u=o*(1-i),l=o*(1-f*i),h=o*(1-(1-f)*i);switch(s){case 0:t=o,a=h,r=u;break;case 1:t=l,a=o,r=u;break;case 2:t=u,a=o,r=h;break;case 3:t=u,a=l,r=o;break;case 4:t=h,a=u,r=o;break;case 5:t=o,a=u,r=l}return new e.RGB(t,a,r,this._alpha)},hsl:function(){var t,a=(2-this._saturation)*this._value,r=this._saturation*this._value,n=a<=1?a:2-a;return t=n<1e-9?0:r/n,new e.HSL(this._hue,t,a/2,this._alpha)},fromRgb:function(){var t,a=this._red,r=this._green,n=this._blue,i=Math.max(a,r,n),o=Math.min(a,r,n),s=i-o,f=0===i?0:s/i,u=i;if(0===s)t=0;else switch(i){case a:t=(r-n)/s/6+(ra?(t+.05)/(a+.05):(a+.05)/(t+.05)})},p=function(e){e.use(l),e.installMethod("darken",function(e){return this.lightness(isNaN(e)?-.1:-e,!0)})},_=function(e){e.use(l),e.installMethod("desaturate",function(e){return this.saturation(isNaN(e)?-.1:-e,!0)})},m=function(e){function t(){var t=this.rgb(),a=.3*t._red+.59*t._green+.11*t._blue;return new e.RGB(a,a,a,t._alpha)}e.installMethod("greyscale",t).installMethod("grayscale",t)},w=function(e){e.installMethod("isDark",function(){var e=this.rgb();return(255*e._red*299+255*e._green*587+255*e._blue*114)/1e3<128})},y=function(e){e.use(w),e.installMethod("isLight",function(){return!this.isDark()})},v=function(e){e.use(l),e.installMethod("lighten",function(e){return this.lightness(isNaN(e)?.1:e,!0)})},k=function(e){e.installMethod("mix",function(t,a){t=e(t).rgb(),a=1-(isNaN(a)?.5:a);var r=2*a-1,n=this._alpha-t._alpha,i=((r*n==-1?r:(r+n)/(1+r*n))+1)/2,o=1-i,s=this.rgb();return new e.RGB(s._red*i+t._red*o,s._green*i+t._green*o,s._blue*i+t._blue*o,s._alpha*a+t._alpha*(1-a))})},M=function(e){e.installMethod("negate",function(){var t=this.rgb();return new e.RGB(1-t._red,1-t._green,1-t._blue,this._alpha)})},C=function(e){e.installMethod("opaquer",function(e){return this.alpha(isNaN(e)?.1:e,!0)})},N=function(e){e.use(l),e.installMethod("rotate",function(e){return this.hue((e||0)/360,!0)})},x=function(e){e.use(l),e.installMethod("saturate",function(e){return this.saturation(isNaN(e)?.1:e,!0)})},R=function(e){e.installMethod("toAlpha",function(e){var t=this.rgb(),a=e(e).rgb(),r=new e.RGB(0,0,0,t._alpha),n=["_red","_green","_blue"];return n.forEach(function(e){t[e]<1e-10?r[e]=t[e]:t[e]>a[e]?r[e]=(t[e]-a[e])/(1-a[e]):t[e]>a[e]?r[e]=(a[e]-t[e])/a[e]:r[e]=0}),r._red>r._green?r._red>r._blue?t._alpha=r._red:t._alpha=r._blue:r._green>r._blue?t._alpha=r._green:t._alpha=r._blue,t._alpha<1e-10?t:(n.forEach(function(e){t[e]=(t[e]-a[e])/t._alpha+a[e]}),t._alpha*=r._alpha,t)})};return o.use(s).use(f).use(u).use(l).use(h).use(c).use(d).use(g).use(p).use(_).use(m).use(w).use(y).use(v).use(b).use(k).use(M).use(C).use(N).use(x).use(R)}); //# sourceMappingURL=one-color-all.map diff --git a/one-color-all.map b/one-color-all.map index 2ede1f2..c613edf 100644 --- a/one-color-all.map +++ b/one-color-all.map @@ -1 +1 @@ -{"version":3,"sources":["lib/color.js","lib/XYZ.js","lib/LAB.js","lib/HSV.js","lib/HSL.js","lib/CMYK.js","lib/plugins/namedColors.js","lib/plugins/clearer.js","lib/plugins/darken.js","lib/plugins/desaturate.js","lib/plugins/grayscale.js","lib/plugins/lighten.js","lib/plugins/mix.js","lib/plugins/negate.js","lib/plugins/opaquer.js","lib/plugins/rotate.js","lib/plugins/saturate.js","lib/plugins/toAlpha.js","index.js"],"names":["color","obj","Array","isArray","slice","length","RGB","lowerCased","toLowerCase","namedColors","matchCssSyntax","match","cssColorRegExp","colorSpaceName","toUpperCase","alpha","undef","parseFloat","hasHue","firstChannelDivisor","secondChannelDivisor","thirdChannelDivisor","Error","replace","hexMatch","parseInt","CMYK","cmykMatch","RegExp","percentageChannelRegExp","source","isColor","installedColorSpaces","channelRegExp","installColorSpace","propertyNames","config","installForeignMethods","targetColorSpaceName","sourceColorSpaceName","this","rgb","forEach","propertyName","shortName","charAt","value","isDelta","prop","hasOwnProperty","undefined","prototype","a1","args","arguments","i","propertyValue","_alpha","isNaN","join","_hue","Math","floor","methodName","hex","equals","otherColor","epsilon","abs","toJSON","concat","map","matchFromColorSpace","toString","constructor","otherPropertyName","otherColorSpaceName","push","pluginList","use","plugin","indexOf","installMethod","name","fn","colorSpace","hexString","round","_red","_green","_blue","substr","hexa","alphaString","css","cssa","color_1","XYZ","fromRgb","convert","channel","pow","r","g","b","x","_x","y","_y","z","_z","lab","LAB","require$$0","xyz","_l","_a","_b","HSV","red","green","blue","hue","saturation","_saturation","_value","min","f","p","q","t","hsl","l","sv","svDivisor","HSL","max","delta","hsv","_lightness","s","_cyan","_black","_magenta","_yellow","cyan","magenta","yellow","black","aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","blanchedalmond","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","darkblue","darkcyan","darkgoldenrod","darkgray","darkgrey","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgrey","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","lime","limegreen","linen","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellowgreen","clearer","amount","darken","lightness","desaturate","grayscale","gs","val","lighten","mix","weight","w","a","weight1","weight2","negate","opaquer","rotate","degrees","saturate","toAlpha","me","other","channels","require$$1","require$$2","require$$3","require$$4","require$$5","require$$6","require$$7","require$$8","require$$9","require$$10","require$$11","require$$12","require$$13","require$$14","require$$15","require$$16","require$$17"],"mappings":"sMAgBA,SAASA,GAAMC,GACX,GAAIC,MAAMC,QAAQF,GAAM,CACpB,GAAsB,gBAAXA,GAAI,IAA4C,kBAAlBD,GAAMC,EAAI,IAE/C,MAAO,IAAID,GAAMC,EAAI,IAAIA,EAAIG,MAAM,EAAGH,EAAII,QACvC,IAAmB,IAAfJ,EAAII,OAEX,MAAO,IAAIL,GAAMM,IAAIL,EAAI,GAAK,IAAKA,EAAI,GAAK,IAAKA,EAAI,GAAK,IAAKA,EAAI,GAAK,SAEzE,IAAmB,gBAARA,GAAkB,CAChC,GAAIM,GAAaN,EAAIO,aACjBR,GAAMS,YAAYF,KAClBN,EAAM,IAAMD,EAAMS,YAAYF,IAEf,gBAAfA,IACAN,EAAM,gBAGV,IAAIS,GAAiBT,EAAIU,MAAMC,EAC/B,IAAIF,EAAgB,CAChB,GAAIG,GAAiBH,EAAe,GAAGI,cACnCC,EAAQC,EAAMN,EAAe,I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wP,GACJxP,IAAIyP,GACJzP,IAAI0P,GACJ1P,IAAI2P","sourcesContent":["var installedColorSpaces = [],\n undef = function (obj) {\n return typeof obj === 'undefined';\n },\n channelRegExp = /\\s*(\\.\\d+|\\d+(?:\\.\\d+)?)(%)?\\s*/,\n percentageChannelRegExp = /\\s*(\\.\\d+|100|\\d?\\d(?:\\.\\d+)?)%\\s*/,\n alphaChannelRegExp = /\\s*(\\.\\d+|\\d+(?:\\.\\d+)?)\\s*/,\n cssColorRegExp = new RegExp(\n '^(rgb|hsl|hsv)a?' +\n '\\\\(' +\n channelRegExp.source + ',' +\n channelRegExp.source + ',' +\n channelRegExp.source +\n '(?:,' + alphaChannelRegExp.source + ')?' +\n '\\\\)$', 'i');\n\nfunction color(obj) {\n if (Array.isArray(obj)) {\n if (typeof obj[0] === 'string' && typeof color[obj[0]] === 'function') {\n // Assumed array from .toJSON()\n return new color[obj[0]](obj.slice(1, obj.length));\n } else if (obj.length === 4) {\n // Assumed 4 element int RGB array from canvas with all channels [0;255]\n return new color.RGB(obj[0] / 255, obj[1] / 255, obj[2] / 255, obj[3] / 255);\n }\n } else if (typeof obj === 'string') {\n var lowerCased = obj.toLowerCase();\n if (color.namedColors[lowerCased]) {\n obj = '#' + color.namedColors[lowerCased];\n }\n if (lowerCased === 'transparent') {\n obj = 'rgba(0,0,0,0)';\n }\n // Test for CSS rgb(....) string\n var matchCssSyntax = obj.match(cssColorRegExp);\n if (matchCssSyntax) {\n var colorSpaceName = matchCssSyntax[1].toUpperCase(),\n alpha = undef(matchCssSyntax[8]) ? matchCssSyntax[8] : parseFloat(matchCssSyntax[8]),\n hasHue = colorSpaceName[0] === 'H',\n firstChannelDivisor = matchCssSyntax[3] ? 100 : (hasHue ? 360 : 255),\n secondChannelDivisor = (matchCssSyntax[5] || hasHue) ? 100 : 255,\n thirdChannelDivisor = (matchCssSyntax[7] || hasHue) ? 100 : 255;\n if (undef(color[colorSpaceName])) {\n throw new Error('color.' + colorSpaceName + ' is not installed.');\n }\n return new color[colorSpaceName](\n parseFloat(matchCssSyntax[2]) / firstChannelDivisor,\n parseFloat(matchCssSyntax[4]) / secondChannelDivisor,\n parseFloat(matchCssSyntax[6]) / thirdChannelDivisor,\n alpha\n );\n }\n // Assume hex syntax\n if (obj.length < 6) {\n // Allow CSS shorthand\n obj = obj.replace(/^#?([0-9a-f])([0-9a-f])([0-9a-f])$/i, '$1$1$2$2$3$3');\n }\n // Split obj into red, green, and blue components\n var hexMatch = obj.match(/^#?([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])$/i);\n if (hexMatch) {\n return new color.RGB(\n parseInt(hexMatch[1], 16) / 255,\n parseInt(hexMatch[2], 16) / 255,\n parseInt(hexMatch[3], 16) / 255\n );\n }\n\n // No match so far. Lets try the less likely ones\n if (color.CMYK) {\n var cmykMatch = obj.match(new RegExp(\n '^cmyk' +\n '\\\\(' +\n percentageChannelRegExp.source + ',' +\n percentageChannelRegExp.source + ',' +\n percentageChannelRegExp.source + ',' +\n percentageChannelRegExp.source +\n '\\\\)$', 'i'));\n if (cmykMatch) {\n return new color.CMYK(\n parseFloat(cmykMatch[1]) / 100,\n parseFloat(cmykMatch[2]) / 100,\n parseFloat(cmykMatch[3]) / 100,\n parseFloat(cmykMatch[4]) / 100\n );\n }\n }\n } else if (typeof obj === 'object' && obj.isColor) {\n return obj;\n }\n return false;\n}\n\ncolor.namedColors = {};\n\ncolor.installColorSpace = function (colorSpaceName, propertyNames, config) {\n color[colorSpaceName] = function (a1) { // ...\n var args = Array.isArray(a1) ? a1 : arguments;\n propertyNames.forEach(function (propertyName, i) {\n var propertyValue = args[i];\n if (propertyName === 'alpha') {\n this._alpha = (isNaN(propertyValue) || propertyValue > 1) ? 1 : (propertyValue < 0 ? 0 : propertyValue);\n } else {\n if (isNaN(propertyValue)) {\n throw new Error('[' + colorSpaceName + ']: Invalid color: (' + propertyNames.join(',') + ')');\n }\n if (propertyName === 'hue') {\n this._hue = propertyValue < 0 ? propertyValue - Math.floor(propertyValue) : propertyValue % 1;\n } else {\n this['_' + propertyName] = propertyValue < 0 ? 0 : (propertyValue > 1 ? 1 : propertyValue);\n }\n }\n }, this);\n };\n color[colorSpaceName].propertyNames = propertyNames;\n\n var prototype = color[colorSpaceName].prototype;\n\n ['valueOf', 'hex', 'hexa', 'css', 'cssa'].forEach(function (methodName) {\n prototype[methodName] = prototype[methodName] || (colorSpaceName === 'RGB' ? prototype.hex : function () {\n return this.rgb()[methodName]();\n });\n });\n\n prototype.isColor = true;\n\n prototype.equals = function (otherColor, epsilon) {\n if (undef(epsilon)) {\n epsilon = 1e-10;\n }\n\n otherColor = otherColor[colorSpaceName.toLowerCase()]();\n\n for (var i = 0; i < propertyNames.length; i = i + 1) {\n if (Math.abs(this['_' + propertyNames[i]] - otherColor['_' + propertyNames[i]]) > epsilon) {\n return false;\n }\n }\n\n return true;\n };\n\n prototype.toJSON = function () {\n return [colorSpaceName].concat(propertyNames.map(function (propertyName) {\n return this['_' + propertyName];\n }, this));\n };\n\n for (var propertyName in config) {\n if (config.hasOwnProperty(propertyName)) {\n var matchFromColorSpace = propertyName.match(/^from(.*)$/);\n if (matchFromColorSpace) {\n color[matchFromColorSpace[1].toUpperCase()].prototype[colorSpaceName.toLowerCase()] = config[propertyName];\n } else {\n prototype[propertyName] = config[propertyName];\n }\n }\n }\n\n // It is pretty easy to implement the conversion to the same color space:\n prototype[colorSpaceName.toLowerCase()] = function () {\n return this;\n };\n prototype.toString = function () {\n return '[' + colorSpaceName + ' ' + propertyNames.map(function (propertyName) {\n return this['_' + propertyName];\n }, this).join(', ') + ']';\n };\n\n // Generate getters and setters\n propertyNames.forEach(function (propertyName) {\n var shortName = propertyName === 'black' ? 'k' : propertyName.charAt(0);\n prototype[propertyName] = prototype[shortName] = function (value, isDelta) {\n // Simple getter mode: color.red()\n if (typeof value === 'undefined') {\n return this['_' + propertyName];\n } else if (isDelta) {\n // Adjuster: color.red(+.2, true)\n return new this.constructor(propertyNames.map(function (otherPropertyName) {\n return this['_' + otherPropertyName] + (propertyName === otherPropertyName ? value : 0);\n }, this));\n } else {\n // Setter: color.red(.2);\n return new this.constructor(propertyNames.map(function (otherPropertyName) {\n return (propertyName === otherPropertyName) ? value : this['_' + otherPropertyName];\n }, this));\n }\n };\n });\n\n function installForeignMethods(targetColorSpaceName, sourceColorSpaceName) {\n var obj = {};\n obj[sourceColorSpaceName.toLowerCase()] = function () {\n return this.rgb()[sourceColorSpaceName.toLowerCase()]();\n };\n color[sourceColorSpaceName].propertyNames.forEach(function (propertyName) {\n var shortName = propertyName === 'black' ? 'k' : propertyName.charAt(0);\n obj[propertyName] = obj[shortName] = function (value, isDelta) {\n return this[sourceColorSpaceName.toLowerCase()]()[propertyName](value, isDelta);\n };\n });\n for (var prop in obj) {\n if (obj.hasOwnProperty(prop) && color[targetColorSpaceName].prototype[prop] === undefined) {\n color[targetColorSpaceName].prototype[prop] = obj[prop];\n }\n }\n }\n\n installedColorSpaces.forEach(function (otherColorSpaceName) {\n installForeignMethods(colorSpaceName, otherColorSpaceName);\n installForeignMethods(otherColorSpaceName, colorSpaceName);\n });\n\n installedColorSpaces.push(colorSpaceName);\n return color;\n};\n\ncolor.pluginList = [];\n\ncolor.use = function (plugin) {\n if (color.pluginList.indexOf(plugin) === -1) {\n this.pluginList.push(plugin);\n plugin(color);\n }\n return color;\n};\n\ncolor.installMethod = function (name, fn) {\n installedColorSpaces.forEach(function (colorSpace) {\n color[colorSpace].prototype[name] = fn;\n });\n return this;\n};\n\ncolor.installColorSpace('RGB', ['red', 'green', 'blue', 'alpha'], {\n hex: function () {\n var hexString = (Math.round(255 * this._red) * 0x10000 + Math.round(255 * this._green) * 0x100 + Math.round(255 * this._blue)).toString(16);\n return '#' + ('00000'.substr(0, 6 - hexString.length)) + hexString;\n },\n\n hexa: function () {\n var alphaString = Math.round(this._alpha * 255).toString(16);\n return '#' + '00'.substr(0, 2 - alphaString.length) + alphaString + this.hex().substr(1, 6);\n },\n\n css: function () {\n return 'rgb(' + Math.round(255 * this._red) + ',' + Math.round(255 * this._green) + ',' + Math.round(255 * this._blue) + ')';\n },\n\n cssa: function () {\n return 'rgba(' + Math.round(255 * this._red) + ',' + Math.round(255 * this._green) + ',' + Math.round(255 * this._blue) + ',' + this._alpha + ')';\n }\n});\n\nmodule.exports = color;\n","module.exports = function XYZ(color) {\n color.installColorSpace('XYZ', ['x', 'y', 'z', 'alpha'], {\n fromRgb: function () {\n // http://www.easyrgb.com/index.php?X=MATH&H=02#text2\n var convert = function (channel) {\n return channel > 0.04045 ?\n Math.pow((channel + 0.055) / 1.055, 2.4) :\n channel / 12.92;\n },\n r = convert(this._red),\n g = convert(this._green),\n b = convert(this._blue);\n\n // Reference white point sRGB D65:\n // http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html\n return new color.XYZ(\n r * 0.4124564 + g * 0.3575761 + b * 0.1804375,\n r * 0.2126729 + g * 0.7151522 + b * 0.0721750,\n r * 0.0193339 + g * 0.1191920 + b * 0.9503041,\n this._alpha\n );\n },\n\n rgb: function () {\n // http://www.easyrgb.com/index.php?X=MATH&H=01#text1\n var x = this._x,\n y = this._y,\n z = this._z,\n convert = function (channel) {\n return channel > 0.0031308 ?\n 1.055 * Math.pow(channel, 1 / 2.4) - 0.055 :\n 12.92 * channel;\n };\n\n // Reference white point sRGB D65:\n // http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html\n return new color.RGB(\n convert(x * 3.2404542 + y * -1.5371385 + z * -0.4985314),\n convert(x * -0.9692660 + y * 1.8760108 + z * 0.0415560),\n convert(x * 0.0556434 + y * -0.2040259 + z * 1.0572252),\n this._alpha\n );\n },\n\n lab: function () {\n // http://www.easyrgb.com/index.php?X=MATH&H=07#text7\n var convert = function (channel) {\n return channel > 0.008856 ?\n Math.pow(channel, 1 / 3) :\n 7.787037 * channel + 4 / 29;\n },\n x = convert(this._x / 95.047),\n y = convert(this._y / 100.000),\n z = convert(this._z / 108.883);\n\n return new color.LAB(\n (116 * y) - 16,\n 500 * (x - y),\n 200 * (y - z),\n this._alpha\n );\n }\n });\n};\n","module.exports = function LAB(color) {\n color.use(require('./XYZ.js'));\n\n color.installColorSpace('LAB', ['l', 'a', 'b', 'alpha'], {\n fromRgb: function () {\n return this.xyz().lab();\n },\n\n rgb: function () {\n return this.xyz().rgb();\n },\n\n xyz: function () {\n // http://www.easyrgb.com/index.php?X=MATH&H=08#text8\n var convert = function (channel) {\n var pow = Math.pow(channel, 3);\n return pow > 0.008856 ?\n pow :\n (channel - 16 / 116) / 7.87;\n },\n y = (this._l + 16) / 116,\n x = this._a / 500 + y,\n z = y - this._b / 200;\n\n return new color.XYZ(\n convert(x) * 95.047,\n convert(y) * 100.000,\n convert(z) * 108.883,\n this._alpha\n );\n }\n });\n};\n","module.exports = function HSV(color) {\n color.installColorSpace('HSV', ['hue', 'saturation', 'value', 'alpha'], {\n rgb: function () {\n var hue = this._hue,\n saturation = this._saturation,\n value = this._value,\n i = Math.min(5, Math.floor(hue * 6)),\n f = hue * 6 - i,\n p = value * (1 - saturation),\n q = value * (1 - f * saturation),\n t = value * (1 - (1 - f) * saturation),\n red,\n green,\n blue;\n switch (i) {\n case 0:\n red = value;\n green = t;\n blue = p;\n break;\n case 1:\n red = q;\n green = value;\n blue = p;\n break;\n case 2:\n red = p;\n green = value;\n blue = t;\n break;\n case 3:\n red = p;\n green = q;\n blue = value;\n break;\n case 4:\n red = t;\n green = p;\n blue = value;\n break;\n case 5:\n red = value;\n green = p;\n blue = q;\n break;\n }\n return new color.RGB(red, green, blue, this._alpha);\n },\n\n hsl: function () {\n var l = (2 - this._saturation) * this._value,\n sv = this._saturation * this._value,\n svDivisor = l <= 1 ? l : (2 - l),\n saturation;\n\n // Avoid division by zero when lightness approaches zero:\n if (svDivisor < 1e-9) {\n saturation = 0;\n } else {\n saturation = sv / svDivisor;\n }\n return new color.HSL(this._hue, saturation, l / 2, this._alpha);\n },\n\n fromRgb: function () { // Becomes one.color.RGB.prototype.hsv\n var red = this._red,\n green = this._green,\n blue = this._blue,\n max = Math.max(red, green, blue),\n min = Math.min(red, green, blue),\n delta = max - min,\n hue,\n saturation = (max === 0) ? 0 : (delta / max),\n value = max;\n if (delta === 0) {\n hue = 0;\n } else {\n switch (max) {\n case red:\n hue = (green - blue) / delta / 6 + (green < blue ? 1 : 0);\n break;\n case green:\n hue = (blue - red) / delta / 6 + 1 / 3;\n break;\n case blue:\n hue = (red - green) / delta / 6 + 2 / 3;\n break;\n }\n }\n return new color.HSV(hue, saturation, value, this._alpha);\n }\n });\n};\n","module.exports = function HSL(color) {\n color.use(require('./HSV'));\n\n color.installColorSpace('HSL', ['hue', 'saturation', 'lightness', 'alpha'], {\n hsv: function () {\n // Algorithm adapted from http://wiki.secondlife.com/wiki/Color_conversion_scripts\n var l = this._lightness * 2,\n s = this._saturation * ((l <= 1) ? l : 2 - l),\n saturation;\n\n // Avoid division by zero when l + s is very small (approaching black):\n if (l + s < 1e-9) {\n saturation = 0;\n } else {\n saturation = (2 * s) / (l + s);\n }\n\n return new color.HSV(this._hue, saturation, (l + s) / 2, this._alpha);\n },\n\n rgb: function () {\n return this.hsv().rgb();\n },\n\n fromRgb: function () { // Becomes one.color.RGB.prototype.hsv\n return this.hsv().hsl();\n }\n });\n};\n","module.exports = function CMYK(color) {\n color.installColorSpace('CMYK', ['cyan', 'magenta', 'yellow', 'black', 'alpha'], {\n rgb: function () {\n return new color.RGB((1 - this._cyan * (1 - this._black) - this._black),\n (1 - this._magenta * (1 - this._black) - this._black),\n (1 - this._yellow * (1 - this._black) - this._black),\n this._alpha);\n },\n\n fromRgb: function () { // Becomes one.color.RGB.prototype.cmyk\n // Adapted from http://www.javascripter.net/faq/rgb2cmyk.htm\n var red = this._red,\n green = this._green,\n blue = this._blue,\n cyan = 1 - red,\n magenta = 1 - green,\n yellow = 1 - blue,\n black = 1;\n if (red || green || blue) {\n black = Math.min(cyan, Math.min(magenta, yellow));\n cyan = (cyan - black) / (1 - black);\n magenta = (magenta - black) / (1 - black);\n yellow = (yellow - black) / (1 - black);\n } else {\n black = 1;\n }\n return new color.CMYK(cyan, magenta, yellow, black, this._alpha);\n }\n });\n};\n","module.exports = function namedColors(color) {\n color.namedColors = {\n aliceblue: 'f0f8ff',\n antiquewhite: 'faebd7',\n aqua: '0ff',\n aquamarine: '7fffd4',\n azure: 'f0ffff',\n beige: 'f5f5dc',\n bisque: 'ffe4c4',\n black: '000',\n blanchedalmond: 'ffebcd',\n blue: '00f',\n blueviolet: '8a2be2',\n brown: 'a52a2a',\n burlywood: 'deb887',\n cadetblue: '5f9ea0',\n chartreuse: '7fff00',\n chocolate: 'd2691e',\n coral: 'ff7f50',\n cornflowerblue: '6495ed',\n cornsilk: 'fff8dc',\n crimson: 'dc143c',\n cyan: '0ff',\n darkblue: '00008b',\n darkcyan: '008b8b',\n darkgoldenrod: 'b8860b',\n darkgray: 'a9a9a9',\n darkgrey: 'a9a9a9',\n darkgreen: '006400',\n darkkhaki: 'bdb76b',\n darkmagenta: '8b008b',\n darkolivegreen: '556b2f',\n darkorange: 'ff8c00',\n darkorchid: '9932cc',\n darkred: '8b0000',\n darksalmon: 'e9967a',\n darkseagreen: '8fbc8f',\n darkslateblue: '483d8b',\n darkslategray: '2f4f4f',\n darkslategrey: '2f4f4f',\n darkturquoise: '00ced1',\n darkviolet: '9400d3',\n deeppink: 'ff1493',\n deepskyblue: '00bfff',\n dimgray: '696969',\n dimgrey: '696969',\n dodgerblue: '1e90ff',\n firebrick: 'b22222',\n floralwhite: 'fffaf0',\n forestgreen: '228b22',\n fuchsia: 'f0f',\n gainsboro: 'dcdcdc',\n ghostwhite: 'f8f8ff',\n gold: 'ffd700',\n goldenrod: 'daa520',\n gray: '808080',\n grey: '808080',\n green: '008000',\n greenyellow: 'adff2f',\n honeydew: 'f0fff0',\n hotpink: 'ff69b4',\n indianred: 'cd5c5c',\n indigo: '4b0082',\n ivory: 'fffff0',\n khaki: 'f0e68c',\n lavender: 'e6e6fa',\n lavenderblush: 'fff0f5',\n lawngreen: '7cfc00',\n lemonchiffon: 'fffacd',\n lightblue: 'add8e6',\n lightcoral: 'f08080',\n lightcyan: 'e0ffff',\n lightgoldenrodyellow: 'fafad2',\n lightgray: 'd3d3d3',\n lightgrey: 'd3d3d3',\n lightgreen: '90ee90',\n lightpink: 'ffb6c1',\n lightsalmon: 'ffa07a',\n lightseagreen: '20b2aa',\n lightskyblue: '87cefa',\n lightslategray: '789',\n lightslategrey: '789',\n lightsteelblue: 'b0c4de',\n lightyellow: 'ffffe0',\n lime: '0f0',\n limegreen: '32cd32',\n linen: 'faf0e6',\n magenta: 'f0f',\n maroon: '800000',\n mediumaquamarine: '66cdaa',\n mediumblue: '0000cd',\n mediumorchid: 'ba55d3',\n mediumpurple: '9370d8',\n mediumseagreen: '3cb371',\n mediumslateblue: '7b68ee',\n mediumspringgreen: '00fa9a',\n mediumturquoise: '48d1cc',\n mediumvioletred: 'c71585',\n midnightblue: '191970',\n mintcream: 'f5fffa',\n mistyrose: 'ffe4e1',\n moccasin: 'ffe4b5',\n navajowhite: 'ffdead',\n navy: '000080',\n oldlace: 'fdf5e6',\n olive: '808000',\n olivedrab: '6b8e23',\n orange: 'ffa500',\n orangered: 'ff4500',\n orchid: 'da70d6',\n palegoldenrod: 'eee8aa',\n palegreen: '98fb98',\n paleturquoise: 'afeeee',\n palevioletred: 'd87093',\n papayawhip: 'ffefd5',\n peachpuff: 'ffdab9',\n peru: 'cd853f',\n pink: 'ffc0cb',\n plum: 'dda0dd',\n powderblue: 'b0e0e6',\n purple: '800080',\n rebeccapurple: '639',\n red: 'f00',\n rosybrown: 'bc8f8f',\n royalblue: '4169e1',\n saddlebrown: '8b4513',\n salmon: 'fa8072',\n sandybrown: 'f4a460',\n seagreen: '2e8b57',\n seashell: 'fff5ee',\n sienna: 'a0522d',\n silver: 'c0c0c0',\n skyblue: '87ceeb',\n slateblue: '6a5acd',\n slategray: '708090',\n slategrey: '708090',\n snow: 'fffafa',\n springgreen: '00ff7f',\n steelblue: '4682b4',\n tan: 'd2b48c',\n teal: '008080',\n thistle: 'd8bfd8',\n tomato: 'ff6347',\n turquoise: '40e0d0',\n violet: 'ee82ee',\n wheat: 'f5deb3',\n white: 'fff',\n whitesmoke: 'f5f5f5',\n yellow: 'ff0',\n yellowgreen: '9acd32'\n };\n};\n","module.exports = function clearer(color) {\n color.installMethod('clearer', function (amount) {\n return this.alpha(isNaN(amount) ? -0.1 : -amount, true);\n });\n};\n","module.exports = function darken(color) {\n color.use(require('../HSL'));\n\n color.installMethod('darken', function (amount) {\n return this.lightness(isNaN(amount) ? -0.1 : -amount, true);\n });\n};\n","module.exports = function desaturate(color) {\n color.use(require('../HSL'));\n\n color.installMethod('desaturate', function (amount) {\n return this.saturation(isNaN(amount) ? -0.1 : -amount, true);\n });\n};\n","module.exports = function grayscale(color) {\n function gs () {\n /*jslint strict:false*/\n var rgb = this.rgb(),\n val = rgb._red * 0.3 + rgb._green * 0.59 + rgb._blue * 0.11;\n\n return new color.RGB(val, val, val, rgb._alpha);\n }\n\n color.installMethod('greyscale', gs).installMethod('grayscale', gs);\n};\n","module.exports = function lighten(color) {\n color.use(require('../HSL'));\n\n color.installMethod('lighten', function (amount) {\n return this.lightness(isNaN(amount) ? 0.1 : amount, true);\n });\n};\n","module.exports = function mix(color) {\n color.installMethod('mix', function (otherColor, weight) {\n otherColor = color(otherColor).rgb();\n weight = 1 - (isNaN(weight) ? 0.5 : weight);\n\n var w = weight * 2 - 1,\n a = this._alpha - otherColor._alpha,\n weight1 = (((w * a === -1) ? w : (w + a) / (1 + w * a)) + 1) / 2,\n weight2 = 1 - weight1,\n rgb = this.rgb();\n\n return new color.RGB(\n rgb._red * weight1 + otherColor._red * weight2,\n rgb._green * weight1 + otherColor._green * weight2,\n rgb._blue * weight1 + otherColor._blue * weight2,\n rgb._alpha * weight + otherColor._alpha * (1 - weight)\n );\n });\n};\n","module.exports = function negate(color) {\n color.installMethod('negate', function () {\n var rgb = this.rgb();\n return new color.RGB(1 - rgb._red, 1 - rgb._green, 1 - rgb._blue, this._alpha);\n });\n};\n","module.exports = function opaquer(color) {\n color.installMethod('opaquer', function (amount) {\n return this.alpha(isNaN(amount) ? 0.1 : amount, true);\n });\n};\n","module.exports = function rotate(color) {\n color.use(require('../HSL'));\n\n color.installMethod('rotate', function (degrees) {\n return this.hue((degrees || 0) / 360, true);\n });\n};\n","module.exports = function saturate(color) {\n color.use(require('../HSL'));\n\n color.installMethod('saturate', function (amount) {\n return this.saturation(isNaN(amount) ? 0.1 : amount, true);\n });\n};\n","// Adapted from http://gimp.sourcearchive.com/documentation/2.6.6-1ubuntu1/color-to-alpha_8c-source.html\n// toAlpha returns a color where the values of the argument have been converted to alpha\nmodule.exports = function toAlpha(color) {\n color.installMethod('toAlpha', function (color) {\n var me = this.rgb(),\n other = color(color).rgb(),\n epsilon = 1e-10,\n a = new color.RGB(0, 0, 0, me._alpha),\n channels = ['_red', '_green', '_blue'];\n\n channels.forEach(function (channel) {\n if (me[channel] < epsilon) {\n a[channel] = me[channel];\n } else if (me[channel] > other[channel]) {\n a[channel] = (me[channel] - other[channel]) / (1 - other[channel]);\n } else if (me[channel] > other[channel]) {\n a[channel] = (other[channel] - me[channel]) / other[channel];\n } else {\n a[channel] = 0;\n }\n });\n\n if (a._red > a._green) {\n if (a._red > a._blue) {\n me._alpha = a._red;\n } else {\n me._alpha = a._blue;\n }\n } else if (a._green > a._blue) {\n me._alpha = a._green;\n } else {\n me._alpha = a._blue;\n }\n\n if (me._alpha < epsilon) {\n return me;\n }\n\n channels.forEach(function (channel) {\n me[channel] = (me[channel] - other[channel]) / me._alpha + other[channel];\n });\n me._alpha *= a._alpha;\n\n return me;\n });\n};\n","module.exports = require('./lib/color')\n .use(require('./lib/XYZ'))\n .use(require('./lib/LAB'))\n .use(require('./lib/HSV'))\n .use(require('./lib/HSL'))\n .use(require('./lib/CMYK'))\n\n // Convenience functions\n .use(require('./lib/plugins/namedColors'))\n .use(require('./lib/plugins/clearer.js'))\n .use(require('./lib/plugins/darken.js'))\n .use(require('./lib/plugins/desaturate.js'))\n .use(require('./lib/plugins/grayscale.js'))\n .use(require('./lib/plugins/lighten.js'))\n .use(require('./lib/plugins/mix.js'))\n .use(require('./lib/plugins/negate.js'))\n .use(require('./lib/plugins/opaquer.js'))\n .use(require('./lib/plugins/rotate.js'))\n .use(require('./lib/plugins/saturate.js'))\n .use(require('./lib/plugins/toAlpha.js'));\n"]} \ No newline at end of file +{"version":3,"sources":["lib/color.js","lib/XYZ.js","lib/LAB.js","lib/HSV.js","lib/HSL.js","lib/CMYK.js","lib/plugins/namedColors.js","lib/plugins/clearer.js","lib/plugins/luminance.js","lib/plugins/contrast.js","lib/plugins/darken.js","lib/plugins/desaturate.js","lib/plugins/grayscale.js","lib/plugins/isDark.js","lib/plugins/isLight.js","lib/plugins/lighten.js","lib/plugins/mix.js","lib/plugins/negate.js","lib/plugins/opaquer.js","lib/plugins/rotate.js","lib/plugins/saturate.js","lib/plugins/toAlpha.js","index.js"],"names":["color","obj","Array","isArray","slice","length","RGB","lowerCased","toLowerCase","namedColors","matchCssSyntax","match","cssColorRegExp","colorSpaceName","toUpperCase","alpha","undef","parseFloat","hasHue","firstChannelDivisor","secondChannelDivisor","thirdChannelDivisor","Error","replace","hexMatch","parseInt","CMYK","cmykMatch","RegExp","percentageChannelRegExp","source","isColor","installedColorSpaces","channelRegExp","installColorSpace","propertyNames","config","installForeignMethods","targetColorSpaceName","sourceColorSpaceName","this","rgb","forEach","propertyName","shortName","charAt","value","isDelta","prop","hasOwnProperty","undefined","prototype","a1","args","arguments","i","propertyValue","_alpha","isNaN","join","_hue","Math","floor","methodName","hex","equals","otherColor","epsilon","abs","toJSON","concat","map","matchFromColorSpace","toString","constructor","otherPropertyName","otherColorSpaceName","push","pluginList","use","plugin","indexOf","installMethod","name","fn","colorSpace","hexString","round","_red","_green","_blue","substr","hexa","alphaString","css","cssa","color_1","XYZ","fromRgb","convert","channel","pow","r","g","b","x","_x","y","_y","z","_z","lab","LAB","require$$0","xyz","_l","_a","_b","HSV","red","green","blue","hue","saturation","_saturation","_value","min","f","p","q","t","hsl","l","sv","svDivisor","HSL","max","delta","hsv","_lightness","s","_cyan","_black","_magenta","_yellow","cyan","magenta","yellow","black","aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","blanchedalmond","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","darkblue","darkcyan","darkgoldenrod","darkgray","darkgrey","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgrey","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","lime","limegreen","linen","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellowgreen","clearer","amount","luminance","channelLuminance","contrast","color2","lum1","lum2","darken","lightness","desaturate","grayscale","gs","val","isDark","isLight","lighten","mix","weight","w","a","weight1","weight2","negate","opaquer","rotate","degrees","saturate","toAlpha","me","other","channels","require$$1","require$$2","require$$3","require$$4","require$$5","require$$6","require$$7","require$$8","require$$9","require$$10","require$$11","require$$12","require$$13","require$$14","require$$15","require$$16","require$$17","require$$18","require$$19","require$$20","require$$21"],"mappings":"sMAgBA,SAASA,GAAMC,GACX,GAAIC,MAAMC,QAAQF,GAAM,CACpB,GAAsB,gBAAXA,GAAI,IAA4C,kBAAlBD,GAAMC,EAAI,IAE/C,MAAO,IAAID,GAAMC,EAAI,IAAIA,EAAIG,MAAM,EAAGH,EAAII,QACvC,IAAmB,IAAfJ,EAAII,OAEX,MAAO,IAAIL,GAAMM,IAAIL,EAAI,GAAK,IAAKA,EAAI,GAAK,IAAKA,EAAI,GAAK,IAAKA,EAAI,GAAK,SAEzE,IAAmB,gBAARA,GAAkB,CAChC,GAAIM,GAAaN,EAAIO,aACjBR,GAAMS,YAAYF,KAClBN,EAAM,IAAMD,EAAMS,YAAYF,IAEf,gBAAfA,IACAN,EAAM,gBAGV,IAAIS,GAAiBT,EAAIU,MAAMC,EAC/B,IAAIF,EAAgB,CAChB,GAAIG,GAAiBH,EAAe,GAAGI,cACnCC,EAAQC,EAAMN,EAAe,IAAMA,EAAe,GAAKO,WAAWP,EAAe,IACjFQ,EAA+B,MAAtBL,EAAe,GACxBM,EAAsBT,EAAe,GAAK,IAAOQ,EAAS,IAAM,IAChEE,EAAwBV,EAAe,IAAMQ,EAAU,IAAM,IAC7DG,EAAuBX,EAAe,IAAMQ,EAAU,IAAM,GAChE,IAAIF,EAAMhB,EAAMa,IACZ,KAAM,IAAIS,OAAM,SAAWT,EAAiB,qBAEhD,OAAO,IAAIb,GAAMa,GACbI,WAAWP,EAAe,IAAMS,EAChCF,WAAWP,EAAe,IAAMU,EAChCH,WAAWP,EAAe,IAAMW,EAChCN,GAIJd,EAAII,OAAS,IAEbJ,EAAMA,EAAIsB,QAAQ,sCAAuC,gBAG7D,IAAIC,GAAWvB,EAAIU,MAAM,8DACzB,IAAIa,EACA,MAAO,IAAIxB,GAAMM,IACbmB,SAASD,EAAS,G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EAAM5N,KAErE2N,EAAGtQ,QAAU6P,EAAE7P,OAERsQ,YC3CE9M,GACZlC,IAAImP,GACJnP,IAAIoP,GACJpP,IAAIqP,GACJrP,IAAIsP,GACJtP,IAAIuP,GAGJvP,IAAIwP,GACJxP,IAAIyP,GACJzP,IAAI0P,GACJ1P,IAAI2P,GACJ3P,IAAI4P,GACJ5P,IAAI6P,GACJ7P,IAAI8P,GACJ9P,IAAI+P,GACJ/P,IAAIgQ,GACJhQ,IAAIiQ,GACJjQ,IAAIkQ,GACJlQ,IAAImQ,GACJnQ,IAAIoQ,GACJpQ,IAAIqQ,GACJrQ,IAAIsQ,GACJtQ,IAAIuQ","sourcesContent":["var installedColorSpaces = [],\n undef = function (obj) {\n return typeof obj === 'undefined';\n },\n channelRegExp = /\\s*(\\.\\d+|\\d+(?:\\.\\d+)?)(%)?\\s*/,\n percentageChannelRegExp = /\\s*(\\.\\d+|100|\\d?\\d(?:\\.\\d+)?)%\\s*/,\n alphaChannelRegExp = /\\s*(\\.\\d+|\\d+(?:\\.\\d+)?)\\s*/,\n cssColorRegExp = new RegExp(\n '^(rgb|hsl|hsv)a?' +\n '\\\\(' +\n channelRegExp.source + ',' +\n channelRegExp.source + ',' +\n channelRegExp.source +\n '(?:,' + alphaChannelRegExp.source + ')?' +\n '\\\\)$', 'i');\n\nfunction color(obj) {\n if (Array.isArray(obj)) {\n if (typeof obj[0] === 'string' && typeof color[obj[0]] === 'function') {\n // Assumed array from .toJSON()\n return new color[obj[0]](obj.slice(1, obj.length));\n } else if (obj.length === 4) {\n // Assumed 4 element int RGB array from canvas with all channels [0;255]\n return new color.RGB(obj[0] / 255, obj[1] / 255, obj[2] / 255, obj[3] / 255);\n }\n } else if (typeof obj === 'string') {\n var lowerCased = obj.toLowerCase();\n if (color.namedColors[lowerCased]) {\n obj = '#' + color.namedColors[lowerCased];\n }\n if (lowerCased === 'transparent') {\n obj = 'rgba(0,0,0,0)';\n }\n // Test for CSS rgb(....) string\n var matchCssSyntax = obj.match(cssColorRegExp);\n if (matchCssSyntax) {\n var colorSpaceName = matchCssSyntax[1].toUpperCase(),\n alpha = undef(matchCssSyntax[8]) ? matchCssSyntax[8] : parseFloat(matchCssSyntax[8]),\n hasHue = colorSpaceName[0] === 'H',\n firstChannelDivisor = matchCssSyntax[3] ? 100 : (hasHue ? 360 : 255),\n secondChannelDivisor = (matchCssSyntax[5] || hasHue) ? 100 : 255,\n thirdChannelDivisor = (matchCssSyntax[7] || hasHue) ? 100 : 255;\n if (undef(color[colorSpaceName])) {\n throw new Error('color.' + colorSpaceName + ' is not installed.');\n }\n return new color[colorSpaceName](\n parseFloat(matchCssSyntax[2]) / firstChannelDivisor,\n parseFloat(matchCssSyntax[4]) / secondChannelDivisor,\n parseFloat(matchCssSyntax[6]) / thirdChannelDivisor,\n alpha\n );\n }\n // Assume hex syntax\n if (obj.length < 6) {\n // Allow CSS shorthand\n obj = obj.replace(/^#?([0-9a-f])([0-9a-f])([0-9a-f])$/i, '$1$1$2$2$3$3');\n }\n // Split obj into red, green, and blue components\n var hexMatch = obj.match(/^#?([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])$/i);\n if (hexMatch) {\n return new color.RGB(\n parseInt(hexMatch[1], 16) / 255,\n parseInt(hexMatch[2], 16) / 255,\n parseInt(hexMatch[3], 16) / 255\n );\n }\n\n // No match so far. Lets try the less likely ones\n if (color.CMYK) {\n var cmykMatch = obj.match(new RegExp(\n '^cmyk' +\n '\\\\(' +\n percentageChannelRegExp.source + ',' +\n percentageChannelRegExp.source + ',' +\n percentageChannelRegExp.source + ',' +\n percentageChannelRegExp.source +\n '\\\\)$', 'i'));\n if (cmykMatch) {\n return new color.CMYK(\n parseFloat(cmykMatch[1]) / 100,\n parseFloat(cmykMatch[2]) / 100,\n parseFloat(cmykMatch[3]) / 100,\n parseFloat(cmykMatch[4]) / 100\n );\n }\n }\n } else if (typeof obj === 'object' && obj.isColor) {\n return obj;\n }\n return false;\n}\n\ncolor.namedColors = {};\n\ncolor.installColorSpace = function (colorSpaceName, propertyNames, config) {\n color[colorSpaceName] = function (a1) { // ...\n var args = Array.isArray(a1) ? a1 : arguments;\n propertyNames.forEach(function (propertyName, i) {\n var propertyValue = args[i];\n if (propertyName === 'alpha') {\n this._alpha = (isNaN(propertyValue) || propertyValue > 1) ? 1 : (propertyValue < 0 ? 0 : propertyValue);\n } else {\n if (isNaN(propertyValue)) {\n throw new Error('[' + colorSpaceName + ']: Invalid color: (' + propertyNames.join(',') + ')');\n }\n if (propertyName === 'hue') {\n this._hue = propertyValue < 0 ? propertyValue - Math.floor(propertyValue) : propertyValue % 1;\n } else {\n this['_' + propertyName] = propertyValue < 0 ? 0 : (propertyValue > 1 ? 1 : propertyValue);\n }\n }\n }, this);\n };\n color[colorSpaceName].propertyNames = propertyNames;\n\n var prototype = color[colorSpaceName].prototype;\n\n ['valueOf', 'hex', 'hexa', 'css', 'cssa'].forEach(function (methodName) {\n prototype[methodName] = prototype[methodName] || (colorSpaceName === 'RGB' ? prototype.hex : function () {\n return this.rgb()[methodName]();\n });\n });\n\n prototype.isColor = true;\n\n prototype.equals = function (otherColor, epsilon) {\n if (undef(epsilon)) {\n epsilon = 1e-10;\n }\n\n otherColor = otherColor[colorSpaceName.toLowerCase()]();\n\n for (var i = 0; i < propertyNames.length; i = i + 1) {\n if (Math.abs(this['_' + propertyNames[i]] - otherColor['_' + propertyNames[i]]) > epsilon) {\n return false;\n }\n }\n\n return true;\n };\n\n prototype.toJSON = function () {\n return [colorSpaceName].concat(propertyNames.map(function (propertyName) {\n return this['_' + propertyName];\n }, this));\n };\n\n for (var propertyName in config) {\n if (config.hasOwnProperty(propertyName)) {\n var matchFromColorSpace = propertyName.match(/^from(.*)$/);\n if (matchFromColorSpace) {\n color[matchFromColorSpace[1].toUpperCase()].prototype[colorSpaceName.toLowerCase()] = config[propertyName];\n } else {\n prototype[propertyName] = config[propertyName];\n }\n }\n }\n\n // It is pretty easy to implement the conversion to the same color space:\n prototype[colorSpaceName.toLowerCase()] = function () {\n return this;\n };\n prototype.toString = function () {\n return '[' + colorSpaceName + ' ' + propertyNames.map(function (propertyName) {\n return this['_' + propertyName];\n }, this).join(', ') + ']';\n };\n\n // Generate getters and setters\n propertyNames.forEach(function (propertyName) {\n var shortName = propertyName === 'black' ? 'k' : propertyName.charAt(0);\n prototype[propertyName] = prototype[shortName] = function (value, isDelta) {\n // Simple getter mode: color.red()\n if (typeof value === 'undefined') {\n return this['_' + propertyName];\n } else if (isDelta) {\n // Adjuster: color.red(+.2, true)\n return new this.constructor(propertyNames.map(function (otherPropertyName) {\n return this['_' + otherPropertyName] + (propertyName === otherPropertyName ? value : 0);\n }, this));\n } else {\n // Setter: color.red(.2);\n return new this.constructor(propertyNames.map(function (otherPropertyName) {\n return (propertyName === otherPropertyName) ? value : this['_' + otherPropertyName];\n }, this));\n }\n };\n });\n\n function installForeignMethods(targetColorSpaceName, sourceColorSpaceName) {\n var obj = {};\n obj[sourceColorSpaceName.toLowerCase()] = function () {\n return this.rgb()[sourceColorSpaceName.toLowerCase()]();\n };\n color[sourceColorSpaceName].propertyNames.forEach(function (propertyName) {\n var shortName = propertyName === 'black' ? 'k' : propertyName.charAt(0);\n obj[propertyName] = obj[shortName] = function (value, isDelta) {\n return this[sourceColorSpaceName.toLowerCase()]()[propertyName](value, isDelta);\n };\n });\n for (var prop in obj) {\n if (obj.hasOwnProperty(prop) && color[targetColorSpaceName].prototype[prop] === undefined) {\n color[targetColorSpaceName].prototype[prop] = obj[prop];\n }\n }\n }\n\n installedColorSpaces.forEach(function (otherColorSpaceName) {\n installForeignMethods(colorSpaceName, otherColorSpaceName);\n installForeignMethods(otherColorSpaceName, colorSpaceName);\n });\n\n installedColorSpaces.push(colorSpaceName);\n return color;\n};\n\ncolor.pluginList = [];\n\ncolor.use = function (plugin) {\n if (color.pluginList.indexOf(plugin) === -1) {\n this.pluginList.push(plugin);\n plugin(color);\n }\n return color;\n};\n\ncolor.installMethod = function (name, fn) {\n installedColorSpaces.forEach(function (colorSpace) {\n color[colorSpace].prototype[name] = fn;\n });\n return this;\n};\n\ncolor.installColorSpace('RGB', ['red', 'green', 'blue', 'alpha'], {\n hex: function () {\n var hexString = (Math.round(255 * this._red) * 0x10000 + Math.round(255 * this._green) * 0x100 + Math.round(255 * this._blue)).toString(16);\n return '#' + ('00000'.substr(0, 6 - hexString.length)) + hexString;\n },\n\n hexa: function () {\n var alphaString = Math.round(this._alpha * 255).toString(16);\n return '#' + '00'.substr(0, 2 - alphaString.length) + alphaString + this.hex().substr(1, 6);\n },\n\n css: function () {\n return 'rgb(' + Math.round(255 * this._red) + ',' + Math.round(255 * this._green) + ',' + Math.round(255 * this._blue) + ')';\n },\n\n cssa: function () {\n return 'rgba(' + Math.round(255 * this._red) + ',' + Math.round(255 * this._green) + ',' + Math.round(255 * this._blue) + ',' + this._alpha + ')';\n }\n});\n\nmodule.exports = color;\n","module.exports = function XYZ(color) {\n color.installColorSpace('XYZ', ['x', 'y', 'z', 'alpha'], {\n fromRgb: function () {\n // http://www.easyrgb.com/index.php?X=MATH&H=02#text2\n var convert = function (channel) {\n return channel > 0.04045 ?\n Math.pow((channel + 0.055) / 1.055, 2.4) :\n channel / 12.92;\n },\n r = convert(this._red),\n g = convert(this._green),\n b = convert(this._blue);\n\n // Reference white point sRGB D65:\n // http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html\n return new color.XYZ(\n r * 0.4124564 + g * 0.3575761 + b * 0.1804375,\n r * 0.2126729 + g * 0.7151522 + b * 0.0721750,\n r * 0.0193339 + g * 0.1191920 + b * 0.9503041,\n this._alpha\n );\n },\n\n rgb: function () {\n // http://www.easyrgb.com/index.php?X=MATH&H=01#text1\n var x = this._x,\n y = this._y,\n z = this._z,\n convert = function (channel) {\n return channel > 0.0031308 ?\n 1.055 * Math.pow(channel, 1 / 2.4) - 0.055 :\n 12.92 * channel;\n };\n\n // Reference white point sRGB D65:\n // http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html\n return new color.RGB(\n convert(x * 3.2404542 + y * -1.5371385 + z * -0.4985314),\n convert(x * -0.9692660 + y * 1.8760108 + z * 0.0415560),\n convert(x * 0.0556434 + y * -0.2040259 + z * 1.0572252),\n this._alpha\n );\n },\n\n lab: function () {\n // http://www.easyrgb.com/index.php?X=MATH&H=07#text7\n var convert = function (channel) {\n return channel > 0.008856 ?\n Math.pow(channel, 1 / 3) :\n 7.787037 * channel + 4 / 29;\n },\n x = convert(this._x / 95.047),\n y = convert(this._y / 100.000),\n z = convert(this._z / 108.883);\n\n return new color.LAB(\n (116 * y) - 16,\n 500 * (x - y),\n 200 * (y - z),\n this._alpha\n );\n }\n });\n};\n","module.exports = function LAB(color) {\n color.use(require('./XYZ.js'));\n\n color.installColorSpace('LAB', ['l', 'a', 'b', 'alpha'], {\n fromRgb: function () {\n return this.xyz().lab();\n },\n\n rgb: function () {\n return this.xyz().rgb();\n },\n\n xyz: function () {\n // http://www.easyrgb.com/index.php?X=MATH&H=08#text8\n var convert = function (channel) {\n var pow = Math.pow(channel, 3);\n return pow > 0.008856 ?\n pow :\n (channel - 16 / 116) / 7.87;\n },\n y = (this._l + 16) / 116,\n x = this._a / 500 + y,\n z = y - this._b / 200;\n\n return new color.XYZ(\n convert(x) * 95.047,\n convert(y) * 100.000,\n convert(z) * 108.883,\n this._alpha\n );\n }\n });\n};\n","module.exports = function HSV(color) {\n color.installColorSpace('HSV', ['hue', 'saturation', 'value', 'alpha'], {\n rgb: function () {\n var hue = this._hue,\n saturation = this._saturation,\n value = this._value,\n i = Math.min(5, Math.floor(hue * 6)),\n f = hue * 6 - i,\n p = value * (1 - saturation),\n q = value * (1 - f * saturation),\n t = value * (1 - (1 - f) * saturation),\n red,\n green,\n blue;\n switch (i) {\n case 0:\n red = value;\n green = t;\n blue = p;\n break;\n case 1:\n red = q;\n green = value;\n blue = p;\n break;\n case 2:\n red = p;\n green = value;\n blue = t;\n break;\n case 3:\n red = p;\n green = q;\n blue = value;\n break;\n case 4:\n red = t;\n green = p;\n blue = value;\n break;\n case 5:\n red = value;\n green = p;\n blue = q;\n break;\n }\n return new color.RGB(red, green, blue, this._alpha);\n },\n\n hsl: function () {\n var l = (2 - this._saturation) * this._value,\n sv = this._saturation * this._value,\n svDivisor = l <= 1 ? l : (2 - l),\n saturation;\n\n // Avoid division by zero when lightness approaches zero:\n if (svDivisor < 1e-9) {\n saturation = 0;\n } else {\n saturation = sv / svDivisor;\n }\n return new color.HSL(this._hue, saturation, l / 2, this._alpha);\n },\n\n fromRgb: function () { // Becomes one.color.RGB.prototype.hsv\n var red = this._red,\n green = this._green,\n blue = this._blue,\n max = Math.max(red, green, blue),\n min = Math.min(red, green, blue),\n delta = max - min,\n hue,\n saturation = (max === 0) ? 0 : (delta / max),\n value = max;\n if (delta === 0) {\n hue = 0;\n } else {\n switch (max) {\n case red:\n hue = (green - blue) / delta / 6 + (green < blue ? 1 : 0);\n break;\n case green:\n hue = (blue - red) / delta / 6 + 1 / 3;\n break;\n case blue:\n hue = (red - green) / delta / 6 + 2 / 3;\n break;\n }\n }\n return new color.HSV(hue, saturation, value, this._alpha);\n }\n });\n};\n","module.exports = function HSL(color) {\n color.use(require('./HSV'));\n\n color.installColorSpace('HSL', ['hue', 'saturation', 'lightness', 'alpha'], {\n hsv: function () {\n // Algorithm adapted from http://wiki.secondlife.com/wiki/Color_conversion_scripts\n var l = this._lightness * 2,\n s = this._saturation * ((l <= 1) ? l : 2 - l),\n saturation;\n\n // Avoid division by zero when l + s is very small (approaching black):\n if (l + s < 1e-9) {\n saturation = 0;\n } else {\n saturation = (2 * s) / (l + s);\n }\n\n return new color.HSV(this._hue, saturation, (l + s) / 2, this._alpha);\n },\n\n rgb: function () {\n return this.hsv().rgb();\n },\n\n fromRgb: function () { // Becomes one.color.RGB.prototype.hsv\n return this.hsv().hsl();\n }\n });\n};\n","module.exports = function CMYK(color) {\n color.installColorSpace('CMYK', ['cyan', 'magenta', 'yellow', 'black', 'alpha'], {\n rgb: function () {\n return new color.RGB((1 - this._cyan * (1 - this._black) - this._black),\n (1 - this._magenta * (1 - this._black) - this._black),\n (1 - this._yellow * (1 - this._black) - this._black),\n this._alpha);\n },\n\n fromRgb: function () { // Becomes one.color.RGB.prototype.cmyk\n // Adapted from http://www.javascripter.net/faq/rgb2cmyk.htm\n var red = this._red,\n green = this._green,\n blue = this._blue,\n cyan = 1 - red,\n magenta = 1 - green,\n yellow = 1 - blue,\n black = 1;\n if (red || green || blue) {\n black = Math.min(cyan, Math.min(magenta, yellow));\n cyan = (cyan - black) / (1 - black);\n magenta = (magenta - black) / (1 - black);\n yellow = (yellow - black) / (1 - black);\n } else {\n black = 1;\n }\n return new color.CMYK(cyan, magenta, yellow, black, this._alpha);\n }\n });\n};\n","module.exports = function namedColors(color) {\n color.namedColors = {\n aliceblue: 'f0f8ff',\n antiquewhite: 'faebd7',\n aqua: '0ff',\n aquamarine: '7fffd4',\n azure: 'f0ffff',\n beige: 'f5f5dc',\n bisque: 'ffe4c4',\n black: '000',\n blanchedalmond: 'ffebcd',\n blue: '00f',\n blueviolet: '8a2be2',\n brown: 'a52a2a',\n burlywood: 'deb887',\n cadetblue: '5f9ea0',\n chartreuse: '7fff00',\n chocolate: 'd2691e',\n coral: 'ff7f50',\n cornflowerblue: '6495ed',\n cornsilk: 'fff8dc',\n crimson: 'dc143c',\n cyan: '0ff',\n darkblue: '00008b',\n darkcyan: '008b8b',\n darkgoldenrod: 'b8860b',\n darkgray: 'a9a9a9',\n darkgrey: 'a9a9a9',\n darkgreen: '006400',\n darkkhaki: 'bdb76b',\n darkmagenta: '8b008b',\n darkolivegreen: '556b2f',\n darkorange: 'ff8c00',\n darkorchid: '9932cc',\n darkred: '8b0000',\n darksalmon: 'e9967a',\n darkseagreen: '8fbc8f',\n darkslateblue: '483d8b',\n darkslategray: '2f4f4f',\n darkslategrey: '2f4f4f',\n darkturquoise: '00ced1',\n darkviolet: '9400d3',\n deeppink: 'ff1493',\n deepskyblue: '00bfff',\n dimgray: '696969',\n dimgrey: '696969',\n dodgerblue: '1e90ff',\n firebrick: 'b22222',\n floralwhite: 'fffaf0',\n forestgreen: '228b22',\n fuchsia: 'f0f',\n gainsboro: 'dcdcdc',\n ghostwhite: 'f8f8ff',\n gold: 'ffd700',\n goldenrod: 'daa520',\n gray: '808080',\n grey: '808080',\n green: '008000',\n greenyellow: 'adff2f',\n honeydew: 'f0fff0',\n hotpink: 'ff69b4',\n indianred: 'cd5c5c',\n indigo: '4b0082',\n ivory: 'fffff0',\n khaki: 'f0e68c',\n lavender: 'e6e6fa',\n lavenderblush: 'fff0f5',\n lawngreen: '7cfc00',\n lemonchiffon: 'fffacd',\n lightblue: 'add8e6',\n lightcoral: 'f08080',\n lightcyan: 'e0ffff',\n lightgoldenrodyellow: 'fafad2',\n lightgray: 'd3d3d3',\n lightgrey: 'd3d3d3',\n lightgreen: '90ee90',\n lightpink: 'ffb6c1',\n lightsalmon: 'ffa07a',\n lightseagreen: '20b2aa',\n lightskyblue: '87cefa',\n lightslategray: '789',\n lightslategrey: '789',\n lightsteelblue: 'b0c4de',\n lightyellow: 'ffffe0',\n lime: '0f0',\n limegreen: '32cd32',\n linen: 'faf0e6',\n magenta: 'f0f',\n maroon: '800000',\n mediumaquamarine: '66cdaa',\n mediumblue: '0000cd',\n mediumorchid: 'ba55d3',\n mediumpurple: '9370d8',\n mediumseagreen: '3cb371',\n mediumslateblue: '7b68ee',\n mediumspringgreen: '00fa9a',\n mediumturquoise: '48d1cc',\n mediumvioletred: 'c71585',\n midnightblue: '191970',\n mintcream: 'f5fffa',\n mistyrose: 'ffe4e1',\n moccasin: 'ffe4b5',\n navajowhite: 'ffdead',\n navy: '000080',\n oldlace: 'fdf5e6',\n olive: '808000',\n olivedrab: '6b8e23',\n orange: 'ffa500',\n orangered: 'ff4500',\n orchid: 'da70d6',\n palegoldenrod: 'eee8aa',\n palegreen: '98fb98',\n paleturquoise: 'afeeee',\n palevioletred: 'd87093',\n papayawhip: 'ffefd5',\n peachpuff: 'ffdab9',\n peru: 'cd853f',\n pink: 'ffc0cb',\n plum: 'dda0dd',\n powderblue: 'b0e0e6',\n purple: '800080',\n rebeccapurple: '639',\n red: 'f00',\n rosybrown: 'bc8f8f',\n royalblue: '4169e1',\n saddlebrown: '8b4513',\n salmon: 'fa8072',\n sandybrown: 'f4a460',\n seagreen: '2e8b57',\n seashell: 'fff5ee',\n sienna: 'a0522d',\n silver: 'c0c0c0',\n skyblue: '87ceeb',\n slateblue: '6a5acd',\n slategray: '708090',\n slategrey: '708090',\n snow: 'fffafa',\n springgreen: '00ff7f',\n steelblue: '4682b4',\n tan: 'd2b48c',\n teal: '008080',\n thistle: 'd8bfd8',\n tomato: 'ff6347',\n turquoise: '40e0d0',\n violet: 'ee82ee',\n wheat: 'f5deb3',\n white: 'fff',\n whitesmoke: 'f5f5f5',\n yellow: 'ff0',\n yellowgreen: '9acd32'\n };\n};\n","module.exports = function clearer(color) {\n color.installMethod('clearer', function (amount) {\n return this.alpha(isNaN(amount) ? -0.1 : -amount, true);\n });\n};\n","module.exports = function luminance(color) {\n // http://www.w3.org/TR/WCAG20/#relativeluminancedef\n\n function channelLuminance(value) {\n return (value <= 0.03928) ? value / 12.92 : Math.pow(((value + 0.055) / 1.055), 2.4);\n }\n\n color.installMethod('luminance', function () {\n var rgb = this.rgb();\n return 0.2126 * channelLuminance(rgb._red) + 0.7152 * channelLuminance(rgb._green) + 0.0722 * channelLuminance(rgb._blue);\n });\n};\n","module.exports = function contrast(color) {\n // http://www.w3.org/TR/WCAG20/#contrast-ratiodef\n\n color.use(require('./luminance'));\n\n color.installMethod('contrast', function (color2) {\n var lum1 = this.luminance();\n var lum2 = color2.luminance();\n if (lum1 > lum2) {\n return (lum1 + 0.05) / (lum2 + 0.05);\n }\n\n return (lum2 + 0.05) / (lum1 + 0.05);\n });\n};\n","module.exports = function darken(color) {\n color.use(require('../HSL'));\n\n color.installMethod('darken', function (amount) {\n return this.lightness(isNaN(amount) ? -0.1 : -amount, true);\n });\n};\n","module.exports = function desaturate(color) {\n color.use(require('../HSL'));\n\n color.installMethod('desaturate', function (amount) {\n return this.saturation(isNaN(amount) ? -0.1 : -amount, true);\n });\n};\n","module.exports = function grayscale(color) {\n function gs () {\n /*jslint strict:false*/\n var rgb = this.rgb(),\n val = rgb._red * 0.3 + rgb._green * 0.59 + rgb._blue * 0.11;\n\n return new color.RGB(val, val, val, rgb._alpha);\n }\n\n color.installMethod('greyscale', gs).installMethod('grayscale', gs);\n};\n","module.exports = function isDark(color) {\n\n color.installMethod('isDark', function () {\n var rgb = this.rgb();\n\n // YIQ equation from http://24ways.org/2010/calculating-color-contrast\n var yiq = (rgb._red * 255 * 299 + rgb._green * 255 * 587 + rgb._blue * 255 * 114) / 1000;\n return yiq < 128;\n });\n};\n","module.exports = function isLight(color) {\n\n color.use(require('./isDark'));\n\n color.installMethod('isLight', function () {\n return !this.isDark();\n });\n};\n","module.exports = function lighten(color) {\n color.use(require('../HSL'));\n\n color.installMethod('lighten', function (amount) {\n return this.lightness(isNaN(amount) ? 0.1 : amount, true);\n });\n};\n","module.exports = function mix(color) {\n color.installMethod('mix', function (otherColor, weight) {\n otherColor = color(otherColor).rgb();\n weight = 1 - (isNaN(weight) ? 0.5 : weight);\n\n var w = weight * 2 - 1,\n a = this._alpha - otherColor._alpha,\n weight1 = (((w * a === -1) ? w : (w + a) / (1 + w * a)) + 1) / 2,\n weight2 = 1 - weight1,\n rgb = this.rgb();\n\n return new color.RGB(\n rgb._red * weight1 + otherColor._red * weight2,\n rgb._green * weight1 + otherColor._green * weight2,\n rgb._blue * weight1 + otherColor._blue * weight2,\n rgb._alpha * weight + otherColor._alpha * (1 - weight)\n );\n });\n};\n","module.exports = function negate(color) {\n color.installMethod('negate', function () {\n var rgb = this.rgb();\n return new color.RGB(1 - rgb._red, 1 - rgb._green, 1 - rgb._blue, this._alpha);\n });\n};\n","module.exports = function opaquer(color) {\n color.installMethod('opaquer', function (amount) {\n return this.alpha(isNaN(amount) ? 0.1 : amount, true);\n });\n};\n","module.exports = function rotate(color) {\n color.use(require('../HSL'));\n\n color.installMethod('rotate', function (degrees) {\n return this.hue((degrees || 0) / 360, true);\n });\n};\n","module.exports = function saturate(color) {\n color.use(require('../HSL'));\n\n color.installMethod('saturate', function (amount) {\n return this.saturation(isNaN(amount) ? 0.1 : amount, true);\n });\n};\n","// Adapted from http://gimp.sourcearchive.com/documentation/2.6.6-1ubuntu1/color-to-alpha_8c-source.html\n// toAlpha returns a color where the values of the argument have been converted to alpha\nmodule.exports = function toAlpha(color) {\n color.installMethod('toAlpha', function (color) {\n var me = this.rgb(),\n other = color(color).rgb(),\n epsilon = 1e-10,\n a = new color.RGB(0, 0, 0, me._alpha),\n channels = ['_red', '_green', '_blue'];\n\n channels.forEach(function (channel) {\n if (me[channel] < epsilon) {\n a[channel] = me[channel];\n } else if (me[channel] > other[channel]) {\n a[channel] = (me[channel] - other[channel]) / (1 - other[channel]);\n } else if (me[channel] > other[channel]) {\n a[channel] = (other[channel] - me[channel]) / other[channel];\n } else {\n a[channel] = 0;\n }\n });\n\n if (a._red > a._green) {\n if (a._red > a._blue) {\n me._alpha = a._red;\n } else {\n me._alpha = a._blue;\n }\n } else if (a._green > a._blue) {\n me._alpha = a._green;\n } else {\n me._alpha = a._blue;\n }\n\n if (me._alpha < epsilon) {\n return me;\n }\n\n channels.forEach(function (channel) {\n me[channel] = (me[channel] - other[channel]) / me._alpha + other[channel];\n });\n me._alpha *= a._alpha;\n\n return me;\n });\n};\n","module.exports = require('./lib/color')\n .use(require('./lib/XYZ'))\n .use(require('./lib/LAB'))\n .use(require('./lib/HSV'))\n .use(require('./lib/HSL'))\n .use(require('./lib/CMYK'))\n\n // Convenience functions\n .use(require('./lib/plugins/namedColors'))\n .use(require('./lib/plugins/clearer.js'))\n .use(require('./lib/plugins/contrast.js'))\n .use(require('./lib/plugins/darken.js'))\n .use(require('./lib/plugins/desaturate.js'))\n .use(require('./lib/plugins/grayscale.js'))\n .use(require('./lib/plugins/isDark.js'))\n .use(require('./lib/plugins/isLight.js'))\n .use(require('./lib/plugins/lighten.js'))\n .use(require('./lib/plugins/luminance.js'))\n .use(require('./lib/plugins/mix.js'))\n .use(require('./lib/plugins/negate.js'))\n .use(require('./lib/plugins/opaquer.js'))\n .use(require('./lib/plugins/rotate.js'))\n .use(require('./lib/plugins/saturate.js'))\n .use(require('./lib/plugins/toAlpha.js'));\n"]} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..048ce35 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,2577 @@ +{ + "name": "onecolor", + "version": "3.1.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "abbrev": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.0.9.tgz", + "integrity": "sha1-kbR5JYinc4wl813W9jdSovh3YTU=", + "dev": true + }, + "acorn": { + "version": "4.0.13", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-4.0.13.tgz", + "integrity": "sha1-EFSVrlNh1pe9GVyCUZLhrX8lN4c=", + "dev": true + }, + "ajv": { + "version": "5.5.2", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz", + "integrity": "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=", + "dev": true, + "optional": true, + "requires": { + "co": "^4.6.0", + "fast-deep-equal": "^1.0.0", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.3.0" + } + }, + "align-text": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/align-text/-/align-text-0.1.4.tgz", + "integrity": "sha1-DNkKVhCT810KmSVsIrcGlDP60Rc=", + "dev": true, + "requires": { + "kind-of": "^3.0.2", + "longest": "^1.0.1", + "repeat-string": "^1.5.2" + } + }, + "amdefine": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz", + "integrity": "sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU=", + "dev": true, + "optional": true + }, + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true + }, + "ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", + "dev": true + }, + "argparse": { + "version": "0.1.16", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-0.1.16.tgz", + "integrity": "sha1-z9AeD7uj1srtBJ+9dY1A9lGW9Xw=", + "dev": true, + "requires": { + "underscore": "~1.7.0", + "underscore.string": "~2.4.0" + } + }, + "arr-diff": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-2.0.0.tgz", + "integrity": "sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8=", + "dev": true, + "requires": { + "arr-flatten": "^1.0.1" + } + }, + "arr-flatten": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", + "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==", + "dev": true + }, + "array-changes": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/array-changes/-/array-changes-1.3.0.tgz", + "integrity": "sha1-RKba4Hb/wM9RrNnWwLS00/Ozbk8=", + "dev": true, + "requires": { + "arraydiff-papandreou": "0.1.1-patch1" + } + }, + "array-changes-async": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-changes-async/-/array-changes-async-2.1.0.tgz", + "integrity": "sha1-LYZZT26tQrao5taw3YVF0AtDREY=", + "dev": true, + "requires": { + "arraydiff-async": "0.2.0" + } + }, + "array-unique": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.2.1.tgz", + "integrity": "sha1-odl8yvy8JiXMcPrc6zalDFiwGlM=", + "dev": true + }, + "arraydiff-async": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/arraydiff-async/-/arraydiff-async-0.2.0.tgz", + "integrity": "sha1-uwUouY6BS3AvAfSWvHO+w+V/QIY=", + "dev": true + }, + "arraydiff-papandreou": { + "version": "0.1.1-patch1", + "resolved": "https://registry.npmjs.org/arraydiff-papandreou/-/arraydiff-papandreou-0.1.1-patch1.tgz", + "integrity": "sha1-ApAnC/27Sy762LdIJjitWnIQkhA=", + "dev": true + }, + "asn1": { + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", + "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", + "dev": true, + "requires": { + "safer-buffer": "~2.1.0" + } + }, + "assert-plus": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-0.2.0.tgz", + "integrity": "sha1-104bh+ev/A24qttwIfP+SBAasjQ=", + "dev": true + }, + "async": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/async/-/async-2.6.1.tgz", + "integrity": "sha512-fNEiL2+AZt6AlAw/29Cr0UDe4sRAHCpEHh54WMz+Bb7QfNcFw4h3loofyJpLeQs4Yx7yuqu/2dLgM5hKOs6HlQ==", + "dev": true, + "requires": { + "lodash": "^4.17.10" + } + }, + "asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", + "dev": true, + "optional": true + }, + "aws-sign2": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.6.0.tgz", + "integrity": "sha1-FDQt0428yU0OW4fXY81jYSwOeU8=", + "dev": true + }, + "aws4": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.8.0.tgz", + "integrity": "sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==", + "dev": true, + "optional": true + }, + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true + }, + "bcrypt-pbkdf": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", + "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", + "dev": true, + "optional": true, + "requires": { + "tweetnacl": "^0.14.3" + } + }, + "bl": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/bl/-/bl-1.0.3.tgz", + "integrity": "sha1-/FQhoo/UImA2w7OJGmaiW8ZNIm4=", + "dev": true, + "requires": { + "readable-stream": "~2.0.5" + } + }, + "boom": { + "version": "2.10.1", + "resolved": "https://registry.npmjs.org/boom/-/boom-2.10.1.tgz", + "integrity": "sha1-OciRjO/1eZ+D+UkqhI9iWt0Mdm8=", + "dev": true, + "requires": { + "hoek": "2.x.x" + } + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "braces": { + "version": "1.8.5", + "resolved": "https://registry.npmjs.org/braces/-/braces-1.8.5.tgz", + "integrity": "sha1-uneWLhLf+WnWt2cR6RS3N4V79qc=", + "dev": true, + "requires": { + "expand-range": "^1.8.1", + "preserve": "^0.2.0", + "repeat-element": "^1.1.2" + } + }, + "buffer-from": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", + "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", + "dev": true, + "optional": true + }, + "camelcase": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-1.2.1.tgz", + "integrity": "sha1-m7UwTS4LVmmLLHWLCKPqqdqlijk=", + "dev": true + }, + "caseless": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.11.0.tgz", + "integrity": "sha1-cVuW6phBWTzDMGeSP17GDr2k99c=", + "dev": true + }, + "center-align": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/center-align/-/center-align-0.1.3.tgz", + "integrity": "sha1-qg0yYptu6XIgBBHL1EYckHvCt60=", + "dev": true, + "requires": { + "align-text": "^0.1.3", + "lazy-cache": "^1.0.3" + } + }, + "chalk": { + "version": "1.1.3", + "resolved": "http://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "dev": true, + "requires": { + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" + } + }, + "cli": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/cli/-/cli-1.0.1.tgz", + "integrity": "sha1-IoF1NPJL+klQw01TLUjsvGIbjBQ=", + "dev": true, + "requires": { + "exit": "0.1.2", + "glob": "^7.1.1" + }, + "dependencies": { + "glob": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", + "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + } + } + }, + "cliui": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-2.1.0.tgz", + "integrity": "sha1-S0dXYP+AJkx2LDoXGQMukcf+oNE=", + "dev": true, + "requires": { + "center-align": "^0.1.1", + "right-align": "^0.1.1", + "wordwrap": "0.0.2" + }, + "dependencies": { + "wordwrap": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz", + "integrity": "sha1-t5Zpu0LstAn4PVg8rVLKF+qhZD8=", + "dev": true + } + } + }, + "co": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", + "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=", + "dev": true, + "optional": true + }, + "color-diff": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/color-diff/-/color-diff-0.1.7.tgz", + "integrity": "sha1-bbeM2UgqjkWdQIIer0tQMoPcuOI=", + "dev": true + }, + "colors": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/colors/-/colors-1.0.3.tgz", + "integrity": "sha1-BDP0TYCWgP3rYO0mDxsMJi6CpAs=", + "dev": true, + "optional": true + }, + "combined-stream": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.6.tgz", + "integrity": "sha1-cj599ugBrFYTETp+RFqbactjKBg=", + "dev": true, + "requires": { + "delayed-stream": "~1.0.0" + } + }, + "commander": { + "version": "2.18.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.18.0.tgz", + "integrity": "sha512-6CYPa+JP2ftfRU2qkDK+UTVeQYosOg/2GbcjIcKPHfinyOLPVGXu/ovN86RP49Re5ndJK1N0kuiidFFuepc4ZQ==", + "dev": true + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true + }, + "concat-stream": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", + "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", + "dev": true, + "optional": true, + "requires": { + "buffer-from": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^2.2.2", + "typedarray": "^0.0.6" + }, + "dependencies": { + "process-nextick-args": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", + "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==", + "dev": true, + "optional": true + }, + "readable-stream": { + "version": "2.3.6", + "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", + "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", + "dev": true, + "optional": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "optional": true, + "requires": { + "safe-buffer": "~5.1.0" + } + } + } + }, + "console-browserify": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/console-browserify/-/console-browserify-1.1.0.tgz", + "integrity": "sha1-8CQcRXMKn8YyOyBtvzjtx0HQuxA=", + "dev": true, + "requires": { + "date-now": "^0.1.4" + } + }, + "core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", + "dev": true + }, + "coveralls": { + "version": "2.11.9", + "resolved": "https://registry.npmjs.org/coveralls/-/coveralls-2.11.9.tgz", + "integrity": "sha1-+f8Boa2/IqEp41qNYjRaUqeBs5U=", + "dev": true, + "requires": { + "js-yaml": "3.0.1", + "lcov-parse": "0.0.6", + "log-driver": "1.2.4", + "minimist": "1.2.0", + "request": "2.67.0" + } + }, + "cryptiles": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-2.0.5.tgz", + "integrity": "sha1-O9/s3GCBR8HGcgL6KR59ylnqo7g=", + "dev": true, + "requires": { + "boom": "2.x.x" + } + }, + "cycle": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/cycle/-/cycle-1.0.3.tgz", + "integrity": "sha1-IegLK+hYD5i0aPN5QwZisEbDStI=", + "dev": true, + "optional": true + }, + "dashdash": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", + "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", + "dev": true, + "requires": { + "assert-plus": "^1.0.0" + }, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", + "dev": true + } + } + }, + "date-now": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/date-now/-/date-now-0.1.4.tgz", + "integrity": "sha1-6vQ5/U1ISK105cx9vvIAZyueNFs=", + "dev": true + }, + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "optional": true, + "requires": { + "ms": "2.0.0" + } + }, + "decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", + "dev": true + }, + "deep-is": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", + "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", + "dev": true + }, + "delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", + "dev": true + }, + "detect-indent": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-3.0.1.tgz", + "integrity": "sha1-ncXl3bzu+DJXZLlFGwK8bVQIT3U=", + "dev": true, + "requires": { + "get-stdin": "^4.0.1", + "minimist": "^1.1.0", + "repeating": "^1.1.0" + } + }, + "diff": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-1.4.0.tgz", + "integrity": "sha1-fyjS657nsVqX79ic5j3P2qPMur8=", + "dev": true + }, + "dom-serializer": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.1.0.tgz", + "integrity": "sha1-BzxpdUbOB4DOI75KKOKT5AvDDII=", + "dev": true, + "requires": { + "domelementtype": "~1.1.1", + "entities": "~1.1.1" + }, + "dependencies": { + "domelementtype": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.1.3.tgz", + "integrity": "sha1-vSh3PiZCiBrsUVRJJCmcXNgiGFs=", + "dev": true + }, + "entities": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/entities/-/entities-1.1.1.tgz", + "integrity": "sha1-blwtClYhtdra7O+AuQ7ftc13cvA=", + "dev": true + } + } + }, + "domelementtype": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.3.0.tgz", + "integrity": "sha1-sXrtguirWeUt2cGbF1bg/BhyBMI=", + "dev": true + }, + "domhandler": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-2.3.0.tgz", + "integrity": "sha1-LeWaCCLVAn+r/28DLCsloqir5zg=", + "dev": true, + "requires": { + "domelementtype": "1" + } + }, + "domutils": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/domutils/-/domutils-1.5.1.tgz", + "integrity": "sha1-3NhIiib1Y9YQeeSMn3t+Mjc2gs8=", + "dev": true, + "requires": { + "dom-serializer": "0", + "domelementtype": "1" + } + }, + "ecc-jsbn": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", + "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", + "dev": true, + "optional": true, + "requires": { + "jsbn": "~0.1.0", + "safer-buffer": "^2.1.0" + } + }, + "entities": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-1.0.0.tgz", + "integrity": "sha1-sph6o4ITR/zeZCsk/fyeT7cSvyY=", + "dev": true + }, + "es6-promise": { + "version": "4.2.5", + "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.5.tgz", + "integrity": "sha512-n6wvpdE43VFtJq+lUDYDBFUwV8TZbuGXLV4D6wKafg13ldznKsyEvatubnmUe31zcvelSzOHF+XbaT+Bl9ObDg==", + "dev": true, + "optional": true + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true + }, + "escodegen": { + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.7.1.tgz", + "integrity": "sha1-MOz89mypjcZ80v0WKr626vqM5vw=", + "dev": true, + "requires": { + "esprima": "^1.2.2", + "estraverse": "^1.9.1", + "esutils": "^2.0.2", + "optionator": "^0.5.0", + "source-map": "~0.2.0" + }, + "dependencies": { + "esprima": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-1.2.5.tgz", + "integrity": "sha1-CZNQL+r2aBODJXVvMPmlH+7sEek=", + "dev": true + } + } + }, + "esprima": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-1.0.4.tgz", + "integrity": "sha1-n1V+CPw7TSbs6d00+Pv0drYlha0=", + "dev": true + }, + "estraverse": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-1.9.3.tgz", + "integrity": "sha1-r2fy3JIlgkFZUJJgkaQAXSnJu0Q=", + "dev": true + }, + "estree-walker": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-0.3.1.tgz", + "integrity": "sha1-5rGlHPcpJSTnI3wxLl/mZgwc4ao=", + "dev": true + }, + "esutils": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", + "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", + "dev": true + }, + "exit": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz", + "integrity": "sha1-BjJjj42HfMghB9MKD/8aF8uhzQw=", + "dev": true + }, + "expand-brackets": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-0.1.5.tgz", + "integrity": "sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s=", + "dev": true, + "requires": { + "is-posix-bracket": "^0.1.0" + } + }, + "expand-range": { + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/expand-range/-/expand-range-1.8.2.tgz", + "integrity": "sha1-opnv/TNf4nIeuujiV+x5ZE/IUzc=", + "dev": true, + "requires": { + "fill-range": "^2.1.0" + } + }, + "extend": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", + "dev": true + }, + "extglob": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/extglob/-/extglob-0.3.2.tgz", + "integrity": "sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE=", + "dev": true, + "requires": { + "is-extglob": "^1.0.0" + } + }, + "extract-zip": { + "version": "1.6.7", + "resolved": "https://registry.npmjs.org/extract-zip/-/extract-zip-1.6.7.tgz", + "integrity": "sha1-qEC0uK9kAyZMjbV/Txp0Mz74H+k=", + "dev": true, + "optional": true, + "requires": { + "concat-stream": "1.6.2", + "debug": "2.6.9", + "mkdirp": "0.5.1", + "yauzl": "2.4.1" + } + }, + "extsprintf": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", + "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=", + "dev": true + }, + "eyes": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/eyes/-/eyes-0.1.8.tgz", + "integrity": "sha1-Ys8SAjTGg3hdkCNIqADvPgzCC8A=", + "dev": true, + "optional": true + }, + "fast-deep-equal": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz", + "integrity": "sha1-wFNHeBfIa1HaqFPIHgWbcz0CNhQ=", + "dev": true, + "optional": true + }, + "fast-json-stable-stringify": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", + "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=", + "dev": true, + "optional": true + }, + "fast-levenshtein": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-1.0.7.tgz", + "integrity": "sha1-AXjc3uAjuSkFGTrwlZ6KdjnP3Lk=", + "dev": true + }, + "fd-slicer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.0.1.tgz", + "integrity": "sha1-i1vL2ewyfFBBv5qwI/1nUPEXfmU=", + "dev": true, + "optional": true, + "requires": { + "pend": "~1.2.0" + } + }, + "filename-regex": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/filename-regex/-/filename-regex-2.0.1.tgz", + "integrity": "sha1-wcS5vuPglyXdsQa3XB4wH+LxiyY=", + "dev": true + }, + "fileset": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/fileset/-/fileset-0.2.1.tgz", + "integrity": "sha1-WI74lzxmI7KnbfRlEFaWuWqsgGc=", + "dev": true, + "requires": { + "glob": "5.x", + "minimatch": "2.x" + } + }, + "fill-keys": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/fill-keys/-/fill-keys-1.0.2.tgz", + "integrity": "sha1-mo+jb06K1jTjv2tPPIiCVRRS6yA=", + "dev": true, + "requires": { + "is-object": "~1.0.1", + "merge-descriptors": "~1.0.0" + } + }, + "fill-range": { + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-2.2.4.tgz", + "integrity": "sha512-cnrcCbj01+j2gTG921VZPnHbjmdAf8oQV/iGeV2kZxGSyfYjjTyY79ErsK1WJWMpw6DaApEX72binqJE+/d+5Q==", + "dev": true, + "requires": { + "is-number": "^2.1.0", + "isobject": "^2.0.0", + "randomatic": "^3.0.0", + "repeat-element": "^1.1.2", + "repeat-string": "^1.5.2" + } + }, + "for-in": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", + "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", + "dev": true + }, + "for-own": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/for-own/-/for-own-0.1.5.tgz", + "integrity": "sha1-UmXGgaTylNq78XyVCbZ2OqhFEM4=", + "dev": true, + "requires": { + "for-in": "^1.0.1" + } + }, + "forever-agent": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", + "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=", + "dev": true + }, + "form-data": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-1.0.1.tgz", + "integrity": "sha1-rjFduaSQf6BlUCMEpm13M0de43w=", + "dev": true, + "requires": { + "async": "^2.0.1", + "combined-stream": "^1.0.5", + "mime-types": "^2.1.11" + } + }, + "fs-extra": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-1.0.0.tgz", + "integrity": "sha1-zTzl9+fLYUWIP8rjGR6Yd/hYeVA=", + "dev": true, + "optional": true, + "requires": { + "graceful-fs": "^4.1.2", + "jsonfile": "^2.1.0", + "klaw": "^1.0.0" + } + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "generate-function": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/generate-function/-/generate-function-2.3.1.tgz", + "integrity": "sha512-eeB5GfMNeevm/GRYq20ShmsaGcmI81kIX2K9XQx5miC8KdHaC6Jm0qQ8ZNeGOi7wYB8OsdxKs+Y2oVuTFuVwKQ==", + "dev": true, + "requires": { + "is-property": "^1.0.2" + } + }, + "generate-object-property": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/generate-object-property/-/generate-object-property-1.2.0.tgz", + "integrity": "sha1-nA4cQDCM6AT0eDYYuTf6iPmdUNA=", + "dev": true, + "requires": { + "is-property": "^1.0.0" + } + }, + "get-stdin": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-4.0.1.tgz", + "integrity": "sha1-uWjGsKBDhDJJAui/Gl3zJXmkUP4=", + "dev": true + }, + "getpass": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", + "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", + "dev": true, + "requires": { + "assert-plus": "^1.0.0" + }, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", + "dev": true + } + } + }, + "glob": { + "version": "5.0.15", + "resolved": "https://registry.npmjs.org/glob/-/glob-5.0.15.tgz", + "integrity": "sha1-G8k2ueAvSmA/zCIuz3Yz0wuLk7E=", + "dev": true, + "requires": { + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "2 || 3", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "glob-base": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/glob-base/-/glob-base-0.3.0.tgz", + "integrity": "sha1-27Fk9iIbHAscz4Kuoyi0l98Oo8Q=", + "dev": true, + "requires": { + "glob-parent": "^2.0.0", + "is-glob": "^2.0.0" + } + }, + "glob-parent": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz", + "integrity": "sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg=", + "dev": true, + "requires": { + "is-glob": "^2.0.0" + } + }, + "graceful-fs": { + "version": "4.1.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", + "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=", + "dev": true, + "optional": true + }, + "growl": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/growl/-/growl-1.8.1.tgz", + "integrity": "sha1-Sy3sjZB+k9szZiTc7AGDUC+MlCg=", + "dev": true + }, + "handlebars": { + "version": "4.0.12", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.0.12.tgz", + "integrity": "sha512-RhmTekP+FZL+XNhwS1Wf+bTTZpdLougwt5pcgA1tuz6Jcx0fpH/7z0qd71RKnZHBCxIRBHfBOnio4gViPemNzA==", + "dev": true, + "requires": { + "async": "^2.5.0", + "optimist": "^0.6.1", + "source-map": "^0.6.1", + "uglify-js": "^3.1.4" + }, + "dependencies": { + "commander": { + "version": "2.17.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.17.1.tgz", + "integrity": "sha512-wPMUt6FnH2yzG95SA6mzjQOEKUU3aLaDEmzs1ti+1E9h+CsrZghRlqEM/EJ4KscsQVG8uNN4uVreUeT8+drlgg==", + "dev": true, + "optional": true + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, + "uglify-js": { + "version": "3.4.9", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.4.9.tgz", + "integrity": "sha512-8CJsbKOtEbnJsTyv6LE6m6ZKniqMiFWmm9sRbopbkGs3gMPPfd3Fh8iIA4Ykv5MgaTbqHr4BaoGLJLZNhsrW1Q==", + "dev": true, + "optional": true, + "requires": { + "commander": "~2.17.1", + "source-map": "~0.6.1" + } + } + } + }, + "har-schema": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", + "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=", + "dev": true, + "optional": true + }, + "har-validator": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-2.0.6.tgz", + "integrity": "sha1-zcvAgYgmWtEZtqWnyKtw7s+10n0=", + "dev": true, + "requires": { + "chalk": "^1.1.1", + "commander": "^2.9.0", + "is-my-json-valid": "^2.12.4", + "pinkie-promise": "^2.0.0" + } + }, + "has-ansi": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", + "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "has-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz", + "integrity": "sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo=", + "dev": true + }, + "hasha": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/hasha/-/hasha-2.2.0.tgz", + "integrity": "sha1-eNfL/B5tZjA/55g3NlmEUXsvbuE=", + "dev": true, + "optional": true, + "requires": { + "is-stream": "^1.0.1", + "pinkie-promise": "^2.0.0" + } + }, + "hawk": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/hawk/-/hawk-3.1.3.tgz", + "integrity": "sha1-B4REvXwWQLD+VA0sm3PVlnjo4cQ=", + "dev": true, + "requires": { + "boom": "2.x.x", + "cryptiles": "2.x.x", + "hoek": "2.x.x", + "sntp": "1.x.x" + } + }, + "hoek": { + "version": "2.16.3", + "resolved": "https://registry.npmjs.org/hoek/-/hoek-2.16.3.tgz", + "integrity": "sha1-ILt0A9POo5jpHcRxCo/xuCdKJe0=", + "dev": true + }, + "htmlparser2": { + "version": "3.8.3", + "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-3.8.3.tgz", + "integrity": "sha1-mWwosZFRaovoZQGn15dX5ccMEGg=", + "dev": true, + "requires": { + "domelementtype": "1", + "domhandler": "2.3", + "domutils": "1.5", + "entities": "1.0", + "readable-stream": "1.1" + }, + "dependencies": { + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", + "dev": true + }, + "readable-stream": { + "version": "1.1.14", + "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", + "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", + "isarray": "0.0.1", + "string_decoder": "~0.10.x" + } + } + } + }, + "http-signature": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.1.1.tgz", + "integrity": "sha1-33LiZwZs0Kxn+3at+OE0qPvPkb8=", + "dev": true, + "requires": { + "assert-plus": "^0.2.0", + "jsprim": "^1.2.2", + "sshpk": "^1.7.0" + } + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", + "dev": true + }, + "is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true + }, + "is-dotfile": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/is-dotfile/-/is-dotfile-1.0.3.tgz", + "integrity": "sha1-pqLzL/0t+wT1yiXs0Pa4PPeYoeE=", + "dev": true + }, + "is-equal-shallow": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz", + "integrity": "sha1-IjgJj8Ih3gvPpdnqxMRdY4qhxTQ=", + "dev": true, + "requires": { + "is-primitive": "^2.0.0" + } + }, + "is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", + "dev": true + }, + "is-extglob": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", + "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=", + "dev": true + }, + "is-finite": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.0.2.tgz", + "integrity": "sha1-zGZ3aVYCvlUO8R6LSqYwU0K20Ko=", + "dev": true, + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "is-glob": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", + "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", + "dev": true, + "requires": { + "is-extglob": "^1.0.0" + } + }, + "is-my-ip-valid": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-my-ip-valid/-/is-my-ip-valid-1.0.0.tgz", + "integrity": "sha512-gmh/eWXROncUzRnIa1Ubrt5b8ep/MGSnfAUI3aRp+sqTCs1tv1Isl8d8F6JmkN3dXKc3ehZMrtiPN9eL03NuaQ==", + "dev": true + }, + "is-my-json-valid": { + "version": "2.19.0", + "resolved": "https://registry.npmjs.org/is-my-json-valid/-/is-my-json-valid-2.19.0.tgz", + "integrity": "sha512-mG0f/unGX1HZ5ep4uhRaPOS8EkAY8/j6mDRMJrutq4CqhoJWYp7qAlonIPy3TV7p3ju4TK9fo/PbnoksWmsp5Q==", + "dev": true, + "requires": { + "generate-function": "^2.0.0", + "generate-object-property": "^1.1.0", + "is-my-ip-valid": "^1.0.0", + "jsonpointer": "^4.0.0", + "xtend": "^4.0.0" + } + }, + "is-number": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-2.1.0.tgz", + "integrity": "sha1-Afy7s5NGOlSPL0ZszhbezknbkI8=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + } + }, + "is-object": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-object/-/is-object-1.0.1.tgz", + "integrity": "sha1-iVJojF7C/9awPsyF52ngKQMINHA=", + "dev": true + }, + "is-posix-bracket": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz", + "integrity": "sha1-MzTceXdDaOkvAW5vvAqI9c1ua8Q=", + "dev": true + }, + "is-primitive": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-primitive/-/is-primitive-2.0.0.tgz", + "integrity": "sha1-IHurkWOEmcB7Kt8kCkGochADRXU=", + "dev": true + }, + "is-property": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz", + "integrity": "sha1-V/4cTkhHTt1lsJkR8msc1Ald2oQ=", + "dev": true + }, + "is-stream": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", + "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", + "dev": true, + "optional": true + }, + "is-typedarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", + "dev": true + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true + }, + "isobject": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", + "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", + "dev": true, + "requires": { + "isarray": "1.0.0" + } + }, + "isstream": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", + "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=", + "dev": true + }, + "istanbul": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/istanbul/-/istanbul-0.4.2.tgz", + "integrity": "sha1-dl5yi5RVvt222qe5zsS5w8Pt5Ic=", + "dev": true, + "requires": { + "abbrev": "1.0.x", + "async": "1.x", + "escodegen": "1.7.x", + "esprima": "2.7.x", + "fileset": "0.2.x", + "handlebars": "^4.0.1", + "js-yaml": "3.x", + "mkdirp": "0.5.x", + "nopt": "3.x", + "once": "1.x", + "resolve": "1.1.x", + "supports-color": "^3.1.0", + "which": "^1.1.1", + "wordwrap": "^1.0.0" + }, + "dependencies": { + "async": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", + "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=", + "dev": true + }, + "esprima": { + "version": "2.7.3", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-2.7.3.tgz", + "integrity": "sha1-luO3DVd59q1JzQMmc9HDEnZ7pYE=", + "dev": true + }, + "supports-color": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.2.3.tgz", + "integrity": "sha1-ZawFBLOVQXHYpklGsq48u4pfVPY=", + "dev": true, + "requires": { + "has-flag": "^1.0.0" + } + } + } + }, + "jade": { + "version": "0.26.3", + "resolved": "https://registry.npmjs.org/jade/-/jade-0.26.3.tgz", + "integrity": "sha1-jxDXl32NefL2/4YqgbBRPMslaGw=", + "dev": true, + "requires": { + "commander": "0.6.1", + "mkdirp": "0.3.0" + }, + "dependencies": { + "commander": { + "version": "0.6.1", + "resolved": "http://registry.npmjs.org/commander/-/commander-0.6.1.tgz", + "integrity": "sha1-+mihT2qUXVTbvlDYzbMyDp47GgY=", + "dev": true + }, + "mkdirp": { + "version": "0.3.0", + "resolved": "http://registry.npmjs.org/mkdirp/-/mkdirp-0.3.0.tgz", + "integrity": "sha1-G79asbqCevI1dRQ0kEJkVfSB/h4=", + "dev": true + } + } + }, + "js-yaml": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.0.1.tgz", + "integrity": "sha1-dkBf6lvOMPyPQF1Ixtyn8KMsav4=", + "dev": true, + "requires": { + "argparse": "~ 0.1.11", + "esprima": "~ 1.0.2" + } + }, + "jsbn": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", + "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", + "dev": true, + "optional": true + }, + "jshint": { + "version": "2.9.6", + "resolved": "https://registry.npmjs.org/jshint/-/jshint-2.9.6.tgz", + "integrity": "sha512-KO9SIAKTlJQOM4lE64GQUtGBRpTOuvbrRrSZw3AhUxMNG266nX9hK2cKA4SBhXOj0irJGyNyGSLT62HGOVDEOA==", + "dev": true, + "requires": { + "cli": "~1.0.0", + "console-browserify": "1.1.x", + "exit": "0.1.x", + "htmlparser2": "3.8.x", + "lodash": "~4.17.10", + "minimatch": "~3.0.2", + "phantom": "~4.0.1", + "phantomjs-prebuilt": "~2.1.7", + "shelljs": "0.3.x", + "strip-json-comments": "1.0.x", + "unicode-5.2.0": "^0.7.5" + }, + "dependencies": { + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + } + } + }, + "json-schema": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", + "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=", + "dev": true + }, + "json-schema-traverse": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz", + "integrity": "sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A=", + "dev": true, + "optional": true + }, + "json-stringify-safe": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", + "dev": true + }, + "jsonfile": { + "version": "2.4.0", + "resolved": "http://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz", + "integrity": "sha1-NzaitCi4e72gzIO1P6PWM6NcKug=", + "dev": true, + "optional": true, + "requires": { + "graceful-fs": "^4.1.6" + } + }, + "jsonpointer": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/jsonpointer/-/jsonpointer-4.0.1.tgz", + "integrity": "sha1-T9kss04OnbPInIYi7PUfm5eMbLk=", + "dev": true + }, + "jsprim": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", + "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", + "dev": true, + "requires": { + "assert-plus": "1.0.0", + "extsprintf": "1.3.0", + "json-schema": "0.2.3", + "verror": "1.10.0" + }, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", + "dev": true + } + } + }, + "kew": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/kew/-/kew-0.7.0.tgz", + "integrity": "sha1-edk9LTM2PW/dKXCzNdkUGtWR15s=", + "dev": true, + "optional": true + }, + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + }, + "klaw": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/klaw/-/klaw-1.3.1.tgz", + "integrity": "sha1-QIhDO0azsbolnXh4XY6W9zugJDk=", + "dev": true, + "optional": true, + "requires": { + "graceful-fs": "^4.1.9" + } + }, + "lazy-cache": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/lazy-cache/-/lazy-cache-1.0.4.tgz", + "integrity": "sha1-odePw6UEdMuAhF07O24dpJpEbo4=", + "dev": true + }, + "lcov-parse": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/lcov-parse/-/lcov-parse-0.0.6.tgz", + "integrity": "sha1-gZ5dqL8HkfnT857qXtGGgYfxEXU=", + "dev": true + }, + "leven": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/leven/-/leven-2.0.0.tgz", + "integrity": "sha1-dMRXREOVUNoYWAGRKCn2HSIHG8E=", + "dev": true + }, + "levn": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.2.5.tgz", + "integrity": "sha1-uo0znQykphDjo/FFucr0iAcVUFQ=", + "dev": true, + "requires": { + "prelude-ls": "~1.1.0", + "type-check": "~0.3.1" + } + }, + "lodash": { + "version": "4.17.11", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", + "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", + "dev": true + }, + "log-driver": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/log-driver/-/log-driver-1.2.4.tgz", + "integrity": "sha1-LWLX+u9F2KcTQZYaBLB2HsqZz6M=", + "dev": true + }, + "longest": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/longest/-/longest-1.0.1.tgz", + "integrity": "sha1-MKCy2jj3N3DoKUoNIuZiXtd9AJc=", + "dev": true + }, + "lru-cache": { + "version": "2.7.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-2.7.3.tgz", + "integrity": "sha1-bUUk6LlV+V1PW1iFHOId1y+06VI=", + "dev": true + }, + "magic-string": { + "version": "0.19.1", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.19.1.tgz", + "integrity": "sha1-FNdoATyvLsj96hakmvgvw3fnUgE=", + "dev": true, + "requires": { + "vlq": "^0.2.1" + } + }, + "magicpen": { + "version": "5.9.0", + "resolved": "https://registry.npmjs.org/magicpen/-/magicpen-5.9.0.tgz", + "integrity": "sha1-fSy/2IN6narU55+IOQoFOP2QHJQ=", + "dev": true, + "requires": { + "ansi-styles": "2.0.0", + "color-diff": "0.1.7", + "supports-color": "1.2.0" + }, + "dependencies": { + "ansi-styles": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.0.0.tgz", + "integrity": "sha1-QysmFi/qG2PIeIlqvIzFVI8lBj4=", + "dev": true + }, + "supports-color": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-1.2.0.tgz", + "integrity": "sha1-/x7R5hFp0Gs88tWI4YixjYhH4X4=", + "dev": true + } + } + }, + "math-random": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/math-random/-/math-random-1.0.1.tgz", + "integrity": "sha1-izqsWIuKZuSXXjzepn97sylgH6w=", + "dev": true + }, + "merge-descriptors": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", + "integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=", + "dev": true + }, + "micromatch": { + "version": "2.3.11", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-2.3.11.tgz", + "integrity": "sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU=", + "dev": true, + "requires": { + "arr-diff": "^2.0.0", + "array-unique": "^0.2.1", + "braces": "^1.8.2", + "expand-brackets": "^0.1.4", + "extglob": "^0.3.1", + "filename-regex": "^2.0.0", + "is-extglob": "^1.0.0", + "is-glob": "^2.0.1", + "kind-of": "^3.0.2", + "normalize-path": "^2.0.1", + "object.omit": "^2.0.0", + "parse-glob": "^3.0.4", + "regex-cache": "^0.4.2" + } + }, + "mime-db": { + "version": "1.36.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.36.0.tgz", + "integrity": "sha512-L+xvyD9MkoYMXb1jAmzI/lWYAxAMCPvIBSWur0PZ5nOf5euahRLVqH//FKW9mWp2lkqUgYiXPgkzfMUFi4zVDw==", + "dev": true + }, + "mime-types": { + "version": "2.1.20", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.20.tgz", + "integrity": "sha512-HrkrPaP9vGuWbLK1B1FfgAkbqNjIuy4eHlIYnFi7kamZyLLrGlo2mpcx0bBmNpKqBtYtAfGbodDddIgddSJC2A==", + "dev": true, + "requires": { + "mime-db": "~1.36.0" + } + }, + "minimatch": { + "version": "2.0.10", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-2.0.10.tgz", + "integrity": "sha1-jQh8OcazjAAbl/ynzm0OHoCvusc=", + "dev": true, + "requires": { + "brace-expansion": "^1.0.0" + } + }, + "minimist": { + "version": "1.2.0", + "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "dev": true + }, + "mkdirp": { + "version": "0.5.1", + "resolved": "http://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "dev": true, + "requires": { + "minimist": "0.0.8" + }, + "dependencies": { + "minimist": { + "version": "0.0.8", + "resolved": "http://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", + "dev": true + } + } + }, + "mocha": { + "version": "2.4.5", + "resolved": "http://registry.npmjs.org/mocha/-/mocha-2.4.5.tgz", + "integrity": "sha1-FRdo3Sh161G8gpXpgAAm6fK7OY8=", + "dev": true, + "requires": { + "commander": "2.3.0", + "debug": "2.2.0", + "diff": "1.4.0", + "escape-string-regexp": "1.0.2", + "glob": "3.2.3", + "growl": "1.8.1", + "jade": "0.26.3", + "mkdirp": "0.5.1", + "supports-color": "1.2.0" + }, + "dependencies": { + "commander": { + "version": "2.3.0", + "resolved": "http://registry.npmjs.org/commander/-/commander-2.3.0.tgz", + "integrity": "sha1-/UMOiJgy7DU7ms0d4hfBHLPu+HM=", + "dev": true + }, + "debug": { + "version": "2.2.0", + "resolved": "http://registry.npmjs.org/debug/-/debug-2.2.0.tgz", + "integrity": "sha1-+HBX6ZWxofauaklgZkE3vFbwOdo=", + "dev": true, + "requires": { + "ms": "0.7.1" + } + }, + "escape-string-regexp": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.2.tgz", + "integrity": "sha1-Tbwv5nTnGUnK8/smlc5/LcHZqNE=", + "dev": true + }, + "glob": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-3.2.3.tgz", + "integrity": "sha1-4xPusknHr/qlxHUoaw4RW1mDlGc=", + "dev": true, + "requires": { + "graceful-fs": "~2.0.0", + "inherits": "2", + "minimatch": "~0.2.11" + } + }, + "graceful-fs": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-2.0.3.tgz", + "integrity": "sha1-fNLNsiiko/Nule+mzBQt59GhNtA=", + "dev": true + }, + "minimatch": { + "version": "0.2.14", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-0.2.14.tgz", + "integrity": "sha1-x054BXT2PG+aCQ6Q775u9TpqdWo=", + "dev": true, + "requires": { + "lru-cache": "2", + "sigmund": "~1.0.0" + } + }, + "ms": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-0.7.1.tgz", + "integrity": "sha1-nNE8A62/8ltl7/3nzoZO6VIBcJg=", + "dev": true + }, + "supports-color": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-1.2.0.tgz", + "integrity": "sha1-/x7R5hFp0Gs88tWI4YixjYhH4X4=", + "dev": true + } + } + }, + "mocha-lcov-reporter": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/mocha-lcov-reporter/-/mocha-lcov-reporter-1.2.0.tgz", + "integrity": "sha1-j3uhUSrhJxYR2SdmnZm2wumfBY8=", + "dev": true + }, + "module-not-found-error": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/module-not-found-error/-/module-not-found-error-1.0.1.tgz", + "integrity": "sha1-z4tP9PKWQGdNbN0CsOO8UjwrvcA=", + "dev": true + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true, + "optional": true + }, + "node-uuid": { + "version": "1.4.8", + "resolved": "https://registry.npmjs.org/node-uuid/-/node-uuid-1.4.8.tgz", + "integrity": "sha1-sEDrCSOWivq/jTL7HxfxFn/auQc=", + "dev": true + }, + "nopt": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz", + "integrity": "sha1-xkZdvwirzU2zWTF/eaxopkayj/k=", + "dev": true, + "requires": { + "abbrev": "1" + } + }, + "normalize-path": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", + "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", + "dev": true, + "requires": { + "remove-trailing-separator": "^1.0.1" + } + }, + "number-is-nan": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", + "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", + "dev": true + }, + "oauth-sign": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.2.tgz", + "integrity": "sha1-Rqarfwrq2N6unsBWV4C31O/rnUM=", + "dev": true + }, + "object.omit": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/object.omit/-/object.omit-2.0.1.tgz", + "integrity": "sha1-Gpx0SCnznbuFjHbKNXmuKlTr0fo=", + "dev": true, + "requires": { + "for-own": "^0.1.4", + "is-extendable": "^0.1.1" + } + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, + "requires": { + "wrappy": "1" + } + }, + "optimist": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz", + "integrity": "sha1-2j6nRob6IaGaERwybpDrFaAZZoY=", + "dev": true, + "requires": { + "minimist": "~0.0.1", + "wordwrap": "~0.0.2" + }, + "dependencies": { + "minimist": { + "version": "0.0.10", + "resolved": "http://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz", + "integrity": "sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8=", + "dev": true + }, + "wordwrap": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz", + "integrity": "sha1-o9XabNXAvAAI03I0u68b7WMFkQc=", + "dev": true + } + } + }, + "optionator": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.5.0.tgz", + "integrity": "sha1-t1qJlaLUF98ltuTjhi9QqohlE2g=", + "dev": true, + "requires": { + "deep-is": "~0.1.2", + "fast-levenshtein": "~1.0.0", + "levn": "~0.2.5", + "prelude-ls": "~1.1.1", + "type-check": "~0.3.1", + "wordwrap": "~0.0.2" + }, + "dependencies": { + "wordwrap": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz", + "integrity": "sha1-o9XabNXAvAAI03I0u68b7WMFkQc=", + "dev": true + } + } + }, + "parse-glob": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/parse-glob/-/parse-glob-3.0.4.tgz", + "integrity": "sha1-ssN2z7EfNVE7rdFz7wu246OIORw=", + "dev": true, + "requires": { + "glob-base": "^0.3.0", + "is-dotfile": "^1.0.0", + "is-extglob": "^1.0.0", + "is-glob": "^2.0.0" + } + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true + }, + "pend": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz", + "integrity": "sha1-elfrVQpng/kRUzH89GY9XI4AelA=", + "dev": true, + "optional": true + }, + "performance-now": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", + "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=", + "dev": true, + "optional": true + }, + "phantom": { + "version": "4.0.12", + "resolved": "https://registry.npmjs.org/phantom/-/phantom-4.0.12.tgz", + "integrity": "sha512-Tz82XhtPmwCk1FFPmecy7yRGZG2btpzY2KI9fcoPT7zT9det0CcMyfBFPp1S8DqzsnQnm8ZYEfdy528mwVtksA==", + "dev": true, + "optional": true, + "requires": { + "phantomjs-prebuilt": "^2.1.16", + "split": "^1.0.1", + "winston": "^2.4.0" + } + }, + "phantomjs-prebuilt": { + "version": "2.1.16", + "resolved": "https://registry.npmjs.org/phantomjs-prebuilt/-/phantomjs-prebuilt-2.1.16.tgz", + "integrity": "sha1-79ISpKOWbTZHaE6ouniFSb4q7+8=", + "dev": true, + "optional": true, + "requires": { + "es6-promise": "^4.0.3", + "extract-zip": "^1.6.5", + "fs-extra": "^1.0.0", + "hasha": "^2.2.0", + "kew": "^0.7.0", + "progress": "^1.1.8", + "request": "^2.81.0", + "request-progress": "^2.0.1", + "which": "^1.2.10" + }, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", + "dev": true, + "optional": true + }, + "aws-sign2": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", + "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=", + "dev": true, + "optional": true + }, + "caseless": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", + "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=", + "dev": true, + "optional": true + }, + "form-data": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.2.tgz", + "integrity": "sha1-SXBJi+YEwgwAXU9cI67NIda0kJk=", + "dev": true, + "optional": true, + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "1.0.6", + "mime-types": "^2.1.12" + } + }, + "har-validator": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.0.tgz", + "integrity": "sha512-+qnmNjI4OfH2ipQ9VQOw23bBd/ibtfbVdK2fYbY4acTDqKTW/YDp9McimZdDbG8iV9fZizUqQMD5xvriB146TA==", + "dev": true, + "optional": true, + "requires": { + "ajv": "^5.3.0", + "har-schema": "^2.0.0" + } + }, + "http-signature": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", + "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", + "dev": true, + "optional": true, + "requires": { + "assert-plus": "^1.0.0", + "jsprim": "^1.2.2", + "sshpk": "^1.7.0" + } + }, + "oauth-sign": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", + "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==", + "dev": true, + "optional": true + }, + "qs": { + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", + "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==", + "dev": true, + "optional": true + }, + "request": { + "version": "2.88.0", + "resolved": "https://registry.npmjs.org/request/-/request-2.88.0.tgz", + "integrity": "sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg==", + "dev": true, + "optional": true, + "requires": { + "aws-sign2": "~0.7.0", + "aws4": "^1.8.0", + "caseless": "~0.12.0", + "combined-stream": "~1.0.6", + "extend": "~3.0.2", + "forever-agent": "~0.6.1", + "form-data": "~2.3.2", + "har-validator": "~5.1.0", + "http-signature": "~1.2.0", + "is-typedarray": "~1.0.0", + "isstream": "~0.1.2", + "json-stringify-safe": "~5.0.1", + "mime-types": "~2.1.19", + "oauth-sign": "~0.9.0", + "performance-now": "^2.1.0", + "qs": "~6.5.2", + "safe-buffer": "^5.1.2", + "tough-cookie": "~2.4.3", + "tunnel-agent": "^0.6.0", + "uuid": "^3.3.2" + } + }, + "tough-cookie": { + "version": "2.4.3", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz", + "integrity": "sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==", + "dev": true, + "optional": true, + "requires": { + "psl": "^1.1.24", + "punycode": "^1.4.1" + } + }, + "tunnel-agent": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", + "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", + "dev": true, + "optional": true, + "requires": { + "safe-buffer": "^5.0.1" + } + }, + "uuid": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", + "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==", + "dev": true, + "optional": true + } + } + }, + "pinkie": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", + "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=", + "dev": true + }, + "pinkie-promise": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", + "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", + "dev": true, + "requires": { + "pinkie": "^2.0.0" + } + }, + "prelude-ls": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", + "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", + "dev": true + }, + "preserve": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/preserve/-/preserve-0.2.0.tgz", + "integrity": "sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks=", + "dev": true + }, + "process-nextick-args": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz", + "integrity": "sha1-FQ4gt1ZZCtP5EJPyWk8q2L/zC6M=", + "dev": true + }, + "progress": { + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/progress/-/progress-1.1.8.tgz", + "integrity": "sha1-4mDHj2Fhzdmw5WzD4Khd4Xx6V74=", + "dev": true, + "optional": true + }, + "proxyquire": { + "version": "1.7.4", + "resolved": "https://registry.npmjs.org/proxyquire/-/proxyquire-1.7.4.tgz", + "integrity": "sha1-ZUcZshUxw/H8mm5OJy2jGaBbLpg=", + "dev": true, + "requires": { + "fill-keys": "^1.0.2", + "module-not-found-error": "^1.0.0" + } + }, + "psl": { + "version": "1.1.29", + "resolved": "https://registry.npmjs.org/psl/-/psl-1.1.29.tgz", + "integrity": "sha512-AeUmQ0oLN02flVHXWh9sSJF7mcdFq0ppid/JkErufc3hGIV/AMa8Fo9VgDo/cT2jFdOWoFvHp90qqBH54W+gjQ==", + "dev": true, + "optional": true + }, + "punycode": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", + "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", + "dev": true, + "optional": true + }, + "qs": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/qs/-/qs-5.2.1.tgz", + "integrity": "sha1-gB/uAw4LlFDWOFrcSKTMVbRK7fw=", + "dev": true + }, + "randomatic": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/randomatic/-/randomatic-3.1.0.tgz", + "integrity": "sha512-KnGPVE0lo2WoXxIZ7cPR8YBpiol4gsSuOwDSg410oHh80ZMp5EiypNqL2K4Z77vJn6lB5rap7IkAmcUlalcnBQ==", + "dev": true, + "requires": { + "is-number": "^4.0.0", + "kind-of": "^6.0.0", + "math-random": "^1.0.1" + }, + "dependencies": { + "is-number": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-4.0.0.tgz", + "integrity": "sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ==", + "dev": true + }, + "kind-of": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", + "dev": true + } + } + }, + "readable-stream": { + "version": "2.0.6", + "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-2.0.6.tgz", + "integrity": "sha1-j5A0HmilPMySh4jaz80Rs265t44=", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", + "isarray": "~1.0.0", + "process-nextick-args": "~1.0.6", + "string_decoder": "~0.10.x", + "util-deprecate": "~1.0.1" + } + }, + "regex-cache": { + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/regex-cache/-/regex-cache-0.4.4.tgz", + "integrity": "sha512-nVIZwtCjkC9YgvWkpM55B5rBhBYRZhAaJbgcFYXXsHnbZ9UZI9nnVWYZpBlCqv9ho2eZryPnWrZGsOdPwVWXWQ==", + "dev": true, + "requires": { + "is-equal-shallow": "^0.1.3" + } + }, + "remove-trailing-separator": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", + "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=", + "dev": true + }, + "repeat-element": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.3.tgz", + "integrity": "sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g==", + "dev": true + }, + "repeat-string": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", + "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", + "dev": true + }, + "repeating": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/repeating/-/repeating-1.1.3.tgz", + "integrity": "sha1-PUEUIYh3U3SU+X93+Xhfq4EPpKw=", + "dev": true, + "requires": { + "is-finite": "^1.0.0" + } + }, + "request": { + "version": "2.67.0", + "resolved": "http://registry.npmjs.org/request/-/request-2.67.0.tgz", + "integrity": "sha1-ivdHgOK/EeoK6aqWXBHxGv0nJ0I=", + "dev": true, + "requires": { + "aws-sign2": "~0.6.0", + "bl": "~1.0.0", + "caseless": "~0.11.0", + "combined-stream": "~1.0.5", + "extend": "~3.0.0", + "forever-agent": "~0.6.1", + "form-data": "~1.0.0-rc3", + "har-validator": "~2.0.2", + "hawk": "~3.1.0", + "http-signature": "~1.1.0", + "is-typedarray": "~1.0.0", + "isstream": "~0.1.2", + "json-stringify-safe": "~5.0.1", + "mime-types": "~2.1.7", + "node-uuid": "~1.4.7", + "oauth-sign": "~0.8.0", + "qs": "~5.2.0", + "stringstream": "~0.0.4", + "tough-cookie": "~2.2.0", + "tunnel-agent": "~0.4.1" + } + }, + "request-progress": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/request-progress/-/request-progress-2.0.1.tgz", + "integrity": "sha1-XTa7V5YcZzqlt4jbyBQf3yO0Tgg=", + "dev": true, + "optional": true, + "requires": { + "throttleit": "^1.0.0" + } + }, + "resolve": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.1.7.tgz", + "integrity": "sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs=", + "dev": true + }, + "right-align": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/right-align/-/right-align-0.1.3.tgz", + "integrity": "sha1-YTObci/mo1FWiSENJOFMlhSGE+8=", + "dev": true, + "requires": { + "align-text": "^0.1.1" + } + }, + "rollup": { + "version": "0.41.6", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-0.41.6.tgz", + "integrity": "sha1-4NBUl4d6OYwQTYFtJzOnGKepTio=", + "dev": true, + "requires": { + "source-map-support": "^0.4.0" + } + }, + "rollup-plugin-commonjs": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/rollup-plugin-commonjs/-/rollup-plugin-commonjs-8.0.2.tgz", + "integrity": "sha1-mLFYm/4ypsD2d5C2DAtJmXKv7Yk=", + "dev": true, + "requires": { + "acorn": "^4.0.1", + "estree-walker": "^0.3.0", + "magic-string": "^0.19.0", + "resolve": "^1.1.7", + "rollup-pluginutils": "^2.0.1" + } + }, + "rollup-pluginutils": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/rollup-pluginutils/-/rollup-pluginutils-2.3.1.tgz", + "integrity": "sha512-JZS8aJMHEHhqmY2QVPMXwKP6lsD1ShkrcGYjhAIvqKKdXQyPHw/9NF0tl3On/xOJ4ACkxfeG7AF+chfCN1NpBg==", + "dev": true, + "requires": { + "estree-walker": "^0.5.2", + "micromatch": "^2.3.11" + }, + "dependencies": { + "estree-walker": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-0.5.2.tgz", + "integrity": "sha512-XpCnW/AE10ws/kDAs37cngSkvgIR8aN3G0MS85m7dUpuK2EREo9VJ00uvw6Dg/hXEpfsE1I1TvJOJr+Z+TL+ig==", + "dev": true + } + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "dev": true + }, + "shelljs": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.3.0.tgz", + "integrity": "sha1-NZbmMHp4FUT1kfN9phg2DzHbV7E=", + "dev": true + }, + "sigmund": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/sigmund/-/sigmund-1.0.1.tgz", + "integrity": "sha1-P/IfGYytIXX587eBhT/ZTQ0ZtZA=", + "dev": true + }, + "sntp": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/sntp/-/sntp-1.0.9.tgz", + "integrity": "sha1-ZUEYTMkK7qbG57NeJlkIJEPGYZg=", + "dev": true, + "requires": { + "hoek": "2.x.x" + } + }, + "source-map": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.2.0.tgz", + "integrity": "sha1-2rc/vPwrqBm03gO9b26qSBZLP50=", + "dev": true, + "optional": true, + "requires": { + "amdefine": ">=0.0.4" + } + }, + "source-map-support": { + "version": "0.4.18", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.4.18.tgz", + "integrity": "sha512-try0/JqxPLF9nOjvSta7tVondkP5dwgyLDjVoyMDlmjugT2lRZ1OfsrYTkCd2hkDnJTKRbO/Rl3orm8vlsUzbA==", + "dev": true, + "requires": { + "source-map": "^0.5.6" + }, + "dependencies": { + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true + } + } + }, + "split": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/split/-/split-1.0.1.tgz", + "integrity": "sha512-mTyOoPbrivtXnwnIxZRFYRrPNtEFKlpB2fvjSnCQUiAA6qAZzqwna5envK4uk6OIeP17CsdF3rSBGYVBsU0Tkg==", + "dev": true, + "optional": true, + "requires": { + "through": "2" + } + }, + "sshpk": { + "version": "1.14.2", + "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.14.2.tgz", + "integrity": "sha1-xvxhZIo9nE52T9P8306hBeSSupg=", + "dev": true, + "requires": { + "asn1": "~0.2.3", + "assert-plus": "^1.0.0", + "bcrypt-pbkdf": "^1.0.0", + "dashdash": "^1.12.0", + "ecc-jsbn": "~0.1.1", + "getpass": "^0.1.1", + "jsbn": "~0.1.0", + "safer-buffer": "^2.0.2", + "tweetnacl": "~0.14.0" + }, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", + "dev": true + } + } + }, + "stack-trace": { + "version": "0.0.10", + "resolved": "https://registry.npmjs.org/stack-trace/-/stack-trace-0.0.10.tgz", + "integrity": "sha1-VHxws0fo0ytOEI6hoqFZ5f3eGcA=", + "dev": true, + "optional": true + }, + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", + "dev": true + }, + "stringstream": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.6.tgz", + "integrity": "sha512-87GEBAkegbBcweToUrdzf3eLhWNg06FJTebl4BVJz/JgWy8CvEr9dRtX5qWphiynMSQlxxi+QqN0z5T32SLlhA==", + "dev": true + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "strip-json-comments": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-1.0.4.tgz", + "integrity": "sha1-HhX7ysl9Pumb8tc7TGVrCCu6+5E=", + "dev": true + }, + "supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", + "dev": true + }, + "throttleit": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/throttleit/-/throttleit-1.0.0.tgz", + "integrity": "sha1-nnhYNtr0Z0MUWlmEtiaNgoUorGw=", + "dev": true, + "optional": true + }, + "through": { + "version": "2.3.8", + "resolved": "http://registry.npmjs.org/through/-/through-2.3.8.tgz", + "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", + "dev": true, + "optional": true + }, + "tough-cookie": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.2.2.tgz", + "integrity": "sha1-yDoYMPTl7wuT7yo0iOck+N4Basc=", + "dev": true + }, + "tunnel-agent": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.4.3.tgz", + "integrity": "sha1-Y3PbdpCf5XDgjXNYM2Xtgop07us=", + "dev": true + }, + "tweetnacl": { + "version": "0.14.5", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", + "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", + "dev": true, + "optional": true + }, + "type-check": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", + "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", + "dev": true, + "requires": { + "prelude-ls": "~1.1.2" + } + }, + "typedarray": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", + "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", + "dev": true, + "optional": true + }, + "uglify-js": { + "version": "2.8.21", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-2.8.21.tgz", + "integrity": "sha1-FzP2aa5vgvyQx7JewPXHg+43UxQ=", + "dev": true, + "requires": { + "source-map": "~0.5.1", + "uglify-to-browserify": "~1.0.0", + "yargs": "~3.10.0" + }, + "dependencies": { + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true + } + } + }, + "uglify-to-browserify": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz", + "integrity": "sha1-bgkk1r2mta/jSeOabWMoUKD4grc=", + "dev": true, + "optional": true + }, + "underscore": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.7.0.tgz", + "integrity": "sha1-a7rwh3UA02vjTsqlhODbn+8DUgk=", + "dev": true + }, + "underscore.string": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/underscore.string/-/underscore.string-2.4.0.tgz", + "integrity": "sha1-jN2PusTi0uoefi6Al8QvRCKA+Fs=", + "dev": true + }, + "unexpected": { + "version": "10.11.1", + "resolved": "http://registry.npmjs.org/unexpected/-/unexpected-10.11.1.tgz", + "integrity": "sha1-aGVygI2r8QGq2E7OK5tWdvoEIYc=", + "dev": true, + "requires": { + "array-changes": "1.3.0", + "array-changes-async": "2.1.0", + "detect-indent": "3.0.1", + "diff": "1.1.0", + "leven": "2.0.0", + "magicpen": "5.9.0", + "proxyquire": "1.7.4", + "unexpected-bluebird": "2.9.34" + }, + "dependencies": { + "diff": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-1.1.0.tgz", + "integrity": "sha1-eYpJOBqkZBUem08Ob/Kwmooa0j8=", + "dev": true + } + } + }, + "unexpected-bluebird": { + "version": "2.9.34", + "resolved": "https://registry.npmjs.org/unexpected-bluebird/-/unexpected-bluebird-2.9.34.tgz", + "integrity": "sha1-Fqno6c7QZnd3i+k5MWqRotOCL+Y=", + "dev": true + }, + "unicode-5.2.0": { + "version": "0.7.5", + "resolved": "https://registry.npmjs.org/unicode-5.2.0/-/unicode-5.2.0-0.7.5.tgz", + "integrity": "sha512-KVGLW1Bri30x00yv4HNM8kBxoqFXr0Sbo55735nvrlsx4PYBZol3UtoWgO492fSwmsetzPEZzy73rbU8OGXJcA==", + "dev": true + }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", + "dev": true + }, + "verror": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", + "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", + "dev": true, + "requires": { + "assert-plus": "^1.0.0", + "core-util-is": "1.0.2", + "extsprintf": "^1.2.0" + }, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", + "dev": true + } + } + }, + "vlq": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/vlq/-/vlq-0.2.3.tgz", + "integrity": "sha512-DRibZL6DsNhIgYQ+wNdWDL2SL3bKPlVrRiBqV5yuMm++op8W4kGFtaQfCs4KEJn0wBZcHVHJ3eoywX8983k1ow==", + "dev": true + }, + "which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + }, + "window-size": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.1.0.tgz", + "integrity": "sha1-VDjNLqk7IC76Ohn+iIeu58lPnJ0=", + "dev": true + }, + "winston": { + "version": "2.4.4", + "resolved": "https://registry.npmjs.org/winston/-/winston-2.4.4.tgz", + "integrity": "sha512-NBo2Pepn4hK4V01UfcWcDlmiVTs7VTB1h7bgnB0rgP146bYhMxX0ypCz3lBOfNxCO4Zuek7yeT+y/zM1OfMw4Q==", + "dev": true, + "optional": true, + "requires": { + "async": "~1.0.0", + "colors": "1.0.x", + "cycle": "1.0.x", + "eyes": "0.1.x", + "isstream": "0.1.x", + "stack-trace": "0.0.x" + }, + "dependencies": { + "async": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/async/-/async-1.0.0.tgz", + "integrity": "sha1-+PwEyjoTeErenhZBr5hXjPvWR6k=", + "dev": true, + "optional": true + } + } + }, + "wordwrap": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", + "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=", + "dev": true + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true + }, + "xtend": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", + "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=", + "dev": true + }, + "yargs": { + "version": "3.10.0", + "resolved": "http://registry.npmjs.org/yargs/-/yargs-3.10.0.tgz", + "integrity": "sha1-9+572FfdfB0tOMDnTvvWgdFDH9E=", + "dev": true, + "requires": { + "camelcase": "^1.0.2", + "cliui": "^2.1.0", + "decamelize": "^1.0.0", + "window-size": "0.1.0" + } + }, + "yauzl": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.4.1.tgz", + "integrity": "sha1-lSj0QtqxsihOWLQ3m7GU4i4MQAU=", + "dev": true, + "optional": true, + "requires": { + "fd-slicer": "~1.0.1" + } + } + } +} diff --git a/package.json b/package.json index 7303449..5378f6c 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "onecolor", "description": "Javascript color object with implicit color space conversions. Supports RGB, HSV, HSL and CMYK with alpha channel.", "repository": "git@github.com:One-com/one-color.git", - "version": "3.0.5", + "version": "3.1.0", "license": "BSD-2-Clause", "keywords": [ "color", From 4e0d8f8d20826c11956cd283bc941044184a3c10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20M=C3=BCller?= Date: Fri, 14 Sep 2018 14:15:58 +0200 Subject: [PATCH 10/26] Make npm build script possible to run on windows. refs https://github.com/One-com/one-color/pull/42#issuecomment-421338195 --- package.json | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 5378f6c..740678f 100644 --- a/package.json +++ b/package.json @@ -29,6 +29,7 @@ "jshint": "^2.9.1", "mocha": "2.4.5", "mocha-lcov-reporter": "1.2.0", + "rimraf": "2.6.2", "rollup": "0.41.6", "rollup-plugin-commonjs": "8.0.2", "uglify-js": "2.8.21", @@ -47,8 +48,12 @@ "lib" ], "scripts": { - "one-color-all": "rollup -c rollup.config.js index.js && uglifyjs --compress --mangle --in-source-map OUT.js.map --source-map one-color-all.map OUT.js > one-color-all.js; rm OUT.*", - "one-color": "rollup -c rollup.config.js minimal.js && uglifyjs --compress --mangle --in-source-map OUT.js.map --source-map one-color.map OUT.js > one-color.js; rm OUT.*", + "preone-color-all": "rollup -c rollup.config.js index.js", + "one-color-all": "uglifyjs --compress --mangle --in-source-map OUT.js.map --source-map one-color-all.map OUT.js > one-color-all.js", + "postone-color-all": "rimraf OUT.*", + "preone-color": "rollup -c rollup.config.js minimal.js ", + "one-color": "uglifyjs --compress --mangle --in-source-map OUT.js.map --source-map one-color.map OUT.js > one-color.js", + "postone-color": "rimraf OUT.*", "build": "npm run one-color && npm run one-color-all", "preversion": "npm run lint && npm run build && TEST_BUNDLES=true npm test && bash -c 'git add one-color{-all,}.{js,map}'", "lint": "jshint .", From 3b1de662d908086d188765e1334a8e8b3ddd8f0c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 16 Jul 2020 10:02:21 +0000 Subject: [PATCH 11/26] Bump lodash from 4.17.11 to 4.17.19 Bumps [lodash](https://github.com/lodash/lodash) from 4.17.11 to 4.17.19. - [Release notes](https://github.com/lodash/lodash/releases) - [Commits](https://github.com/lodash/lodash/compare/4.17.11...4.17.19) Signed-off-by: dependabot[bot] --- package-lock.json | 51 +++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 43 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index 048ce35..241482b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1271,7 +1271,7 @@ "dependencies": { "commander": { "version": "0.6.1", - "resolved": "http://registry.npmjs.org/commander/-/commander-0.6.1.tgz", + "resolved": "https://registry.npmjs.org/commander/-/commander-0.6.1.tgz", "integrity": "sha1-+mihT2qUXVTbvlDYzbMyDp47GgY=", "dev": true }, @@ -1440,9 +1440,9 @@ } }, "lodash": { - "version": "4.17.11", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", - "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", + "version": "4.17.19", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.19.tgz", + "integrity": "sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ==", "dev": true }, "log-driver": { @@ -1596,13 +1596,13 @@ "dependencies": { "commander": { "version": "2.3.0", - "resolved": "http://registry.npmjs.org/commander/-/commander-2.3.0.tgz", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.3.0.tgz", "integrity": "sha1-/UMOiJgy7DU7ms0d4hfBHLPu+HM=", "dev": true }, "debug": { "version": "2.2.0", - "resolved": "http://registry.npmjs.org/debug/-/debug-2.2.0.tgz", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.2.0.tgz", "integrity": "sha1-+HBX6ZWxofauaklgZkE3vFbwOdo=", "dev": true, "requires": { @@ -2114,7 +2114,7 @@ }, "request": { "version": "2.67.0", - "resolved": "http://registry.npmjs.org/request/-/request-2.67.0.tgz", + "resolved": "https://registry.npmjs.org/request/-/request-2.67.0.tgz", "integrity": "sha1-ivdHgOK/EeoK6aqWXBHxGv0nJ0I=", "dev": true, "requires": { @@ -2165,6 +2165,40 @@ "align-text": "^0.1.1" } }, + "rimraf": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz", + "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==", + "dev": true, + "requires": { + "glob": "^7.0.5" + }, + "dependencies": { + "glob": { + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + } + } + }, "rollup": { "version": "0.41.6", "resolved": "https://registry.npmjs.org/rollup/-/rollup-0.41.6.tgz", @@ -2209,7 +2243,8 @@ "version": "5.1.2", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true + "dev": true, + "optional": true }, "safer-buffer": { "version": "2.1.2", From 183eaac2f0fdcdbf3d2d249cac432bc2cf94aa82 Mon Sep 17 00:00:00 2001 From: Andreas Lind Date: Thu, 16 Jul 2020 12:07:20 +0200 Subject: [PATCH 12/26] Drop package-lock.json, disable save-exact in .npmrc --- .npmrc | 2 +- package-lock.json | 2612 --------------------------------------------- 2 files changed, 1 insertion(+), 2613 deletions(-) delete mode 100644 package-lock.json diff --git a/.npmrc b/.npmrc index cffe8cd..c1ca392 100644 --- a/.npmrc +++ b/.npmrc @@ -1 +1 @@ -save-exact=true +package-lock = false diff --git a/package-lock.json b/package-lock.json deleted file mode 100644 index 241482b..0000000 --- a/package-lock.json +++ /dev/null @@ -1,2612 +0,0 @@ -{ - "name": "onecolor", - "version": "3.1.0", - "lockfileVersion": 1, - "requires": true, - "dependencies": { - "abbrev": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.0.9.tgz", - "integrity": "sha1-kbR5JYinc4wl813W9jdSovh3YTU=", - "dev": true - }, - "acorn": { - "version": "4.0.13", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-4.0.13.tgz", - "integrity": "sha1-EFSVrlNh1pe9GVyCUZLhrX8lN4c=", - "dev": true - }, - "ajv": { - "version": "5.5.2", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz", - "integrity": "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=", - "dev": true, - "optional": true, - "requires": { - "co": "^4.6.0", - "fast-deep-equal": "^1.0.0", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.3.0" - } - }, - "align-text": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/align-text/-/align-text-0.1.4.tgz", - "integrity": "sha1-DNkKVhCT810KmSVsIrcGlDP60Rc=", - "dev": true, - "requires": { - "kind-of": "^3.0.2", - "longest": "^1.0.1", - "repeat-string": "^1.5.2" - } - }, - "amdefine": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz", - "integrity": "sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU=", - "dev": true, - "optional": true - }, - "ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", - "dev": true - }, - "ansi-styles": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", - "dev": true - }, - "argparse": { - "version": "0.1.16", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-0.1.16.tgz", - "integrity": "sha1-z9AeD7uj1srtBJ+9dY1A9lGW9Xw=", - "dev": true, - "requires": { - "underscore": "~1.7.0", - "underscore.string": "~2.4.0" - } - }, - "arr-diff": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-2.0.0.tgz", - "integrity": "sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8=", - "dev": true, - "requires": { - "arr-flatten": "^1.0.1" - } - }, - "arr-flatten": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", - "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==", - "dev": true - }, - "array-changes": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/array-changes/-/array-changes-1.3.0.tgz", - "integrity": "sha1-RKba4Hb/wM9RrNnWwLS00/Ozbk8=", - "dev": true, - "requires": { - "arraydiff-papandreou": "0.1.1-patch1" - } - }, - "array-changes-async": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/array-changes-async/-/array-changes-async-2.1.0.tgz", - "integrity": "sha1-LYZZT26tQrao5taw3YVF0AtDREY=", - "dev": true, - "requires": { - "arraydiff-async": "0.2.0" - } - }, - "array-unique": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.2.1.tgz", - "integrity": "sha1-odl8yvy8JiXMcPrc6zalDFiwGlM=", - "dev": true - }, - "arraydiff-async": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/arraydiff-async/-/arraydiff-async-0.2.0.tgz", - "integrity": "sha1-uwUouY6BS3AvAfSWvHO+w+V/QIY=", - "dev": true - }, - "arraydiff-papandreou": { - "version": "0.1.1-patch1", - "resolved": "https://registry.npmjs.org/arraydiff-papandreou/-/arraydiff-papandreou-0.1.1-patch1.tgz", - "integrity": "sha1-ApAnC/27Sy762LdIJjitWnIQkhA=", - "dev": true - }, - "asn1": { - "version": "0.2.4", - "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", - "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", - "dev": true, - "requires": { - "safer-buffer": "~2.1.0" - } - }, - "assert-plus": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-0.2.0.tgz", - "integrity": "sha1-104bh+ev/A24qttwIfP+SBAasjQ=", - "dev": true - }, - "async": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/async/-/async-2.6.1.tgz", - "integrity": "sha512-fNEiL2+AZt6AlAw/29Cr0UDe4sRAHCpEHh54WMz+Bb7QfNcFw4h3loofyJpLeQs4Yx7yuqu/2dLgM5hKOs6HlQ==", - "dev": true, - "requires": { - "lodash": "^4.17.10" - } - }, - "asynckit": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", - "dev": true, - "optional": true - }, - "aws-sign2": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.6.0.tgz", - "integrity": "sha1-FDQt0428yU0OW4fXY81jYSwOeU8=", - "dev": true - }, - "aws4": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.8.0.tgz", - "integrity": "sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==", - "dev": true, - "optional": true - }, - "balanced-match": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", - "dev": true - }, - "bcrypt-pbkdf": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", - "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", - "dev": true, - "optional": true, - "requires": { - "tweetnacl": "^0.14.3" - } - }, - "bl": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/bl/-/bl-1.0.3.tgz", - "integrity": "sha1-/FQhoo/UImA2w7OJGmaiW8ZNIm4=", - "dev": true, - "requires": { - "readable-stream": "~2.0.5" - } - }, - "boom": { - "version": "2.10.1", - "resolved": "https://registry.npmjs.org/boom/-/boom-2.10.1.tgz", - "integrity": "sha1-OciRjO/1eZ+D+UkqhI9iWt0Mdm8=", - "dev": true, - "requires": { - "hoek": "2.x.x" - } - }, - "brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "braces": { - "version": "1.8.5", - "resolved": "https://registry.npmjs.org/braces/-/braces-1.8.5.tgz", - "integrity": "sha1-uneWLhLf+WnWt2cR6RS3N4V79qc=", - "dev": true, - "requires": { - "expand-range": "^1.8.1", - "preserve": "^0.2.0", - "repeat-element": "^1.1.2" - } - }, - "buffer-from": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", - "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", - "dev": true, - "optional": true - }, - "camelcase": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-1.2.1.tgz", - "integrity": "sha1-m7UwTS4LVmmLLHWLCKPqqdqlijk=", - "dev": true - }, - "caseless": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.11.0.tgz", - "integrity": "sha1-cVuW6phBWTzDMGeSP17GDr2k99c=", - "dev": true - }, - "center-align": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/center-align/-/center-align-0.1.3.tgz", - "integrity": "sha1-qg0yYptu6XIgBBHL1EYckHvCt60=", - "dev": true, - "requires": { - "align-text": "^0.1.3", - "lazy-cache": "^1.0.3" - } - }, - "chalk": { - "version": "1.1.3", - "resolved": "http://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", - "dev": true, - "requires": { - "ansi-styles": "^2.2.1", - "escape-string-regexp": "^1.0.2", - "has-ansi": "^2.0.0", - "strip-ansi": "^3.0.0", - "supports-color": "^2.0.0" - } - }, - "cli": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/cli/-/cli-1.0.1.tgz", - "integrity": "sha1-IoF1NPJL+klQw01TLUjsvGIbjBQ=", - "dev": true, - "requires": { - "exit": "0.1.2", - "glob": "^7.1.1" - }, - "dependencies": { - "glob": { - "version": "7.1.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", - "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", - "dev": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", - "dev": true, - "requires": { - "brace-expansion": "^1.1.7" - } - } - } - }, - "cliui": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-2.1.0.tgz", - "integrity": "sha1-S0dXYP+AJkx2LDoXGQMukcf+oNE=", - "dev": true, - "requires": { - "center-align": "^0.1.1", - "right-align": "^0.1.1", - "wordwrap": "0.0.2" - }, - "dependencies": { - "wordwrap": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz", - "integrity": "sha1-t5Zpu0LstAn4PVg8rVLKF+qhZD8=", - "dev": true - } - } - }, - "co": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", - "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=", - "dev": true, - "optional": true - }, - "color-diff": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/color-diff/-/color-diff-0.1.7.tgz", - "integrity": "sha1-bbeM2UgqjkWdQIIer0tQMoPcuOI=", - "dev": true - }, - "colors": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/colors/-/colors-1.0.3.tgz", - "integrity": "sha1-BDP0TYCWgP3rYO0mDxsMJi6CpAs=", - "dev": true, - "optional": true - }, - "combined-stream": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.6.tgz", - "integrity": "sha1-cj599ugBrFYTETp+RFqbactjKBg=", - "dev": true, - "requires": { - "delayed-stream": "~1.0.0" - } - }, - "commander": { - "version": "2.18.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.18.0.tgz", - "integrity": "sha512-6CYPa+JP2ftfRU2qkDK+UTVeQYosOg/2GbcjIcKPHfinyOLPVGXu/ovN86RP49Re5ndJK1N0kuiidFFuepc4ZQ==", - "dev": true - }, - "concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", - "dev": true - }, - "concat-stream": { - "version": "1.6.2", - "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", - "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", - "dev": true, - "optional": true, - "requires": { - "buffer-from": "^1.0.0", - "inherits": "^2.0.3", - "readable-stream": "^2.2.2", - "typedarray": "^0.0.6" - }, - "dependencies": { - "process-nextick-args": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", - "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==", - "dev": true, - "optional": true - }, - "readable-stream": { - "version": "2.3.6", - "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", - "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", - "dev": true, - "optional": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "optional": true, - "requires": { - "safe-buffer": "~5.1.0" - } - } - } - }, - "console-browserify": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/console-browserify/-/console-browserify-1.1.0.tgz", - "integrity": "sha1-8CQcRXMKn8YyOyBtvzjtx0HQuxA=", - "dev": true, - "requires": { - "date-now": "^0.1.4" - } - }, - "core-util-is": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", - "dev": true - }, - "coveralls": { - "version": "2.11.9", - "resolved": "https://registry.npmjs.org/coveralls/-/coveralls-2.11.9.tgz", - "integrity": "sha1-+f8Boa2/IqEp41qNYjRaUqeBs5U=", - "dev": true, - "requires": { - "js-yaml": "3.0.1", - "lcov-parse": "0.0.6", - "log-driver": "1.2.4", - "minimist": "1.2.0", - "request": "2.67.0" - } - }, - "cryptiles": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-2.0.5.tgz", - "integrity": "sha1-O9/s3GCBR8HGcgL6KR59ylnqo7g=", - "dev": true, - "requires": { - "boom": "2.x.x" - } - }, - "cycle": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/cycle/-/cycle-1.0.3.tgz", - "integrity": "sha1-IegLK+hYD5i0aPN5QwZisEbDStI=", - "dev": true, - "optional": true - }, - "dashdash": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", - "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", - "dev": true, - "requires": { - "assert-plus": "^1.0.0" - }, - "dependencies": { - "assert-plus": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", - "dev": true - } - } - }, - "date-now": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/date-now/-/date-now-0.1.4.tgz", - "integrity": "sha1-6vQ5/U1ISK105cx9vvIAZyueNFs=", - "dev": true - }, - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "optional": true, - "requires": { - "ms": "2.0.0" - } - }, - "decamelize": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", - "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", - "dev": true - }, - "deep-is": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", - "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", - "dev": true - }, - "delayed-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", - "dev": true - }, - "detect-indent": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-3.0.1.tgz", - "integrity": "sha1-ncXl3bzu+DJXZLlFGwK8bVQIT3U=", - "dev": true, - "requires": { - "get-stdin": "^4.0.1", - "minimist": "^1.1.0", - "repeating": "^1.1.0" - } - }, - "diff": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-1.4.0.tgz", - "integrity": "sha1-fyjS657nsVqX79ic5j3P2qPMur8=", - "dev": true - }, - "dom-serializer": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.1.0.tgz", - "integrity": "sha1-BzxpdUbOB4DOI75KKOKT5AvDDII=", - "dev": true, - "requires": { - "domelementtype": "~1.1.1", - "entities": "~1.1.1" - }, - "dependencies": { - "domelementtype": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.1.3.tgz", - "integrity": "sha1-vSh3PiZCiBrsUVRJJCmcXNgiGFs=", - "dev": true - }, - "entities": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/entities/-/entities-1.1.1.tgz", - "integrity": "sha1-blwtClYhtdra7O+AuQ7ftc13cvA=", - "dev": true - } - } - }, - "domelementtype": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.3.0.tgz", - "integrity": "sha1-sXrtguirWeUt2cGbF1bg/BhyBMI=", - "dev": true - }, - "domhandler": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-2.3.0.tgz", - "integrity": "sha1-LeWaCCLVAn+r/28DLCsloqir5zg=", - "dev": true, - "requires": { - "domelementtype": "1" - } - }, - "domutils": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/domutils/-/domutils-1.5.1.tgz", - "integrity": "sha1-3NhIiib1Y9YQeeSMn3t+Mjc2gs8=", - "dev": true, - "requires": { - "dom-serializer": "0", - "domelementtype": "1" - } - }, - "ecc-jsbn": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", - "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", - "dev": true, - "optional": true, - "requires": { - "jsbn": "~0.1.0", - "safer-buffer": "^2.1.0" - } - }, - "entities": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/entities/-/entities-1.0.0.tgz", - "integrity": "sha1-sph6o4ITR/zeZCsk/fyeT7cSvyY=", - "dev": true - }, - "es6-promise": { - "version": "4.2.5", - "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.5.tgz", - "integrity": "sha512-n6wvpdE43VFtJq+lUDYDBFUwV8TZbuGXLV4D6wKafg13ldznKsyEvatubnmUe31zcvelSzOHF+XbaT+Bl9ObDg==", - "dev": true, - "optional": true - }, - "escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", - "dev": true - }, - "escodegen": { - "version": "1.7.1", - "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.7.1.tgz", - "integrity": "sha1-MOz89mypjcZ80v0WKr626vqM5vw=", - "dev": true, - "requires": { - "esprima": "^1.2.2", - "estraverse": "^1.9.1", - "esutils": "^2.0.2", - "optionator": "^0.5.0", - "source-map": "~0.2.0" - }, - "dependencies": { - "esprima": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-1.2.5.tgz", - "integrity": "sha1-CZNQL+r2aBODJXVvMPmlH+7sEek=", - "dev": true - } - } - }, - "esprima": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-1.0.4.tgz", - "integrity": "sha1-n1V+CPw7TSbs6d00+Pv0drYlha0=", - "dev": true - }, - "estraverse": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-1.9.3.tgz", - "integrity": "sha1-r2fy3JIlgkFZUJJgkaQAXSnJu0Q=", - "dev": true - }, - "estree-walker": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-0.3.1.tgz", - "integrity": "sha1-5rGlHPcpJSTnI3wxLl/mZgwc4ao=", - "dev": true - }, - "esutils": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", - "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", - "dev": true - }, - "exit": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz", - "integrity": "sha1-BjJjj42HfMghB9MKD/8aF8uhzQw=", - "dev": true - }, - "expand-brackets": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-0.1.5.tgz", - "integrity": "sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s=", - "dev": true, - "requires": { - "is-posix-bracket": "^0.1.0" - } - }, - "expand-range": { - "version": "1.8.2", - "resolved": "https://registry.npmjs.org/expand-range/-/expand-range-1.8.2.tgz", - "integrity": "sha1-opnv/TNf4nIeuujiV+x5ZE/IUzc=", - "dev": true, - "requires": { - "fill-range": "^2.1.0" - } - }, - "extend": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", - "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", - "dev": true - }, - "extglob": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/extglob/-/extglob-0.3.2.tgz", - "integrity": "sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE=", - "dev": true, - "requires": { - "is-extglob": "^1.0.0" - } - }, - "extract-zip": { - "version": "1.6.7", - "resolved": "https://registry.npmjs.org/extract-zip/-/extract-zip-1.6.7.tgz", - "integrity": "sha1-qEC0uK9kAyZMjbV/Txp0Mz74H+k=", - "dev": true, - "optional": true, - "requires": { - "concat-stream": "1.6.2", - "debug": "2.6.9", - "mkdirp": "0.5.1", - "yauzl": "2.4.1" - } - }, - "extsprintf": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", - "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=", - "dev": true - }, - "eyes": { - "version": "0.1.8", - "resolved": "https://registry.npmjs.org/eyes/-/eyes-0.1.8.tgz", - "integrity": "sha1-Ys8SAjTGg3hdkCNIqADvPgzCC8A=", - "dev": true, - "optional": true - }, - "fast-deep-equal": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz", - "integrity": "sha1-wFNHeBfIa1HaqFPIHgWbcz0CNhQ=", - "dev": true, - "optional": true - }, - "fast-json-stable-stringify": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", - "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=", - "dev": true, - "optional": true - }, - "fast-levenshtein": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-1.0.7.tgz", - "integrity": "sha1-AXjc3uAjuSkFGTrwlZ6KdjnP3Lk=", - "dev": true - }, - "fd-slicer": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.0.1.tgz", - "integrity": "sha1-i1vL2ewyfFBBv5qwI/1nUPEXfmU=", - "dev": true, - "optional": true, - "requires": { - "pend": "~1.2.0" - } - }, - "filename-regex": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/filename-regex/-/filename-regex-2.0.1.tgz", - "integrity": "sha1-wcS5vuPglyXdsQa3XB4wH+LxiyY=", - "dev": true - }, - "fileset": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/fileset/-/fileset-0.2.1.tgz", - "integrity": "sha1-WI74lzxmI7KnbfRlEFaWuWqsgGc=", - "dev": true, - "requires": { - "glob": "5.x", - "minimatch": "2.x" - } - }, - "fill-keys": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/fill-keys/-/fill-keys-1.0.2.tgz", - "integrity": "sha1-mo+jb06K1jTjv2tPPIiCVRRS6yA=", - "dev": true, - "requires": { - "is-object": "~1.0.1", - "merge-descriptors": "~1.0.0" - } - }, - "fill-range": { - "version": "2.2.4", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-2.2.4.tgz", - "integrity": "sha512-cnrcCbj01+j2gTG921VZPnHbjmdAf8oQV/iGeV2kZxGSyfYjjTyY79ErsK1WJWMpw6DaApEX72binqJE+/d+5Q==", - "dev": true, - "requires": { - "is-number": "^2.1.0", - "isobject": "^2.0.0", - "randomatic": "^3.0.0", - "repeat-element": "^1.1.2", - "repeat-string": "^1.5.2" - } - }, - "for-in": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", - "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", - "dev": true - }, - "for-own": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/for-own/-/for-own-0.1.5.tgz", - "integrity": "sha1-UmXGgaTylNq78XyVCbZ2OqhFEM4=", - "dev": true, - "requires": { - "for-in": "^1.0.1" - } - }, - "forever-agent": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", - "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=", - "dev": true - }, - "form-data": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-1.0.1.tgz", - "integrity": "sha1-rjFduaSQf6BlUCMEpm13M0de43w=", - "dev": true, - "requires": { - "async": "^2.0.1", - "combined-stream": "^1.0.5", - "mime-types": "^2.1.11" - } - }, - "fs-extra": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-1.0.0.tgz", - "integrity": "sha1-zTzl9+fLYUWIP8rjGR6Yd/hYeVA=", - "dev": true, - "optional": true, - "requires": { - "graceful-fs": "^4.1.2", - "jsonfile": "^2.1.0", - "klaw": "^1.0.0" - } - }, - "fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", - "dev": true - }, - "generate-function": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/generate-function/-/generate-function-2.3.1.tgz", - "integrity": "sha512-eeB5GfMNeevm/GRYq20ShmsaGcmI81kIX2K9XQx5miC8KdHaC6Jm0qQ8ZNeGOi7wYB8OsdxKs+Y2oVuTFuVwKQ==", - "dev": true, - "requires": { - "is-property": "^1.0.2" - } - }, - "generate-object-property": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/generate-object-property/-/generate-object-property-1.2.0.tgz", - "integrity": "sha1-nA4cQDCM6AT0eDYYuTf6iPmdUNA=", - "dev": true, - "requires": { - "is-property": "^1.0.0" - } - }, - "get-stdin": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-4.0.1.tgz", - "integrity": "sha1-uWjGsKBDhDJJAui/Gl3zJXmkUP4=", - "dev": true - }, - "getpass": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", - "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", - "dev": true, - "requires": { - "assert-plus": "^1.0.0" - }, - "dependencies": { - "assert-plus": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", - "dev": true - } - } - }, - "glob": { - "version": "5.0.15", - "resolved": "https://registry.npmjs.org/glob/-/glob-5.0.15.tgz", - "integrity": "sha1-G8k2ueAvSmA/zCIuz3Yz0wuLk7E=", - "dev": true, - "requires": { - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "2 || 3", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "glob-base": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/glob-base/-/glob-base-0.3.0.tgz", - "integrity": "sha1-27Fk9iIbHAscz4Kuoyi0l98Oo8Q=", - "dev": true, - "requires": { - "glob-parent": "^2.0.0", - "is-glob": "^2.0.0" - } - }, - "glob-parent": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz", - "integrity": "sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg=", - "dev": true, - "requires": { - "is-glob": "^2.0.0" - } - }, - "graceful-fs": { - "version": "4.1.11", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", - "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=", - "dev": true, - "optional": true - }, - "growl": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/growl/-/growl-1.8.1.tgz", - "integrity": "sha1-Sy3sjZB+k9szZiTc7AGDUC+MlCg=", - "dev": true - }, - "handlebars": { - "version": "4.0.12", - "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.0.12.tgz", - "integrity": "sha512-RhmTekP+FZL+XNhwS1Wf+bTTZpdLougwt5pcgA1tuz6Jcx0fpH/7z0qd71RKnZHBCxIRBHfBOnio4gViPemNzA==", - "dev": true, - "requires": { - "async": "^2.5.0", - "optimist": "^0.6.1", - "source-map": "^0.6.1", - "uglify-js": "^3.1.4" - }, - "dependencies": { - "commander": { - "version": "2.17.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.17.1.tgz", - "integrity": "sha512-wPMUt6FnH2yzG95SA6mzjQOEKUU3aLaDEmzs1ti+1E9h+CsrZghRlqEM/EJ4KscsQVG8uNN4uVreUeT8+drlgg==", - "dev": true, - "optional": true - }, - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - }, - "uglify-js": { - "version": "3.4.9", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.4.9.tgz", - "integrity": "sha512-8CJsbKOtEbnJsTyv6LE6m6ZKniqMiFWmm9sRbopbkGs3gMPPfd3Fh8iIA4Ykv5MgaTbqHr4BaoGLJLZNhsrW1Q==", - "dev": true, - "optional": true, - "requires": { - "commander": "~2.17.1", - "source-map": "~0.6.1" - } - } - } - }, - "har-schema": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", - "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=", - "dev": true, - "optional": true - }, - "har-validator": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-2.0.6.tgz", - "integrity": "sha1-zcvAgYgmWtEZtqWnyKtw7s+10n0=", - "dev": true, - "requires": { - "chalk": "^1.1.1", - "commander": "^2.9.0", - "is-my-json-valid": "^2.12.4", - "pinkie-promise": "^2.0.0" - } - }, - "has-ansi": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", - "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", - "dev": true, - "requires": { - "ansi-regex": "^2.0.0" - } - }, - "has-flag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz", - "integrity": "sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo=", - "dev": true - }, - "hasha": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/hasha/-/hasha-2.2.0.tgz", - "integrity": "sha1-eNfL/B5tZjA/55g3NlmEUXsvbuE=", - "dev": true, - "optional": true, - "requires": { - "is-stream": "^1.0.1", - "pinkie-promise": "^2.0.0" - } - }, - "hawk": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/hawk/-/hawk-3.1.3.tgz", - "integrity": "sha1-B4REvXwWQLD+VA0sm3PVlnjo4cQ=", - "dev": true, - "requires": { - "boom": "2.x.x", - "cryptiles": "2.x.x", - "hoek": "2.x.x", - "sntp": "1.x.x" - } - }, - "hoek": { - "version": "2.16.3", - "resolved": "https://registry.npmjs.org/hoek/-/hoek-2.16.3.tgz", - "integrity": "sha1-ILt0A9POo5jpHcRxCo/xuCdKJe0=", - "dev": true - }, - "htmlparser2": { - "version": "3.8.3", - "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-3.8.3.tgz", - "integrity": "sha1-mWwosZFRaovoZQGn15dX5ccMEGg=", - "dev": true, - "requires": { - "domelementtype": "1", - "domhandler": "2.3", - "domutils": "1.5", - "entities": "1.0", - "readable-stream": "1.1" - }, - "dependencies": { - "isarray": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", - "dev": true - }, - "readable-stream": { - "version": "1.1.14", - "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", - "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.1", - "isarray": "0.0.1", - "string_decoder": "~0.10.x" - } - } - } - }, - "http-signature": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.1.1.tgz", - "integrity": "sha1-33LiZwZs0Kxn+3at+OE0qPvPkb8=", - "dev": true, - "requires": { - "assert-plus": "^0.2.0", - "jsprim": "^1.2.2", - "sshpk": "^1.7.0" - } - }, - "inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "dev": true, - "requires": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "inherits": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", - "dev": true - }, - "is-buffer": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", - "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", - "dev": true - }, - "is-dotfile": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/is-dotfile/-/is-dotfile-1.0.3.tgz", - "integrity": "sha1-pqLzL/0t+wT1yiXs0Pa4PPeYoeE=", - "dev": true - }, - "is-equal-shallow": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz", - "integrity": "sha1-IjgJj8Ih3gvPpdnqxMRdY4qhxTQ=", - "dev": true, - "requires": { - "is-primitive": "^2.0.0" - } - }, - "is-extendable": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", - "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", - "dev": true - }, - "is-extglob": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", - "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=", - "dev": true - }, - "is-finite": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.0.2.tgz", - "integrity": "sha1-zGZ3aVYCvlUO8R6LSqYwU0K20Ko=", - "dev": true, - "requires": { - "number-is-nan": "^1.0.0" - } - }, - "is-glob": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", - "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", - "dev": true, - "requires": { - "is-extglob": "^1.0.0" - } - }, - "is-my-ip-valid": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-my-ip-valid/-/is-my-ip-valid-1.0.0.tgz", - "integrity": "sha512-gmh/eWXROncUzRnIa1Ubrt5b8ep/MGSnfAUI3aRp+sqTCs1tv1Isl8d8F6JmkN3dXKc3ehZMrtiPN9eL03NuaQ==", - "dev": true - }, - "is-my-json-valid": { - "version": "2.19.0", - "resolved": "https://registry.npmjs.org/is-my-json-valid/-/is-my-json-valid-2.19.0.tgz", - "integrity": "sha512-mG0f/unGX1HZ5ep4uhRaPOS8EkAY8/j6mDRMJrutq4CqhoJWYp7qAlonIPy3TV7p3ju4TK9fo/PbnoksWmsp5Q==", - "dev": true, - "requires": { - "generate-function": "^2.0.0", - "generate-object-property": "^1.1.0", - "is-my-ip-valid": "^1.0.0", - "jsonpointer": "^4.0.0", - "xtend": "^4.0.0" - } - }, - "is-number": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-2.1.0.tgz", - "integrity": "sha1-Afy7s5NGOlSPL0ZszhbezknbkI8=", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - } - }, - "is-object": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-object/-/is-object-1.0.1.tgz", - "integrity": "sha1-iVJojF7C/9awPsyF52ngKQMINHA=", - "dev": true - }, - "is-posix-bracket": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz", - "integrity": "sha1-MzTceXdDaOkvAW5vvAqI9c1ua8Q=", - "dev": true - }, - "is-primitive": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-primitive/-/is-primitive-2.0.0.tgz", - "integrity": "sha1-IHurkWOEmcB7Kt8kCkGochADRXU=", - "dev": true - }, - "is-property": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz", - "integrity": "sha1-V/4cTkhHTt1lsJkR8msc1Ald2oQ=", - "dev": true - }, - "is-stream": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", - "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", - "dev": true, - "optional": true - }, - "is-typedarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", - "dev": true - }, - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", - "dev": true - }, - "isobject": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", - "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", - "dev": true, - "requires": { - "isarray": "1.0.0" - } - }, - "isstream": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", - "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=", - "dev": true - }, - "istanbul": { - "version": "0.4.2", - "resolved": "https://registry.npmjs.org/istanbul/-/istanbul-0.4.2.tgz", - "integrity": "sha1-dl5yi5RVvt222qe5zsS5w8Pt5Ic=", - "dev": true, - "requires": { - "abbrev": "1.0.x", - "async": "1.x", - "escodegen": "1.7.x", - "esprima": "2.7.x", - "fileset": "0.2.x", - "handlebars": "^4.0.1", - "js-yaml": "3.x", - "mkdirp": "0.5.x", - "nopt": "3.x", - "once": "1.x", - "resolve": "1.1.x", - "supports-color": "^3.1.0", - "which": "^1.1.1", - "wordwrap": "^1.0.0" - }, - "dependencies": { - "async": { - "version": "1.5.2", - "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", - "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=", - "dev": true - }, - "esprima": { - "version": "2.7.3", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-2.7.3.tgz", - "integrity": "sha1-luO3DVd59q1JzQMmc9HDEnZ7pYE=", - "dev": true - }, - "supports-color": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.2.3.tgz", - "integrity": "sha1-ZawFBLOVQXHYpklGsq48u4pfVPY=", - "dev": true, - "requires": { - "has-flag": "^1.0.0" - } - } - } - }, - "jade": { - "version": "0.26.3", - "resolved": "https://registry.npmjs.org/jade/-/jade-0.26.3.tgz", - "integrity": "sha1-jxDXl32NefL2/4YqgbBRPMslaGw=", - "dev": true, - "requires": { - "commander": "0.6.1", - "mkdirp": "0.3.0" - }, - "dependencies": { - "commander": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-0.6.1.tgz", - "integrity": "sha1-+mihT2qUXVTbvlDYzbMyDp47GgY=", - "dev": true - }, - "mkdirp": { - "version": "0.3.0", - "resolved": "http://registry.npmjs.org/mkdirp/-/mkdirp-0.3.0.tgz", - "integrity": "sha1-G79asbqCevI1dRQ0kEJkVfSB/h4=", - "dev": true - } - } - }, - "js-yaml": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.0.1.tgz", - "integrity": "sha1-dkBf6lvOMPyPQF1Ixtyn8KMsav4=", - "dev": true, - "requires": { - "argparse": "~ 0.1.11", - "esprima": "~ 1.0.2" - } - }, - "jsbn": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", - "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", - "dev": true, - "optional": true - }, - "jshint": { - "version": "2.9.6", - "resolved": "https://registry.npmjs.org/jshint/-/jshint-2.9.6.tgz", - "integrity": "sha512-KO9SIAKTlJQOM4lE64GQUtGBRpTOuvbrRrSZw3AhUxMNG266nX9hK2cKA4SBhXOj0irJGyNyGSLT62HGOVDEOA==", - "dev": true, - "requires": { - "cli": "~1.0.0", - "console-browserify": "1.1.x", - "exit": "0.1.x", - "htmlparser2": "3.8.x", - "lodash": "~4.17.10", - "minimatch": "~3.0.2", - "phantom": "~4.0.1", - "phantomjs-prebuilt": "~2.1.7", - "shelljs": "0.3.x", - "strip-json-comments": "1.0.x", - "unicode-5.2.0": "^0.7.5" - }, - "dependencies": { - "minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", - "dev": true, - "requires": { - "brace-expansion": "^1.1.7" - } - } - } - }, - "json-schema": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", - "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=", - "dev": true - }, - "json-schema-traverse": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz", - "integrity": "sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A=", - "dev": true, - "optional": true - }, - "json-stringify-safe": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", - "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", - "dev": true - }, - "jsonfile": { - "version": "2.4.0", - "resolved": "http://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz", - "integrity": "sha1-NzaitCi4e72gzIO1P6PWM6NcKug=", - "dev": true, - "optional": true, - "requires": { - "graceful-fs": "^4.1.6" - } - }, - "jsonpointer": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/jsonpointer/-/jsonpointer-4.0.1.tgz", - "integrity": "sha1-T9kss04OnbPInIYi7PUfm5eMbLk=", - "dev": true - }, - "jsprim": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", - "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", - "dev": true, - "requires": { - "assert-plus": "1.0.0", - "extsprintf": "1.3.0", - "json-schema": "0.2.3", - "verror": "1.10.0" - }, - "dependencies": { - "assert-plus": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", - "dev": true - } - } - }, - "kew": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/kew/-/kew-0.7.0.tgz", - "integrity": "sha1-edk9LTM2PW/dKXCzNdkUGtWR15s=", - "dev": true, - "optional": true - }, - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - }, - "klaw": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/klaw/-/klaw-1.3.1.tgz", - "integrity": "sha1-QIhDO0azsbolnXh4XY6W9zugJDk=", - "dev": true, - "optional": true, - "requires": { - "graceful-fs": "^4.1.9" - } - }, - "lazy-cache": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/lazy-cache/-/lazy-cache-1.0.4.tgz", - "integrity": "sha1-odePw6UEdMuAhF07O24dpJpEbo4=", - "dev": true - }, - "lcov-parse": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/lcov-parse/-/lcov-parse-0.0.6.tgz", - "integrity": "sha1-gZ5dqL8HkfnT857qXtGGgYfxEXU=", - "dev": true - }, - "leven": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/leven/-/leven-2.0.0.tgz", - "integrity": "sha1-dMRXREOVUNoYWAGRKCn2HSIHG8E=", - "dev": true - }, - "levn": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/levn/-/levn-0.2.5.tgz", - "integrity": "sha1-uo0znQykphDjo/FFucr0iAcVUFQ=", - "dev": true, - "requires": { - "prelude-ls": "~1.1.0", - "type-check": "~0.3.1" - } - }, - "lodash": { - "version": "4.17.19", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.19.tgz", - "integrity": "sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ==", - "dev": true - }, - "log-driver": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/log-driver/-/log-driver-1.2.4.tgz", - "integrity": "sha1-LWLX+u9F2KcTQZYaBLB2HsqZz6M=", - "dev": true - }, - "longest": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/longest/-/longest-1.0.1.tgz", - "integrity": "sha1-MKCy2jj3N3DoKUoNIuZiXtd9AJc=", - "dev": true - }, - "lru-cache": { - "version": "2.7.3", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-2.7.3.tgz", - "integrity": "sha1-bUUk6LlV+V1PW1iFHOId1y+06VI=", - "dev": true - }, - "magic-string": { - "version": "0.19.1", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.19.1.tgz", - "integrity": "sha1-FNdoATyvLsj96hakmvgvw3fnUgE=", - "dev": true, - "requires": { - "vlq": "^0.2.1" - } - }, - "magicpen": { - "version": "5.9.0", - "resolved": "https://registry.npmjs.org/magicpen/-/magicpen-5.9.0.tgz", - "integrity": "sha1-fSy/2IN6narU55+IOQoFOP2QHJQ=", - "dev": true, - "requires": { - "ansi-styles": "2.0.0", - "color-diff": "0.1.7", - "supports-color": "1.2.0" - }, - "dependencies": { - "ansi-styles": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.0.0.tgz", - "integrity": "sha1-QysmFi/qG2PIeIlqvIzFVI8lBj4=", - "dev": true - }, - "supports-color": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-1.2.0.tgz", - "integrity": "sha1-/x7R5hFp0Gs88tWI4YixjYhH4X4=", - "dev": true - } - } - }, - "math-random": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/math-random/-/math-random-1.0.1.tgz", - "integrity": "sha1-izqsWIuKZuSXXjzepn97sylgH6w=", - "dev": true - }, - "merge-descriptors": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", - "integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=", - "dev": true - }, - "micromatch": { - "version": "2.3.11", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-2.3.11.tgz", - "integrity": "sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU=", - "dev": true, - "requires": { - "arr-diff": "^2.0.0", - "array-unique": "^0.2.1", - "braces": "^1.8.2", - "expand-brackets": "^0.1.4", - "extglob": "^0.3.1", - "filename-regex": "^2.0.0", - "is-extglob": "^1.0.0", - "is-glob": "^2.0.1", - "kind-of": "^3.0.2", - "normalize-path": "^2.0.1", - "object.omit": "^2.0.0", - "parse-glob": "^3.0.4", - "regex-cache": "^0.4.2" - } - }, - "mime-db": { - "version": "1.36.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.36.0.tgz", - "integrity": "sha512-L+xvyD9MkoYMXb1jAmzI/lWYAxAMCPvIBSWur0PZ5nOf5euahRLVqH//FKW9mWp2lkqUgYiXPgkzfMUFi4zVDw==", - "dev": true - }, - "mime-types": { - "version": "2.1.20", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.20.tgz", - "integrity": "sha512-HrkrPaP9vGuWbLK1B1FfgAkbqNjIuy4eHlIYnFi7kamZyLLrGlo2mpcx0bBmNpKqBtYtAfGbodDddIgddSJC2A==", - "dev": true, - "requires": { - "mime-db": "~1.36.0" - } - }, - "minimatch": { - "version": "2.0.10", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-2.0.10.tgz", - "integrity": "sha1-jQh8OcazjAAbl/ynzm0OHoCvusc=", - "dev": true, - "requires": { - "brace-expansion": "^1.0.0" - } - }, - "minimist": { - "version": "1.2.0", - "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", - "dev": true - }, - "mkdirp": { - "version": "0.5.1", - "resolved": "http://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", - "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", - "dev": true, - "requires": { - "minimist": "0.0.8" - }, - "dependencies": { - "minimist": { - "version": "0.0.8", - "resolved": "http://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", - "dev": true - } - } - }, - "mocha": { - "version": "2.4.5", - "resolved": "http://registry.npmjs.org/mocha/-/mocha-2.4.5.tgz", - "integrity": "sha1-FRdo3Sh161G8gpXpgAAm6fK7OY8=", - "dev": true, - "requires": { - "commander": "2.3.0", - "debug": "2.2.0", - "diff": "1.4.0", - "escape-string-regexp": "1.0.2", - "glob": "3.2.3", - "growl": "1.8.1", - "jade": "0.26.3", - "mkdirp": "0.5.1", - "supports-color": "1.2.0" - }, - "dependencies": { - "commander": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.3.0.tgz", - "integrity": "sha1-/UMOiJgy7DU7ms0d4hfBHLPu+HM=", - "dev": true - }, - "debug": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.2.0.tgz", - "integrity": "sha1-+HBX6ZWxofauaklgZkE3vFbwOdo=", - "dev": true, - "requires": { - "ms": "0.7.1" - } - }, - "escape-string-regexp": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.2.tgz", - "integrity": "sha1-Tbwv5nTnGUnK8/smlc5/LcHZqNE=", - "dev": true - }, - "glob": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-3.2.3.tgz", - "integrity": "sha1-4xPusknHr/qlxHUoaw4RW1mDlGc=", - "dev": true, - "requires": { - "graceful-fs": "~2.0.0", - "inherits": "2", - "minimatch": "~0.2.11" - } - }, - "graceful-fs": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-2.0.3.tgz", - "integrity": "sha1-fNLNsiiko/Nule+mzBQt59GhNtA=", - "dev": true - }, - "minimatch": { - "version": "0.2.14", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-0.2.14.tgz", - "integrity": "sha1-x054BXT2PG+aCQ6Q775u9TpqdWo=", - "dev": true, - "requires": { - "lru-cache": "2", - "sigmund": "~1.0.0" - } - }, - "ms": { - "version": "0.7.1", - "resolved": "https://registry.npmjs.org/ms/-/ms-0.7.1.tgz", - "integrity": "sha1-nNE8A62/8ltl7/3nzoZO6VIBcJg=", - "dev": true - }, - "supports-color": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-1.2.0.tgz", - "integrity": "sha1-/x7R5hFp0Gs88tWI4YixjYhH4X4=", - "dev": true - } - } - }, - "mocha-lcov-reporter": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/mocha-lcov-reporter/-/mocha-lcov-reporter-1.2.0.tgz", - "integrity": "sha1-j3uhUSrhJxYR2SdmnZm2wumfBY8=", - "dev": true - }, - "module-not-found-error": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/module-not-found-error/-/module-not-found-error-1.0.1.tgz", - "integrity": "sha1-z4tP9PKWQGdNbN0CsOO8UjwrvcA=", - "dev": true - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true, - "optional": true - }, - "node-uuid": { - "version": "1.4.8", - "resolved": "https://registry.npmjs.org/node-uuid/-/node-uuid-1.4.8.tgz", - "integrity": "sha1-sEDrCSOWivq/jTL7HxfxFn/auQc=", - "dev": true - }, - "nopt": { - "version": "3.0.6", - "resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz", - "integrity": "sha1-xkZdvwirzU2zWTF/eaxopkayj/k=", - "dev": true, - "requires": { - "abbrev": "1" - } - }, - "normalize-path": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", - "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", - "dev": true, - "requires": { - "remove-trailing-separator": "^1.0.1" - } - }, - "number-is-nan": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", - "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", - "dev": true - }, - "oauth-sign": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.2.tgz", - "integrity": "sha1-Rqarfwrq2N6unsBWV4C31O/rnUM=", - "dev": true - }, - "object.omit": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/object.omit/-/object.omit-2.0.1.tgz", - "integrity": "sha1-Gpx0SCnznbuFjHbKNXmuKlTr0fo=", - "dev": true, - "requires": { - "for-own": "^0.1.4", - "is-extendable": "^0.1.1" - } - }, - "once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "dev": true, - "requires": { - "wrappy": "1" - } - }, - "optimist": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz", - "integrity": "sha1-2j6nRob6IaGaERwybpDrFaAZZoY=", - "dev": true, - "requires": { - "minimist": "~0.0.1", - "wordwrap": "~0.0.2" - }, - "dependencies": { - "minimist": { - "version": "0.0.10", - "resolved": "http://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz", - "integrity": "sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8=", - "dev": true - }, - "wordwrap": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz", - "integrity": "sha1-o9XabNXAvAAI03I0u68b7WMFkQc=", - "dev": true - } - } - }, - "optionator": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.5.0.tgz", - "integrity": "sha1-t1qJlaLUF98ltuTjhi9QqohlE2g=", - "dev": true, - "requires": { - "deep-is": "~0.1.2", - "fast-levenshtein": "~1.0.0", - "levn": "~0.2.5", - "prelude-ls": "~1.1.1", - "type-check": "~0.3.1", - "wordwrap": "~0.0.2" - }, - "dependencies": { - "wordwrap": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz", - "integrity": "sha1-o9XabNXAvAAI03I0u68b7WMFkQc=", - "dev": true - } - } - }, - "parse-glob": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/parse-glob/-/parse-glob-3.0.4.tgz", - "integrity": "sha1-ssN2z7EfNVE7rdFz7wu246OIORw=", - "dev": true, - "requires": { - "glob-base": "^0.3.0", - "is-dotfile": "^1.0.0", - "is-extglob": "^1.0.0", - "is-glob": "^2.0.0" - } - }, - "path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", - "dev": true - }, - "pend": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz", - "integrity": "sha1-elfrVQpng/kRUzH89GY9XI4AelA=", - "dev": true, - "optional": true - }, - "performance-now": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", - "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=", - "dev": true, - "optional": true - }, - "phantom": { - "version": "4.0.12", - "resolved": "https://registry.npmjs.org/phantom/-/phantom-4.0.12.tgz", - "integrity": "sha512-Tz82XhtPmwCk1FFPmecy7yRGZG2btpzY2KI9fcoPT7zT9det0CcMyfBFPp1S8DqzsnQnm8ZYEfdy528mwVtksA==", - "dev": true, - "optional": true, - "requires": { - "phantomjs-prebuilt": "^2.1.16", - "split": "^1.0.1", - "winston": "^2.4.0" - } - }, - "phantomjs-prebuilt": { - "version": "2.1.16", - "resolved": "https://registry.npmjs.org/phantomjs-prebuilt/-/phantomjs-prebuilt-2.1.16.tgz", - "integrity": "sha1-79ISpKOWbTZHaE6ouniFSb4q7+8=", - "dev": true, - "optional": true, - "requires": { - "es6-promise": "^4.0.3", - "extract-zip": "^1.6.5", - "fs-extra": "^1.0.0", - "hasha": "^2.2.0", - "kew": "^0.7.0", - "progress": "^1.1.8", - "request": "^2.81.0", - "request-progress": "^2.0.1", - "which": "^1.2.10" - }, - "dependencies": { - "assert-plus": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", - "dev": true, - "optional": true - }, - "aws-sign2": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", - "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=", - "dev": true, - "optional": true - }, - "caseless": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", - "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=", - "dev": true, - "optional": true - }, - "form-data": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.2.tgz", - "integrity": "sha1-SXBJi+YEwgwAXU9cI67NIda0kJk=", - "dev": true, - "optional": true, - "requires": { - "asynckit": "^0.4.0", - "combined-stream": "1.0.6", - "mime-types": "^2.1.12" - } - }, - "har-validator": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.0.tgz", - "integrity": "sha512-+qnmNjI4OfH2ipQ9VQOw23bBd/ibtfbVdK2fYbY4acTDqKTW/YDp9McimZdDbG8iV9fZizUqQMD5xvriB146TA==", - "dev": true, - "optional": true, - "requires": { - "ajv": "^5.3.0", - "har-schema": "^2.0.0" - } - }, - "http-signature": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", - "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", - "dev": true, - "optional": true, - "requires": { - "assert-plus": "^1.0.0", - "jsprim": "^1.2.2", - "sshpk": "^1.7.0" - } - }, - "oauth-sign": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", - "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==", - "dev": true, - "optional": true - }, - "qs": { - "version": "6.5.2", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", - "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==", - "dev": true, - "optional": true - }, - "request": { - "version": "2.88.0", - "resolved": "https://registry.npmjs.org/request/-/request-2.88.0.tgz", - "integrity": "sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg==", - "dev": true, - "optional": true, - "requires": { - "aws-sign2": "~0.7.0", - "aws4": "^1.8.0", - "caseless": "~0.12.0", - "combined-stream": "~1.0.6", - "extend": "~3.0.2", - "forever-agent": "~0.6.1", - "form-data": "~2.3.2", - "har-validator": "~5.1.0", - "http-signature": "~1.2.0", - "is-typedarray": "~1.0.0", - "isstream": "~0.1.2", - "json-stringify-safe": "~5.0.1", - "mime-types": "~2.1.19", - "oauth-sign": "~0.9.0", - "performance-now": "^2.1.0", - "qs": "~6.5.2", - "safe-buffer": "^5.1.2", - "tough-cookie": "~2.4.3", - "tunnel-agent": "^0.6.0", - "uuid": "^3.3.2" - } - }, - "tough-cookie": { - "version": "2.4.3", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz", - "integrity": "sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==", - "dev": true, - "optional": true, - "requires": { - "psl": "^1.1.24", - "punycode": "^1.4.1" - } - }, - "tunnel-agent": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", - "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", - "dev": true, - "optional": true, - "requires": { - "safe-buffer": "^5.0.1" - } - }, - "uuid": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", - "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==", - "dev": true, - "optional": true - } - } - }, - "pinkie": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", - "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=", - "dev": true - }, - "pinkie-promise": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", - "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", - "dev": true, - "requires": { - "pinkie": "^2.0.0" - } - }, - "prelude-ls": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", - "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", - "dev": true - }, - "preserve": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/preserve/-/preserve-0.2.0.tgz", - "integrity": "sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks=", - "dev": true - }, - "process-nextick-args": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz", - "integrity": "sha1-FQ4gt1ZZCtP5EJPyWk8q2L/zC6M=", - "dev": true - }, - "progress": { - "version": "1.1.8", - "resolved": "https://registry.npmjs.org/progress/-/progress-1.1.8.tgz", - "integrity": "sha1-4mDHj2Fhzdmw5WzD4Khd4Xx6V74=", - "dev": true, - "optional": true - }, - "proxyquire": { - "version": "1.7.4", - "resolved": "https://registry.npmjs.org/proxyquire/-/proxyquire-1.7.4.tgz", - "integrity": "sha1-ZUcZshUxw/H8mm5OJy2jGaBbLpg=", - "dev": true, - "requires": { - "fill-keys": "^1.0.2", - "module-not-found-error": "^1.0.0" - } - }, - "psl": { - "version": "1.1.29", - "resolved": "https://registry.npmjs.org/psl/-/psl-1.1.29.tgz", - "integrity": "sha512-AeUmQ0oLN02flVHXWh9sSJF7mcdFq0ppid/JkErufc3hGIV/AMa8Fo9VgDo/cT2jFdOWoFvHp90qqBH54W+gjQ==", - "dev": true, - "optional": true - }, - "punycode": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", - "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", - "dev": true, - "optional": true - }, - "qs": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/qs/-/qs-5.2.1.tgz", - "integrity": "sha1-gB/uAw4LlFDWOFrcSKTMVbRK7fw=", - "dev": true - }, - "randomatic": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/randomatic/-/randomatic-3.1.0.tgz", - "integrity": "sha512-KnGPVE0lo2WoXxIZ7cPR8YBpiol4gsSuOwDSg410oHh80ZMp5EiypNqL2K4Z77vJn6lB5rap7IkAmcUlalcnBQ==", - "dev": true, - "requires": { - "is-number": "^4.0.0", - "kind-of": "^6.0.0", - "math-random": "^1.0.1" - }, - "dependencies": { - "is-number": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-4.0.0.tgz", - "integrity": "sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ==", - "dev": true - }, - "kind-of": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", - "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", - "dev": true - } - } - }, - "readable-stream": { - "version": "2.0.6", - "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-2.0.6.tgz", - "integrity": "sha1-j5A0HmilPMySh4jaz80Rs265t44=", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.1", - "isarray": "~1.0.0", - "process-nextick-args": "~1.0.6", - "string_decoder": "~0.10.x", - "util-deprecate": "~1.0.1" - } - }, - "regex-cache": { - "version": "0.4.4", - "resolved": "https://registry.npmjs.org/regex-cache/-/regex-cache-0.4.4.tgz", - "integrity": "sha512-nVIZwtCjkC9YgvWkpM55B5rBhBYRZhAaJbgcFYXXsHnbZ9UZI9nnVWYZpBlCqv9ho2eZryPnWrZGsOdPwVWXWQ==", - "dev": true, - "requires": { - "is-equal-shallow": "^0.1.3" - } - }, - "remove-trailing-separator": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", - "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=", - "dev": true - }, - "repeat-element": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.3.tgz", - "integrity": "sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g==", - "dev": true - }, - "repeat-string": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", - "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", - "dev": true - }, - "repeating": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/repeating/-/repeating-1.1.3.tgz", - "integrity": "sha1-PUEUIYh3U3SU+X93+Xhfq4EPpKw=", - "dev": true, - "requires": { - "is-finite": "^1.0.0" - } - }, - "request": { - "version": "2.67.0", - "resolved": "https://registry.npmjs.org/request/-/request-2.67.0.tgz", - "integrity": "sha1-ivdHgOK/EeoK6aqWXBHxGv0nJ0I=", - "dev": true, - "requires": { - "aws-sign2": "~0.6.0", - "bl": "~1.0.0", - "caseless": "~0.11.0", - "combined-stream": "~1.0.5", - "extend": "~3.0.0", - "forever-agent": "~0.6.1", - "form-data": "~1.0.0-rc3", - "har-validator": "~2.0.2", - "hawk": "~3.1.0", - "http-signature": "~1.1.0", - "is-typedarray": "~1.0.0", - "isstream": "~0.1.2", - "json-stringify-safe": "~5.0.1", - "mime-types": "~2.1.7", - "node-uuid": "~1.4.7", - "oauth-sign": "~0.8.0", - "qs": "~5.2.0", - "stringstream": "~0.0.4", - "tough-cookie": "~2.2.0", - "tunnel-agent": "~0.4.1" - } - }, - "request-progress": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/request-progress/-/request-progress-2.0.1.tgz", - "integrity": "sha1-XTa7V5YcZzqlt4jbyBQf3yO0Tgg=", - "dev": true, - "optional": true, - "requires": { - "throttleit": "^1.0.0" - } - }, - "resolve": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.1.7.tgz", - "integrity": "sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs=", - "dev": true - }, - "right-align": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/right-align/-/right-align-0.1.3.tgz", - "integrity": "sha1-YTObci/mo1FWiSENJOFMlhSGE+8=", - "dev": true, - "requires": { - "align-text": "^0.1.1" - } - }, - "rimraf": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz", - "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==", - "dev": true, - "requires": { - "glob": "^7.0.5" - }, - "dependencies": { - "glob": { - "version": "7.1.6", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", - "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", - "dev": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", - "dev": true, - "requires": { - "brace-expansion": "^1.1.7" - } - } - } - }, - "rollup": { - "version": "0.41.6", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-0.41.6.tgz", - "integrity": "sha1-4NBUl4d6OYwQTYFtJzOnGKepTio=", - "dev": true, - "requires": { - "source-map-support": "^0.4.0" - } - }, - "rollup-plugin-commonjs": { - "version": "8.0.2", - "resolved": "https://registry.npmjs.org/rollup-plugin-commonjs/-/rollup-plugin-commonjs-8.0.2.tgz", - "integrity": "sha1-mLFYm/4ypsD2d5C2DAtJmXKv7Yk=", - "dev": true, - "requires": { - "acorn": "^4.0.1", - "estree-walker": "^0.3.0", - "magic-string": "^0.19.0", - "resolve": "^1.1.7", - "rollup-pluginutils": "^2.0.1" - } - }, - "rollup-pluginutils": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/rollup-pluginutils/-/rollup-pluginutils-2.3.1.tgz", - "integrity": "sha512-JZS8aJMHEHhqmY2QVPMXwKP6lsD1ShkrcGYjhAIvqKKdXQyPHw/9NF0tl3On/xOJ4ACkxfeG7AF+chfCN1NpBg==", - "dev": true, - "requires": { - "estree-walker": "^0.5.2", - "micromatch": "^2.3.11" - }, - "dependencies": { - "estree-walker": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-0.5.2.tgz", - "integrity": "sha512-XpCnW/AE10ws/kDAs37cngSkvgIR8aN3G0MS85m7dUpuK2EREo9VJ00uvw6Dg/hXEpfsE1I1TvJOJr+Z+TL+ig==", - "dev": true - } - } - }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true, - "optional": true - }, - "safer-buffer": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", - "dev": true - }, - "shelljs": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.3.0.tgz", - "integrity": "sha1-NZbmMHp4FUT1kfN9phg2DzHbV7E=", - "dev": true - }, - "sigmund": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/sigmund/-/sigmund-1.0.1.tgz", - "integrity": "sha1-P/IfGYytIXX587eBhT/ZTQ0ZtZA=", - "dev": true - }, - "sntp": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/sntp/-/sntp-1.0.9.tgz", - "integrity": "sha1-ZUEYTMkK7qbG57NeJlkIJEPGYZg=", - "dev": true, - "requires": { - "hoek": "2.x.x" - } - }, - "source-map": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.2.0.tgz", - "integrity": "sha1-2rc/vPwrqBm03gO9b26qSBZLP50=", - "dev": true, - "optional": true, - "requires": { - "amdefine": ">=0.0.4" - } - }, - "source-map-support": { - "version": "0.4.18", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.4.18.tgz", - "integrity": "sha512-try0/JqxPLF9nOjvSta7tVondkP5dwgyLDjVoyMDlmjugT2lRZ1OfsrYTkCd2hkDnJTKRbO/Rl3orm8vlsUzbA==", - "dev": true, - "requires": { - "source-map": "^0.5.6" - }, - "dependencies": { - "source-map": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", - "dev": true - } - } - }, - "split": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/split/-/split-1.0.1.tgz", - "integrity": "sha512-mTyOoPbrivtXnwnIxZRFYRrPNtEFKlpB2fvjSnCQUiAA6qAZzqwna5envK4uk6OIeP17CsdF3rSBGYVBsU0Tkg==", - "dev": true, - "optional": true, - "requires": { - "through": "2" - } - }, - "sshpk": { - "version": "1.14.2", - "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.14.2.tgz", - "integrity": "sha1-xvxhZIo9nE52T9P8306hBeSSupg=", - "dev": true, - "requires": { - "asn1": "~0.2.3", - "assert-plus": "^1.0.0", - "bcrypt-pbkdf": "^1.0.0", - "dashdash": "^1.12.0", - "ecc-jsbn": "~0.1.1", - "getpass": "^0.1.1", - "jsbn": "~0.1.0", - "safer-buffer": "^2.0.2", - "tweetnacl": "~0.14.0" - }, - "dependencies": { - "assert-plus": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", - "dev": true - } - } - }, - "stack-trace": { - "version": "0.0.10", - "resolved": "https://registry.npmjs.org/stack-trace/-/stack-trace-0.0.10.tgz", - "integrity": "sha1-VHxws0fo0ytOEI6hoqFZ5f3eGcA=", - "dev": true, - "optional": true - }, - "string_decoder": { - "version": "0.10.31", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", - "dev": true - }, - "stringstream": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.6.tgz", - "integrity": "sha512-87GEBAkegbBcweToUrdzf3eLhWNg06FJTebl4BVJz/JgWy8CvEr9dRtX5qWphiynMSQlxxi+QqN0z5T32SLlhA==", - "dev": true - }, - "strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", - "dev": true, - "requires": { - "ansi-regex": "^2.0.0" - } - }, - "strip-json-comments": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-1.0.4.tgz", - "integrity": "sha1-HhX7ysl9Pumb8tc7TGVrCCu6+5E=", - "dev": true - }, - "supports-color": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", - "dev": true - }, - "throttleit": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/throttleit/-/throttleit-1.0.0.tgz", - "integrity": "sha1-nnhYNtr0Z0MUWlmEtiaNgoUorGw=", - "dev": true, - "optional": true - }, - "through": { - "version": "2.3.8", - "resolved": "http://registry.npmjs.org/through/-/through-2.3.8.tgz", - "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", - "dev": true, - "optional": true - }, - "tough-cookie": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.2.2.tgz", - "integrity": "sha1-yDoYMPTl7wuT7yo0iOck+N4Basc=", - "dev": true - }, - "tunnel-agent": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.4.3.tgz", - "integrity": "sha1-Y3PbdpCf5XDgjXNYM2Xtgop07us=", - "dev": true - }, - "tweetnacl": { - "version": "0.14.5", - "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", - "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", - "dev": true, - "optional": true - }, - "type-check": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", - "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", - "dev": true, - "requires": { - "prelude-ls": "~1.1.2" - } - }, - "typedarray": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", - "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", - "dev": true, - "optional": true - }, - "uglify-js": { - "version": "2.8.21", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-2.8.21.tgz", - "integrity": "sha1-FzP2aa5vgvyQx7JewPXHg+43UxQ=", - "dev": true, - "requires": { - "source-map": "~0.5.1", - "uglify-to-browserify": "~1.0.0", - "yargs": "~3.10.0" - }, - "dependencies": { - "source-map": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", - "dev": true - } - } - }, - "uglify-to-browserify": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz", - "integrity": "sha1-bgkk1r2mta/jSeOabWMoUKD4grc=", - "dev": true, - "optional": true - }, - "underscore": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.7.0.tgz", - "integrity": "sha1-a7rwh3UA02vjTsqlhODbn+8DUgk=", - "dev": true - }, - "underscore.string": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/underscore.string/-/underscore.string-2.4.0.tgz", - "integrity": "sha1-jN2PusTi0uoefi6Al8QvRCKA+Fs=", - "dev": true - }, - "unexpected": { - "version": "10.11.1", - "resolved": "http://registry.npmjs.org/unexpected/-/unexpected-10.11.1.tgz", - "integrity": "sha1-aGVygI2r8QGq2E7OK5tWdvoEIYc=", - "dev": true, - "requires": { - "array-changes": "1.3.0", - "array-changes-async": "2.1.0", - "detect-indent": "3.0.1", - "diff": "1.1.0", - "leven": "2.0.0", - "magicpen": "5.9.0", - "proxyquire": "1.7.4", - "unexpected-bluebird": "2.9.34" - }, - "dependencies": { - "diff": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-1.1.0.tgz", - "integrity": "sha1-eYpJOBqkZBUem08Ob/Kwmooa0j8=", - "dev": true - } - } - }, - "unexpected-bluebird": { - "version": "2.9.34", - "resolved": "https://registry.npmjs.org/unexpected-bluebird/-/unexpected-bluebird-2.9.34.tgz", - "integrity": "sha1-Fqno6c7QZnd3i+k5MWqRotOCL+Y=", - "dev": true - }, - "unicode-5.2.0": { - "version": "0.7.5", - "resolved": "https://registry.npmjs.org/unicode-5.2.0/-/unicode-5.2.0-0.7.5.tgz", - "integrity": "sha512-KVGLW1Bri30x00yv4HNM8kBxoqFXr0Sbo55735nvrlsx4PYBZol3UtoWgO492fSwmsetzPEZzy73rbU8OGXJcA==", - "dev": true - }, - "util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", - "dev": true - }, - "verror": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", - "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", - "dev": true, - "requires": { - "assert-plus": "^1.0.0", - "core-util-is": "1.0.2", - "extsprintf": "^1.2.0" - }, - "dependencies": { - "assert-plus": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", - "dev": true - } - } - }, - "vlq": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/vlq/-/vlq-0.2.3.tgz", - "integrity": "sha512-DRibZL6DsNhIgYQ+wNdWDL2SL3bKPlVrRiBqV5yuMm++op8W4kGFtaQfCs4KEJn0wBZcHVHJ3eoywX8983k1ow==", - "dev": true - }, - "which": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", - "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", - "dev": true, - "requires": { - "isexe": "^2.0.0" - } - }, - "window-size": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.1.0.tgz", - "integrity": "sha1-VDjNLqk7IC76Ohn+iIeu58lPnJ0=", - "dev": true - }, - "winston": { - "version": "2.4.4", - "resolved": "https://registry.npmjs.org/winston/-/winston-2.4.4.tgz", - "integrity": "sha512-NBo2Pepn4hK4V01UfcWcDlmiVTs7VTB1h7bgnB0rgP146bYhMxX0ypCz3lBOfNxCO4Zuek7yeT+y/zM1OfMw4Q==", - "dev": true, - "optional": true, - "requires": { - "async": "~1.0.0", - "colors": "1.0.x", - "cycle": "1.0.x", - "eyes": "0.1.x", - "isstream": "0.1.x", - "stack-trace": "0.0.x" - }, - "dependencies": { - "async": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/async/-/async-1.0.0.tgz", - "integrity": "sha1-+PwEyjoTeErenhZBr5hXjPvWR6k=", - "dev": true, - "optional": true - } - } - }, - "wordwrap": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", - "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=", - "dev": true - }, - "wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", - "dev": true - }, - "xtend": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", - "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=", - "dev": true - }, - "yargs": { - "version": "3.10.0", - "resolved": "http://registry.npmjs.org/yargs/-/yargs-3.10.0.tgz", - "integrity": "sha1-9+572FfdfB0tOMDnTvvWgdFDH9E=", - "dev": true, - "requires": { - "camelcase": "^1.0.2", - "cliui": "^2.1.0", - "decamelize": "^1.0.0", - "window-size": "0.1.0" - } - }, - "yauzl": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.4.1.tgz", - "integrity": "sha1-lSj0QtqxsihOWLQ3m7GU4i4MQAU=", - "dev": true, - "optional": true, - "requires": { - "fd-slicer": "~1.0.1" - } - } - } -} From a40d17493d39eb0c7fed3571326795fb068ce11c Mon Sep 17 00:00:00 2001 From: Andreas Lind Date: Thu, 16 Jul 2020 12:16:12 +0200 Subject: [PATCH 13/26] Rename travis script to ci --- .travis.yml | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 1ec7467..71b0448 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,5 +11,5 @@ node_js: - "3" - "4" -script: "npm run-script travis" +script: "npm run ci" after_success: " Date: Thu, 16 Jul 2020 12:22:36 +0200 Subject: [PATCH 14/26] Try building on node.js 12 always, and only run the tests on the Travis-provided one --- .travis.yml | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 71b0448..d114691 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,5 +11,5 @@ node_js: - "3" - "4" -script: "npm run ci" +script: "(nvm i 12 && npm run build) && npm run ci:test" after_success: " Date: Thu, 16 Jul 2020 12:36:49 +0200 Subject: [PATCH 15/26] Add prettier setup --- .editorconfig | 2 +- .prettierignore | 6 ++++++ .prettierrc | 3 +++ .travis.yml | 22 ++++++++++++++-------- package.json | 3 ++- 5 files changed, 26 insertions(+), 10 deletions(-) create mode 100644 .prettierignore create mode 100644 .prettierrc diff --git a/.editorconfig b/.editorconfig index 63bd83c..68c9a74 100644 --- a/.editorconfig +++ b/.editorconfig @@ -16,7 +16,7 @@ insert_final_newline = true ; Indentation indent_style = space -indent_size = 4 +indent_size = 2 [Makefile] indent_style = tab diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..0d0e877 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,6 @@ +/node_modules/ +/demo/ +/slides/ +/one-color-all.js +/one-color.js +/coverage/ diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000..544138b --- /dev/null +++ b/.prettierrc @@ -0,0 +1,3 @@ +{ + "singleQuote": true +} diff --git a/.travis.yml b/.travis.yml index d114691..47bb799 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,13 +3,19 @@ services: language: node_js cache: directories: - - node_modules + - node_modules node_js: - - "0.12" - - "1" - - "2" - - "3" - - "4" + - '0.12' + - '1' + - '2' + - '3' + - '4' -script: "(nvm i 12 && npm run build) && npm run ci:test" -after_success: " Date: Thu, 16 Jul 2020 12:37:08 +0200 Subject: [PATCH 16/26] prettier --write '**/*.{js,md}' --- README.md | 188 ++++++------- index.js | 44 ++-- lib/CMYK.js | 59 +++-- lib/HSL.js | 45 ++-- lib/HSV.js | 175 +++++++------ lib/LAB.js | 52 ++-- lib/XYZ.js | 114 ++++---- lib/color.js | 524 ++++++++++++++++++++++--------------- lib/plugins/clearer.js | 6 +- lib/plugins/darken.js | 8 +- lib/plugins/desaturate.js | 8 +- lib/plugins/grayscale.js | 14 +- lib/plugins/isDark.js | 5 +- lib/plugins/isLight.js | 1 - lib/plugins/lighten.js | 8 +- lib/plugins/luminance.js | 10 +- lib/plugins/mix.js | 30 +-- lib/plugins/namedColors.js | 300 ++++++++++----------- lib/plugins/negate.js | 13 +- lib/plugins/opaquer.js | 6 +- lib/plugins/rotate.js | 8 +- lib/plugins/saturate.js | 8 +- lib/plugins/toAlpha.js | 74 +++--- minimal.js | 4 +- rollup.config.js | 4 +- test/color.js | 423 +++++++++++++++++------------- test/contrast.js | 18 +- test/conversion.js | 23 +- test/grayscale.js | 6 +- test/isDark.js | 18 +- test/isLight.js | 18 +- test/luminance.js | 14 +- test/mix.js | 6 +- test/parse.js | 71 ++--- test/samples.js | 290 ++++++++++---------- 35 files changed, 1387 insertions(+), 1208 deletions(-) diff --git a/README.md b/README.md index e854f0c..adfa8c1 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ -one.color -========= +# one.color + [![NPM version](https://badge.fury.io/js/onecolor.svg)](http://badge.fury.io/js/onecolor) [![Build Status](https://travis-ci.org/One-com/one-color.svg?branch=master)](https://travis-ci.org/One-com/one-color) [![Coverage Status](https://img.shields.io/coveralls/One-com/one-color.svg)](https://coveralls.io/r/One-com/one-color?branch=master) @@ -8,40 +8,44 @@ one.color JavaScript color calculation toolkit for node.js and the browser. Features: -* RGB, HSV, HSL, and CMYK colorspace support (experimental implementations of LAB and XYZ) -* Legal values for all channels are 0..1 -* Instances are immutable -- a new object is created for each manipulation -* All internal calculations are done using floating point, so very little precision is lost due to rounding errors when converting between colorspaces -* Alpha channel support -* Extensible architecture -- implement your own colorspaces easily -* Chainable color manipulation -* Seamless conversion between colorspaces -* Outputs as hex, `rgb(...)`, or `rgba(...)`. + +- RGB, HSV, HSL, and CMYK colorspace support (experimental implementations of LAB and XYZ) +- Legal values for all channels are 0..1 +- Instances are immutable -- a new object is created for each manipulation +- All internal calculations are done using floating point, so very little precision is lost due to rounding errors when converting between colorspaces +- Alpha channel support +- Extensible architecture -- implement your own colorspaces easily +- Chainable color manipulation +- Seamless conversion between colorspaces +- Outputs as hex, `rgb(...)`, or `rgba(...)`. Module support: -* CommonJS / Node -* AMD / RequireJS -* Vanilla JS (installs itself on one.color) + +- CommonJS / Node +- AMD / RequireJS +- Vanilla JS (installs itself on one.color) Package managers: -* npm: `npm install onecolor` -* bower: `bower install color` + +- npm: `npm install onecolor` +- bower: `bower install color` Small sizes: -* one-color.js ![](http://img.badgesize.io/One-com/one-color/master/one-color.js.svg?label=size) ![](http://img.badgesize.io/One-com/one-color/master/one-color.js.svg?label=gzip&compression=gzip) (Basic RGB, HSV, HSL) -* one-color-all.js ![](http://img.badgesize.io/One-com/one-color/master/one-color-all.js.svg?label=size) ![](http://img.badgesize.io/One-com/one-color/master/one-color-all.js.svg?label=gzip&compression=gzip) (Full RGB, HSV, HSL, CMYK, XYZ, LAB, named colors, [helper functions](https://github.com/One-com/one-color/tree/master/lib/plugins)) +- one-color.js ![](http://img.badgesize.io/One-com/one-color/master/one-color.js.svg?label=size) ![](http://img.badgesize.io/One-com/one-color/master/one-color.js.svg?label=gzip&compression=gzip) (Basic RGB, HSV, HSL) +- one-color-all.js ![](http://img.badgesize.io/One-com/one-color/master/one-color-all.js.svg?label=size) ![](http://img.badgesize.io/One-com/one-color/master/one-color-all.js.svg?label=gzip&compression=gzip) (Full RGB, HSV, HSL, CMYK, XYZ, LAB, named colors, [helper functions](https://github.com/One-com/one-color/tree/master/lib/plugins)) -Usage ------ +## Usage In the browser (change one-color.js to one-color-all.js to gain named color support): ```html - + ``` @@ -49,7 +53,7 @@ In node.js (after `npm install onecolor`): ```javascript var color = require('onecolor'); -console.warn(color('rgba(100%, 0%, 0%, .5)').alpha(.4).cssa()); // 'rgba(255,0,0,0.4)' +console.warn(color('rgba(100%, 0%, 0%, .5)').alpha(0.4).cssa()); // 'rgba(255,0,0,0.4)' ``` `one.color` is the parser. All of the above return color instances in @@ -59,7 +63,7 @@ variables: ```javascript var myColor = one.color('#a9d91d'); myColor instanceof one.color.RGB; // true -myColor.red() // 0.6627450980392157 +myColor.red(); // 0.6627450980392157 ``` You can also parse named CSS colors (works out of the box in node.js, @@ -67,15 +71,15 @@ but the requires the slightly bigger one-color-all.js build adds support for the standard suite of named CSS colors: ```javascript -one.color('maroon') -one.color('darkolivegreen') +one.color('maroon'); +one.color('darkolivegreen'); ``` Existing one.color instances pass through unchanged, which is useful in APIs where you want to accept either a string or a color instance: ```javascript -one.color(one.color('#fff')) // Same as one.color('#fff') +one.color(one.color('#fff')); // Same as one.color('#fff') ``` Serialization methods: ```javascript -color.hex() // 6-digit hex string: '#bda65b' -color.css() // CSS rgb syntax: 'rgb(10,128,220)' -color.cssa() // CSS rgba syntax: 'rgba(10,128,220,0.8)' -color.toString() // For debugging: '[one.color.RGB: Red=0.3 Green=0.8 Blue=0 Alpha=1]' -color.toJSON() // ["RGB"|"HSV"|"HSL", , , , ] +color.hex(); // 6-digit hex string: '#bda65b' +color.css(); // CSS rgb syntax: 'rgb(10,128,220)' +color.cssa(); // CSS rgba syntax: 'rgba(10,128,220,0.8)' +color.toString(); // For debugging: '[one.color.RGB: Red=0.3 Green=0.8 Blue=0 Alpha=1]' +color.toJSON(); // ["RGB"|"HSV"|"HSL", , , , ] ``` Getters -- return the value of the channel (converts to other colorspaces as needed): ```javascript -color.red() -color.green() -color.blue() -color.hue() -color.saturation() -color.value() -color.lightness() -color.alpha() -color.cyan() // one-color-all.js and node.js only -color.magenta() // one-color-all.js and node.js only -color.yellow() // one-color-all.js and node.js only -color.black() // one-color-all.js and node.js only +color.red(); +color.green(); +color.blue(); +color.hue(); +color.saturation(); +color.value(); +color.lightness(); +color.alpha(); +color.cyan(); // one-color-all.js and node.js only +color.magenta(); // one-color-all.js and node.js only +color.yellow(); // one-color-all.js and node.js only +color.black(); // one-color-all.js and node.js only ``` Setters -- return new color instances with one channel changed: @@ -255,14 +255,14 @@ color.magenta(, true) // one-color-all.js and node.js only color.yellow(, true) // one-color-all.js and node.js only color.black(, true) // one-color-all.js and node.js only ``` + Comparison with other color objects, returns `true` or `false` (epsilon defaults to `1e-9`): ```javascript color.equals(otherColor[, ]) ``` -Mostly for internal (and plugin) use: -------------------------------------- +## Mostly for internal (and plugin) use: "Low level" constructors, accept 3 or 4 numerical arguments (0..1): @@ -271,6 +271,7 @@ new one.color.RGB(, , [, ]) new one.color.HSL(, , [, ]) new one.color.HSV(, , [, ]) ``` + The one-color-all.js build includes CMYK support: ```javascript @@ -287,13 +288,15 @@ specific colorspace, do an explicit conversion first to cut down on the number of implicit conversions: ```javascript -var myColor = one.color('#0620ff').lightness(+.3).rgb(); +var myColor = one + .color('#0620ff') + .lightness(+0.3) + .rgb(); // Alerts '0 0.06265060240963878 0.5999999999999999': alert(myColor.red() + ' ' + myColor.green() + ' ' + myColor.blue()); ``` -Building -======== +# Building ``` git clone https://github.com/One-com/one-color.git @@ -305,10 +308,9 @@ npm run build If you aren't up for a complete installation, there are pre-built packages in the repository as well as the npm package: -* Basic library: one-color.js -* Full library including named color support: one-color-all.js +- Basic library: one-color.js +- Full library including named color support: one-color-all.js -License -======= +# License one.color is licensed under a standard 2-clause BSD license -- see the `LICENSE` file for details. diff --git a/index.js b/index.js index 05a954f..41ae8e6 100644 --- a/index.js +++ b/index.js @@ -1,24 +1,24 @@ module.exports = require('./lib/color') - .use(require('./lib/XYZ')) - .use(require('./lib/LAB')) - .use(require('./lib/HSV')) - .use(require('./lib/HSL')) - .use(require('./lib/CMYK')) + .use(require('./lib/XYZ')) + .use(require('./lib/LAB')) + .use(require('./lib/HSV')) + .use(require('./lib/HSL')) + .use(require('./lib/CMYK')) - // Convenience functions - .use(require('./lib/plugins/namedColors')) - .use(require('./lib/plugins/clearer.js')) - .use(require('./lib/plugins/contrast.js')) - .use(require('./lib/plugins/darken.js')) - .use(require('./lib/plugins/desaturate.js')) - .use(require('./lib/plugins/grayscale.js')) - .use(require('./lib/plugins/isDark.js')) - .use(require('./lib/plugins/isLight.js')) - .use(require('./lib/plugins/lighten.js')) - .use(require('./lib/plugins/luminance.js')) - .use(require('./lib/plugins/mix.js')) - .use(require('./lib/plugins/negate.js')) - .use(require('./lib/plugins/opaquer.js')) - .use(require('./lib/plugins/rotate.js')) - .use(require('./lib/plugins/saturate.js')) - .use(require('./lib/plugins/toAlpha.js')); + // Convenience functions + .use(require('./lib/plugins/namedColors')) + .use(require('./lib/plugins/clearer.js')) + .use(require('./lib/plugins/contrast.js')) + .use(require('./lib/plugins/darken.js')) + .use(require('./lib/plugins/desaturate.js')) + .use(require('./lib/plugins/grayscale.js')) + .use(require('./lib/plugins/isDark.js')) + .use(require('./lib/plugins/isLight.js')) + .use(require('./lib/plugins/lighten.js')) + .use(require('./lib/plugins/luminance.js')) + .use(require('./lib/plugins/mix.js')) + .use(require('./lib/plugins/negate.js')) + .use(require('./lib/plugins/opaquer.js')) + .use(require('./lib/plugins/rotate.js')) + .use(require('./lib/plugins/saturate.js')) + .use(require('./lib/plugins/toAlpha.js')); diff --git a/lib/CMYK.js b/lib/CMYK.js index 8d97461..8e60622 100644 --- a/lib/CMYK.js +++ b/lib/CMYK.js @@ -1,30 +1,37 @@ module.exports = function CMYK(color) { - color.installColorSpace('CMYK', ['cyan', 'magenta', 'yellow', 'black', 'alpha'], { - rgb: function () { - return new color.RGB((1 - this._cyan * (1 - this._black) - this._black), - (1 - this._magenta * (1 - this._black) - this._black), - (1 - this._yellow * (1 - this._black) - this._black), - this._alpha); - }, + color.installColorSpace( + 'CMYK', + ['cyan', 'magenta', 'yellow', 'black', 'alpha'], + { + rgb: function () { + return new color.RGB( + 1 - this._cyan * (1 - this._black) - this._black, + 1 - this._magenta * (1 - this._black) - this._black, + 1 - this._yellow * (1 - this._black) - this._black, + this._alpha + ); + }, - fromRgb: function () { // Becomes one.color.RGB.prototype.cmyk - // Adapted from http://www.javascripter.net/faq/rgb2cmyk.htm - var red = this._red, - green = this._green, - blue = this._blue, - cyan = 1 - red, - magenta = 1 - green, - yellow = 1 - blue, - black = 1; - if (red || green || blue) { - black = Math.min(cyan, Math.min(magenta, yellow)); - cyan = (cyan - black) / (1 - black); - magenta = (magenta - black) / (1 - black); - yellow = (yellow - black) / (1 - black); - } else { - black = 1; - } - return new color.CMYK(cyan, magenta, yellow, black, this._alpha); + fromRgb: function () { + // Becomes one.color.RGB.prototype.cmyk + // Adapted from http://www.javascripter.net/faq/rgb2cmyk.htm + var red = this._red, + green = this._green, + blue = this._blue, + cyan = 1 - red, + magenta = 1 - green, + yellow = 1 - blue, + black = 1; + if (red || green || blue) { + black = Math.min(cyan, Math.min(magenta, yellow)); + cyan = (cyan - black) / (1 - black); + magenta = (magenta - black) / (1 - black); + yellow = (yellow - black) / (1 - black); + } else { + black = 1; } - }); + return new color.CMYK(cyan, magenta, yellow, black, this._alpha); + }, + } + ); }; diff --git a/lib/HSL.js b/lib/HSL.js index 60f8d18..8c0d698 100644 --- a/lib/HSL.js +++ b/lib/HSL.js @@ -1,29 +1,30 @@ module.exports = function HSL(color) { - color.use(require('./HSV')); + color.use(require('./HSV')); - color.installColorSpace('HSL', ['hue', 'saturation', 'lightness', 'alpha'], { - hsv: function () { - // Algorithm adapted from http://wiki.secondlife.com/wiki/Color_conversion_scripts - var l = this._lightness * 2, - s = this._saturation * ((l <= 1) ? l : 2 - l), - saturation; + color.installColorSpace('HSL', ['hue', 'saturation', 'lightness', 'alpha'], { + hsv: function () { + // Algorithm adapted from http://wiki.secondlife.com/wiki/Color_conversion_scripts + var l = this._lightness * 2, + s = this._saturation * (l <= 1 ? l : 2 - l), + saturation; - // Avoid division by zero when l + s is very small (approaching black): - if (l + s < 1e-9) { - saturation = 0; - } else { - saturation = (2 * s) / (l + s); - } + // Avoid division by zero when l + s is very small (approaching black): + if (l + s < 1e-9) { + saturation = 0; + } else { + saturation = (2 * s) / (l + s); + } - return new color.HSV(this._hue, saturation, (l + s) / 2, this._alpha); - }, + return new color.HSV(this._hue, saturation, (l + s) / 2, this._alpha); + }, - rgb: function () { - return this.hsv().rgb(); - }, + rgb: function () { + return this.hsv().rgb(); + }, - fromRgb: function () { // Becomes one.color.RGB.prototype.hsv - return this.hsv().hsl(); - } - }); + fromRgb: function () { + // Becomes one.color.RGB.prototype.hsv + return this.hsv().hsl(); + }, + }); }; diff --git a/lib/HSV.js b/lib/HSV.js index 246a498..86df5c4 100644 --- a/lib/HSV.js +++ b/lib/HSV.js @@ -1,93 +1,94 @@ module.exports = function HSV(color) { - color.installColorSpace('HSV', ['hue', 'saturation', 'value', 'alpha'], { - rgb: function () { - var hue = this._hue, - saturation = this._saturation, - value = this._value, - i = Math.min(5, Math.floor(hue * 6)), - f = hue * 6 - i, - p = value * (1 - saturation), - q = value * (1 - f * saturation), - t = value * (1 - (1 - f) * saturation), - red, - green, - blue; - switch (i) { - case 0: - red = value; - green = t; - blue = p; - break; - case 1: - red = q; - green = value; - blue = p; - break; - case 2: - red = p; - green = value; - blue = t; - break; - case 3: - red = p; - green = q; - blue = value; - break; - case 4: - red = t; - green = p; - blue = value; - break; - case 5: - red = value; - green = p; - blue = q; - break; - } - return new color.RGB(red, green, blue, this._alpha); - }, + color.installColorSpace('HSV', ['hue', 'saturation', 'value', 'alpha'], { + rgb: function () { + var hue = this._hue, + saturation = this._saturation, + value = this._value, + i = Math.min(5, Math.floor(hue * 6)), + f = hue * 6 - i, + p = value * (1 - saturation), + q = value * (1 - f * saturation), + t = value * (1 - (1 - f) * saturation), + red, + green, + blue; + switch (i) { + case 0: + red = value; + green = t; + blue = p; + break; + case 1: + red = q; + green = value; + blue = p; + break; + case 2: + red = p; + green = value; + blue = t; + break; + case 3: + red = p; + green = q; + blue = value; + break; + case 4: + red = t; + green = p; + blue = value; + break; + case 5: + red = value; + green = p; + blue = q; + break; + } + return new color.RGB(red, green, blue, this._alpha); + }, - hsl: function () { - var l = (2 - this._saturation) * this._value, - sv = this._saturation * this._value, - svDivisor = l <= 1 ? l : (2 - l), - saturation; + hsl: function () { + var l = (2 - this._saturation) * this._value, + sv = this._saturation * this._value, + svDivisor = l <= 1 ? l : 2 - l, + saturation; - // Avoid division by zero when lightness approaches zero: - if (svDivisor < 1e-9) { - saturation = 0; - } else { - saturation = sv / svDivisor; - } - return new color.HSL(this._hue, saturation, l / 2, this._alpha); - }, + // Avoid division by zero when lightness approaches zero: + if (svDivisor < 1e-9) { + saturation = 0; + } else { + saturation = sv / svDivisor; + } + return new color.HSL(this._hue, saturation, l / 2, this._alpha); + }, - fromRgb: function () { // Becomes one.color.RGB.prototype.hsv - var red = this._red, - green = this._green, - blue = this._blue, - max = Math.max(red, green, blue), - min = Math.min(red, green, blue), - delta = max - min, - hue, - saturation = (max === 0) ? 0 : (delta / max), - value = max; - if (delta === 0) { - hue = 0; - } else { - switch (max) { - case red: - hue = (green - blue) / delta / 6 + (green < blue ? 1 : 0); - break; - case green: - hue = (blue - red) / delta / 6 + 1 / 3; - break; - case blue: - hue = (red - green) / delta / 6 + 2 / 3; - break; - } - } - return new color.HSV(hue, saturation, value, this._alpha); + fromRgb: function () { + // Becomes one.color.RGB.prototype.hsv + var red = this._red, + green = this._green, + blue = this._blue, + max = Math.max(red, green, blue), + min = Math.min(red, green, blue), + delta = max - min, + hue, + saturation = max === 0 ? 0 : delta / max, + value = max; + if (delta === 0) { + hue = 0; + } else { + switch (max) { + case red: + hue = (green - blue) / delta / 6 + (green < blue ? 1 : 0); + break; + case green: + hue = (blue - red) / delta / 6 + 1 / 3; + break; + case blue: + hue = (red - green) / delta / 6 + 2 / 3; + break; } - }); + } + return new color.HSV(hue, saturation, value, this._alpha); + }, + }); }; diff --git a/lib/LAB.js b/lib/LAB.js index 1b91813..6f34ca5 100644 --- a/lib/LAB.js +++ b/lib/LAB.js @@ -1,33 +1,31 @@ module.exports = function LAB(color) { - color.use(require('./XYZ.js')); + color.use(require('./XYZ.js')); - color.installColorSpace('LAB', ['l', 'a', 'b', 'alpha'], { - fromRgb: function () { - return this.xyz().lab(); - }, + color.installColorSpace('LAB', ['l', 'a', 'b', 'alpha'], { + fromRgb: function () { + return this.xyz().lab(); + }, - rgb: function () { - return this.xyz().rgb(); - }, + rgb: function () { + return this.xyz().rgb(); + }, - xyz: function () { - // http://www.easyrgb.com/index.php?X=MATH&H=08#text8 - var convert = function (channel) { - var pow = Math.pow(channel, 3); - return pow > 0.008856 ? - pow : - (channel - 16 / 116) / 7.87; - }, - y = (this._l + 16) / 116, - x = this._a / 500 + y, - z = y - this._b / 200; + xyz: function () { + // http://www.easyrgb.com/index.php?X=MATH&H=08#text8 + var convert = function (channel) { + var pow = Math.pow(channel, 3); + return pow > 0.008856 ? pow : (channel - 16 / 116) / 7.87; + }, + y = (this._l + 16) / 116, + x = this._a / 500 + y, + z = y - this._b / 200; - return new color.XYZ( - convert(x) * 95.047, - convert(y) * 100.000, - convert(z) * 108.883, - this._alpha - ); - } - }); + return new color.XYZ( + convert(x) * 95.047, + convert(y) * 100.0, + convert(z) * 108.883, + this._alpha + ); + }, + }); }; diff --git a/lib/XYZ.js b/lib/XYZ.js index 504f0c8..c35e4be 100644 --- a/lib/XYZ.js +++ b/lib/XYZ.js @@ -1,64 +1,64 @@ module.exports = function XYZ(color) { - color.installColorSpace('XYZ', ['x', 'y', 'z', 'alpha'], { - fromRgb: function () { - // http://www.easyrgb.com/index.php?X=MATH&H=02#text2 - var convert = function (channel) { - return channel > 0.04045 ? - Math.pow((channel + 0.055) / 1.055, 2.4) : - channel / 12.92; - }, - r = convert(this._red), - g = convert(this._green), - b = convert(this._blue); - - // Reference white point sRGB D65: - // http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html - return new color.XYZ( - r * 0.4124564 + g * 0.3575761 + b * 0.1804375, - r * 0.2126729 + g * 0.7151522 + b * 0.0721750, - r * 0.0193339 + g * 0.1191920 + b * 0.9503041, - this._alpha - ); + color.installColorSpace('XYZ', ['x', 'y', 'z', 'alpha'], { + fromRgb: function () { + // http://www.easyrgb.com/index.php?X=MATH&H=02#text2 + var convert = function (channel) { + return channel > 0.04045 + ? Math.pow((channel + 0.055) / 1.055, 2.4) + : channel / 12.92; }, + r = convert(this._red), + g = convert(this._green), + b = convert(this._blue); - rgb: function () { - // http://www.easyrgb.com/index.php?X=MATH&H=01#text1 - var x = this._x, - y = this._y, - z = this._z, - convert = function (channel) { - return channel > 0.0031308 ? - 1.055 * Math.pow(channel, 1 / 2.4) - 0.055 : - 12.92 * channel; - }; + // Reference white point sRGB D65: + // http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html + return new color.XYZ( + r * 0.4124564 + g * 0.3575761 + b * 0.1804375, + r * 0.2126729 + g * 0.7151522 + b * 0.072175, + r * 0.0193339 + g * 0.119192 + b * 0.9503041, + this._alpha + ); + }, - // Reference white point sRGB D65: - // http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html - return new color.RGB( - convert(x * 3.2404542 + y * -1.5371385 + z * -0.4985314), - convert(x * -0.9692660 + y * 1.8760108 + z * 0.0415560), - convert(x * 0.0556434 + y * -0.2040259 + z * 1.0572252), - this._alpha - ); - }, + rgb: function () { + // http://www.easyrgb.com/index.php?X=MATH&H=01#text1 + var x = this._x, + y = this._y, + z = this._z, + convert = function (channel) { + return channel > 0.0031308 + ? 1.055 * Math.pow(channel, 1 / 2.4) - 0.055 + : 12.92 * channel; + }; - lab: function () { - // http://www.easyrgb.com/index.php?X=MATH&H=07#text7 - var convert = function (channel) { - return channel > 0.008856 ? - Math.pow(channel, 1 / 3) : - 7.787037 * channel + 4 / 29; - }, - x = convert(this._x / 95.047), - y = convert(this._y / 100.000), - z = convert(this._z / 108.883); + // Reference white point sRGB D65: + // http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html + return new color.RGB( + convert(x * 3.2404542 + y * -1.5371385 + z * -0.4985314), + convert(x * -0.969266 + y * 1.8760108 + z * 0.041556), + convert(x * 0.0556434 + y * -0.2040259 + z * 1.0572252), + this._alpha + ); + }, + + lab: function () { + // http://www.easyrgb.com/index.php?X=MATH&H=07#text7 + var convert = function (channel) { + return channel > 0.008856 + ? Math.pow(channel, 1 / 3) + : 7.787037 * channel + 4 / 29; + }, + x = convert(this._x / 95.047), + y = convert(this._y / 100.0), + z = convert(this._z / 108.883); - return new color.LAB( - (116 * y) - 16, - 500 * (x - y), - 200 * (y - z), - this._alpha - ); - } - }); + return new color.LAB( + 116 * y - 16, + 500 * (x - y), + 200 * (y - z), + this._alpha + ); + }, + }); }; diff --git a/lib/color.js b/lib/color.js index 9155b0f..3838ed9 100644 --- a/lib/color.js +++ b/lib/color.js @@ -1,254 +1,354 @@ var installedColorSpaces = [], - undef = function (obj) { - return typeof obj === 'undefined'; - }, - channelRegExp = /\s*(\.\d+|\d+(?:\.\d+)?)(%)?\s*/, - percentageChannelRegExp = /\s*(\.\d+|100|\d?\d(?:\.\d+)?)%\s*/, - alphaChannelRegExp = /\s*(\.\d+|\d+(?:\.\d+)?)\s*/, - cssColorRegExp = new RegExp( - '^(rgb|hsl|hsv)a?' + - '\\(' + - channelRegExp.source + ',' + - channelRegExp.source + ',' + - channelRegExp.source + - '(?:,' + alphaChannelRegExp.source + ')?' + - '\\)$', 'i'); + undef = function (obj) { + return typeof obj === 'undefined'; + }, + channelRegExp = /\s*(\.\d+|\d+(?:\.\d+)?)(%)?\s*/, + percentageChannelRegExp = /\s*(\.\d+|100|\d?\d(?:\.\d+)?)%\s*/, + alphaChannelRegExp = /\s*(\.\d+|\d+(?:\.\d+)?)\s*/, + cssColorRegExp = new RegExp( + '^(rgb|hsl|hsv)a?' + + '\\(' + + channelRegExp.source + + ',' + + channelRegExp.source + + ',' + + channelRegExp.source + + '(?:,' + + alphaChannelRegExp.source + + ')?' + + '\\)$', + 'i' + ); function color(obj) { - if (Array.isArray(obj)) { - if (typeof obj[0] === 'string' && typeof color[obj[0]] === 'function') { - // Assumed array from .toJSON() - return new color[obj[0]](obj.slice(1, obj.length)); - } else if (obj.length === 4) { - // Assumed 4 element int RGB array from canvas with all channels [0;255] - return new color.RGB(obj[0] / 255, obj[1] / 255, obj[2] / 255, obj[3] / 255); - } - } else if (typeof obj === 'string') { - var lowerCased = obj.toLowerCase(); - if (color.namedColors[lowerCased]) { - obj = '#' + color.namedColors[lowerCased]; - } - if (lowerCased === 'transparent') { - obj = 'rgba(0,0,0,0)'; - } - // Test for CSS rgb(....) string - var matchCssSyntax = obj.match(cssColorRegExp); - if (matchCssSyntax) { - var colorSpaceName = matchCssSyntax[1].toUpperCase(), - alpha = undef(matchCssSyntax[8]) ? matchCssSyntax[8] : parseFloat(matchCssSyntax[8]), - hasHue = colorSpaceName[0] === 'H', - firstChannelDivisor = matchCssSyntax[3] ? 100 : (hasHue ? 360 : 255), - secondChannelDivisor = (matchCssSyntax[5] || hasHue) ? 100 : 255, - thirdChannelDivisor = (matchCssSyntax[7] || hasHue) ? 100 : 255; - if (undef(color[colorSpaceName])) { - throw new Error('color.' + colorSpaceName + ' is not installed.'); - } - return new color[colorSpaceName]( - parseFloat(matchCssSyntax[2]) / firstChannelDivisor, - parseFloat(matchCssSyntax[4]) / secondChannelDivisor, - parseFloat(matchCssSyntax[6]) / thirdChannelDivisor, - alpha - ); - } - // Assume hex syntax - if (obj.length < 6) { - // Allow CSS shorthand - obj = obj.replace(/^#?([0-9a-f])([0-9a-f])([0-9a-f])$/i, '$1$1$2$2$3$3'); - } - // Split obj into red, green, and blue components - var hexMatch = obj.match(/^#?([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])$/i); - if (hexMatch) { - return new color.RGB( - parseInt(hexMatch[1], 16) / 255, - parseInt(hexMatch[2], 16) / 255, - parseInt(hexMatch[3], 16) / 255 - ); - } + if (Array.isArray(obj)) { + if (typeof obj[0] === 'string' && typeof color[obj[0]] === 'function') { + // Assumed array from .toJSON() + return new color[obj[0]](obj.slice(1, obj.length)); + } else if (obj.length === 4) { + // Assumed 4 element int RGB array from canvas with all channels [0;255] + return new color.RGB( + obj[0] / 255, + obj[1] / 255, + obj[2] / 255, + obj[3] / 255 + ); + } + } else if (typeof obj === 'string') { + var lowerCased = obj.toLowerCase(); + if (color.namedColors[lowerCased]) { + obj = '#' + color.namedColors[lowerCased]; + } + if (lowerCased === 'transparent') { + obj = 'rgba(0,0,0,0)'; + } + // Test for CSS rgb(....) string + var matchCssSyntax = obj.match(cssColorRegExp); + if (matchCssSyntax) { + var colorSpaceName = matchCssSyntax[1].toUpperCase(), + alpha = undef(matchCssSyntax[8]) + ? matchCssSyntax[8] + : parseFloat(matchCssSyntax[8]), + hasHue = colorSpaceName[0] === 'H', + firstChannelDivisor = matchCssSyntax[3] ? 100 : hasHue ? 360 : 255, + secondChannelDivisor = matchCssSyntax[5] || hasHue ? 100 : 255, + thirdChannelDivisor = matchCssSyntax[7] || hasHue ? 100 : 255; + if (undef(color[colorSpaceName])) { + throw new Error('color.' + colorSpaceName + ' is not installed.'); + } + return new color[colorSpaceName]( + parseFloat(matchCssSyntax[2]) / firstChannelDivisor, + parseFloat(matchCssSyntax[4]) / secondChannelDivisor, + parseFloat(matchCssSyntax[6]) / thirdChannelDivisor, + alpha + ); + } + // Assume hex syntax + if (obj.length < 6) { + // Allow CSS shorthand + obj = obj.replace(/^#?([0-9a-f])([0-9a-f])([0-9a-f])$/i, '$1$1$2$2$3$3'); + } + // Split obj into red, green, and blue components + var hexMatch = obj.match( + /^#?([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])$/i + ); + if (hexMatch) { + return new color.RGB( + parseInt(hexMatch[1], 16) / 255, + parseInt(hexMatch[2], 16) / 255, + parseInt(hexMatch[3], 16) / 255 + ); + } - // No match so far. Lets try the less likely ones - if (color.CMYK) { - var cmykMatch = obj.match(new RegExp( - '^cmyk' + - '\\(' + - percentageChannelRegExp.source + ',' + - percentageChannelRegExp.source + ',' + - percentageChannelRegExp.source + ',' + - percentageChannelRegExp.source + - '\\)$', 'i')); - if (cmykMatch) { - return new color.CMYK( - parseFloat(cmykMatch[1]) / 100, - parseFloat(cmykMatch[2]) / 100, - parseFloat(cmykMatch[3]) / 100, - parseFloat(cmykMatch[4]) / 100 - ); - } - } - } else if (typeof obj === 'object' && obj.isColor) { - return obj; + // No match so far. Lets try the less likely ones + if (color.CMYK) { + var cmykMatch = obj.match( + new RegExp( + '^cmyk' + + '\\(' + + percentageChannelRegExp.source + + ',' + + percentageChannelRegExp.source + + ',' + + percentageChannelRegExp.source + + ',' + + percentageChannelRegExp.source + + '\\)$', + 'i' + ) + ); + if (cmykMatch) { + return new color.CMYK( + parseFloat(cmykMatch[1]) / 100, + parseFloat(cmykMatch[2]) / 100, + parseFloat(cmykMatch[3]) / 100, + parseFloat(cmykMatch[4]) / 100 + ); + } } - return false; + } else if (typeof obj === 'object' && obj.isColor) { + return obj; + } + return false; } color.namedColors = {}; color.installColorSpace = function (colorSpaceName, propertyNames, config) { - color[colorSpaceName] = function (a1) { // ... - var args = Array.isArray(a1) ? a1 : arguments; - propertyNames.forEach(function (propertyName, i) { - var propertyValue = args[i]; - if (propertyName === 'alpha') { - this._alpha = (isNaN(propertyValue) || propertyValue > 1) ? 1 : (propertyValue < 0 ? 0 : propertyValue); - } else { - if (isNaN(propertyValue)) { - throw new Error('[' + colorSpaceName + ']: Invalid color: (' + propertyNames.join(',') + ')'); - } - if (propertyName === 'hue') { - this._hue = propertyValue < 0 ? propertyValue - Math.floor(propertyValue) : propertyValue % 1; - } else { - this['_' + propertyName] = propertyValue < 0 ? 0 : (propertyValue > 1 ? 1 : propertyValue); - } - } - }, this); - }; - color[colorSpaceName].propertyNames = propertyNames; + color[colorSpaceName] = function (a1) { + // ... + var args = Array.isArray(a1) ? a1 : arguments; + propertyNames.forEach(function (propertyName, i) { + var propertyValue = args[i]; + if (propertyName === 'alpha') { + this._alpha = + isNaN(propertyValue) || propertyValue > 1 + ? 1 + : propertyValue < 0 + ? 0 + : propertyValue; + } else { + if (isNaN(propertyValue)) { + throw new Error( + '[' + + colorSpaceName + + ']: Invalid color: (' + + propertyNames.join(',') + + ')' + ); + } + if (propertyName === 'hue') { + this._hue = + propertyValue < 0 + ? propertyValue - Math.floor(propertyValue) + : propertyValue % 1; + } else { + this['_' + propertyName] = + propertyValue < 0 ? 0 : propertyValue > 1 ? 1 : propertyValue; + } + } + }, this); + }; + color[colorSpaceName].propertyNames = propertyNames; - var prototype = color[colorSpaceName].prototype; + var prototype = color[colorSpaceName].prototype; - ['valueOf', 'hex', 'hexa', 'css', 'cssa'].forEach(function (methodName) { - prototype[methodName] = prototype[methodName] || (colorSpaceName === 'RGB' ? prototype.hex : function () { + ['valueOf', 'hex', 'hexa', 'css', 'cssa'].forEach(function (methodName) { + prototype[methodName] = + prototype[methodName] || + (colorSpaceName === 'RGB' + ? prototype.hex + : function () { return this.rgb()[methodName](); - }); - }); + }); + }); - prototype.isColor = true; + prototype.isColor = true; - prototype.equals = function (otherColor, epsilon) { - if (undef(epsilon)) { - epsilon = 1e-10; - } + prototype.equals = function (otherColor, epsilon) { + if (undef(epsilon)) { + epsilon = 1e-10; + } - otherColor = otherColor[colorSpaceName.toLowerCase()](); + otherColor = otherColor[colorSpaceName.toLowerCase()](); - for (var i = 0; i < propertyNames.length; i = i + 1) { - if (Math.abs(this['_' + propertyNames[i]] - otherColor['_' + propertyNames[i]]) > epsilon) { - return false; - } - } + for (var i = 0; i < propertyNames.length; i = i + 1) { + if ( + Math.abs( + this['_' + propertyNames[i]] - otherColor['_' + propertyNames[i]] + ) > epsilon + ) { + return false; + } + } - return true; - }; + return true; + }; - prototype.toJSON = function () { - return [colorSpaceName].concat(propertyNames.map(function (propertyName) { - return this['_' + propertyName]; - }, this)); - }; + prototype.toJSON = function () { + return [colorSpaceName].concat( + propertyNames.map(function (propertyName) { + return this['_' + propertyName]; + }, this) + ); + }; - for (var propertyName in config) { - if (config.hasOwnProperty(propertyName)) { - var matchFromColorSpace = propertyName.match(/^from(.*)$/); - if (matchFromColorSpace) { - color[matchFromColorSpace[1].toUpperCase()].prototype[colorSpaceName.toLowerCase()] = config[propertyName]; - } else { - prototype[propertyName] = config[propertyName]; - } - } + for (var propertyName in config) { + if (config.hasOwnProperty(propertyName)) { + var matchFromColorSpace = propertyName.match(/^from(.*)$/); + if (matchFromColorSpace) { + color[matchFromColorSpace[1].toUpperCase()].prototype[ + colorSpaceName.toLowerCase() + ] = config[propertyName]; + } else { + prototype[propertyName] = config[propertyName]; + } } + } - // It is pretty easy to implement the conversion to the same color space: - prototype[colorSpaceName.toLowerCase()] = function () { - return this; - }; - prototype.toString = function () { - return '[' + colorSpaceName + ' ' + propertyNames.map(function (propertyName) { - return this['_' + propertyName]; - }, this).join(', ') + ']'; + // It is pretty easy to implement the conversion to the same color space: + prototype[colorSpaceName.toLowerCase()] = function () { + return this; + }; + prototype.toString = function () { + return ( + '[' + + colorSpaceName + + ' ' + + propertyNames + .map(function (propertyName) { + return this['_' + propertyName]; + }, this) + .join(', ') + + ']' + ); + }; + + // Generate getters and setters + propertyNames.forEach(function (propertyName) { + var shortName = propertyName === 'black' ? 'k' : propertyName.charAt(0); + prototype[propertyName] = prototype[shortName] = function (value, isDelta) { + // Simple getter mode: color.red() + if (typeof value === 'undefined') { + return this['_' + propertyName]; + } else if (isDelta) { + // Adjuster: color.red(+.2, true) + return new this.constructor( + propertyNames.map(function (otherPropertyName) { + return ( + this['_' + otherPropertyName] + + (propertyName === otherPropertyName ? value : 0) + ); + }, this) + ); + } else { + // Setter: color.red(.2); + return new this.constructor( + propertyNames.map(function (otherPropertyName) { + return propertyName === otherPropertyName + ? value + : this['_' + otherPropertyName]; + }, this) + ); + } }; + }); - // Generate getters and setters - propertyNames.forEach(function (propertyName) { - var shortName = propertyName === 'black' ? 'k' : propertyName.charAt(0); - prototype[propertyName] = prototype[shortName] = function (value, isDelta) { - // Simple getter mode: color.red() - if (typeof value === 'undefined') { - return this['_' + propertyName]; - } else if (isDelta) { - // Adjuster: color.red(+.2, true) - return new this.constructor(propertyNames.map(function (otherPropertyName) { - return this['_' + otherPropertyName] + (propertyName === otherPropertyName ? value : 0); - }, this)); - } else { - // Setter: color.red(.2); - return new this.constructor(propertyNames.map(function (otherPropertyName) { - return (propertyName === otherPropertyName) ? value : this['_' + otherPropertyName]; - }, this)); - } - }; + function installForeignMethods(targetColorSpaceName, sourceColorSpaceName) { + var obj = {}; + obj[sourceColorSpaceName.toLowerCase()] = function () { + return this.rgb()[sourceColorSpaceName.toLowerCase()](); + }; + color[sourceColorSpaceName].propertyNames.forEach(function (propertyName) { + var shortName = propertyName === 'black' ? 'k' : propertyName.charAt(0); + obj[propertyName] = obj[shortName] = function (value, isDelta) { + return this[sourceColorSpaceName.toLowerCase()]()[propertyName]( + value, + isDelta + ); + }; }); - - function installForeignMethods(targetColorSpaceName, sourceColorSpaceName) { - var obj = {}; - obj[sourceColorSpaceName.toLowerCase()] = function () { - return this.rgb()[sourceColorSpaceName.toLowerCase()](); - }; - color[sourceColorSpaceName].propertyNames.forEach(function (propertyName) { - var shortName = propertyName === 'black' ? 'k' : propertyName.charAt(0); - obj[propertyName] = obj[shortName] = function (value, isDelta) { - return this[sourceColorSpaceName.toLowerCase()]()[propertyName](value, isDelta); - }; - }); - for (var prop in obj) { - if (obj.hasOwnProperty(prop) && color[targetColorSpaceName].prototype[prop] === undefined) { - color[targetColorSpaceName].prototype[prop] = obj[prop]; - } - } + for (var prop in obj) { + if ( + obj.hasOwnProperty(prop) && + color[targetColorSpaceName].prototype[prop] === undefined + ) { + color[targetColorSpaceName].prototype[prop] = obj[prop]; + } } + } - installedColorSpaces.forEach(function (otherColorSpaceName) { - installForeignMethods(colorSpaceName, otherColorSpaceName); - installForeignMethods(otherColorSpaceName, colorSpaceName); - }); + installedColorSpaces.forEach(function (otherColorSpaceName) { + installForeignMethods(colorSpaceName, otherColorSpaceName); + installForeignMethods(otherColorSpaceName, colorSpaceName); + }); - installedColorSpaces.push(colorSpaceName); - return color; + installedColorSpaces.push(colorSpaceName); + return color; }; color.pluginList = []; color.use = function (plugin) { - if (color.pluginList.indexOf(plugin) === -1) { - this.pluginList.push(plugin); - plugin(color); - } - return color; + if (color.pluginList.indexOf(plugin) === -1) { + this.pluginList.push(plugin); + plugin(color); + } + return color; }; color.installMethod = function (name, fn) { - installedColorSpaces.forEach(function (colorSpace) { - color[colorSpace].prototype[name] = fn; - }); - return this; + installedColorSpaces.forEach(function (colorSpace) { + color[colorSpace].prototype[name] = fn; + }); + return this; }; color.installColorSpace('RGB', ['red', 'green', 'blue', 'alpha'], { - hex: function () { - var hexString = (Math.round(255 * this._red) * 0x10000 + Math.round(255 * this._green) * 0x100 + Math.round(255 * this._blue)).toString(16); - return '#' + ('00000'.substr(0, 6 - hexString.length)) + hexString; - }, - - hexa: function () { - var alphaString = Math.round(this._alpha * 255).toString(16); - return '#' + '00'.substr(0, 2 - alphaString.length) + alphaString + this.hex().substr(1, 6); - }, - - css: function () { - return 'rgb(' + Math.round(255 * this._red) + ',' + Math.round(255 * this._green) + ',' + Math.round(255 * this._blue) + ')'; - }, - - cssa: function () { - return 'rgba(' + Math.round(255 * this._red) + ',' + Math.round(255 * this._green) + ',' + Math.round(255 * this._blue) + ',' + this._alpha + ')'; - } + hex: function () { + var hexString = ( + Math.round(255 * this._red) * 0x10000 + + Math.round(255 * this._green) * 0x100 + + Math.round(255 * this._blue) + ).toString(16); + return '#' + '00000'.substr(0, 6 - hexString.length) + hexString; + }, + + hexa: function () { + var alphaString = Math.round(this._alpha * 255).toString(16); + return ( + '#' + + '00'.substr(0, 2 - alphaString.length) + + alphaString + + this.hex().substr(1, 6) + ); + }, + + css: function () { + return ( + 'rgb(' + + Math.round(255 * this._red) + + ',' + + Math.round(255 * this._green) + + ',' + + Math.round(255 * this._blue) + + ')' + ); + }, + + cssa: function () { + return ( + 'rgba(' + + Math.round(255 * this._red) + + ',' + + Math.round(255 * this._green) + + ',' + + Math.round(255 * this._blue) + + ',' + + this._alpha + + ')' + ); + }, }); module.exports = color; diff --git a/lib/plugins/clearer.js b/lib/plugins/clearer.js index e2b571a..294a2cf 100644 --- a/lib/plugins/clearer.js +++ b/lib/plugins/clearer.js @@ -1,5 +1,5 @@ module.exports = function clearer(color) { - color.installMethod('clearer', function (amount) { - return this.alpha(isNaN(amount) ? -0.1 : -amount, true); - }); + color.installMethod('clearer', function (amount) { + return this.alpha(isNaN(amount) ? -0.1 : -amount, true); + }); }; diff --git a/lib/plugins/darken.js b/lib/plugins/darken.js index f0acfd3..5cbc10d 100644 --- a/lib/plugins/darken.js +++ b/lib/plugins/darken.js @@ -1,7 +1,7 @@ module.exports = function darken(color) { - color.use(require('../HSL')); + color.use(require('../HSL')); - color.installMethod('darken', function (amount) { - return this.lightness(isNaN(amount) ? -0.1 : -amount, true); - }); + color.installMethod('darken', function (amount) { + return this.lightness(isNaN(amount) ? -0.1 : -amount, true); + }); }; diff --git a/lib/plugins/desaturate.js b/lib/plugins/desaturate.js index 80ac649..79bb2bb 100644 --- a/lib/plugins/desaturate.js +++ b/lib/plugins/desaturate.js @@ -1,7 +1,7 @@ module.exports = function desaturate(color) { - color.use(require('../HSL')); + color.use(require('../HSL')); - color.installMethod('desaturate', function (amount) { - return this.saturation(isNaN(amount) ? -0.1 : -amount, true); - }); + color.installMethod('desaturate', function (amount) { + return this.saturation(isNaN(amount) ? -0.1 : -amount, true); + }); }; diff --git a/lib/plugins/grayscale.js b/lib/plugins/grayscale.js index 4df44bd..3717049 100644 --- a/lib/plugins/grayscale.js +++ b/lib/plugins/grayscale.js @@ -1,11 +1,11 @@ module.exports = function grayscale(color) { - function gs () { - /*jslint strict:false*/ - var rgb = this.rgb(), - val = rgb._red * 0.3 + rgb._green * 0.59 + rgb._blue * 0.11; + function gs() { + /*jslint strict:false*/ + var rgb = this.rgb(), + val = rgb._red * 0.3 + rgb._green * 0.59 + rgb._blue * 0.11; - return new color.RGB(val, val, val, rgb._alpha); - } + return new color.RGB(val, val, val, rgb._alpha); + } - color.installMethod('greyscale', gs).installMethod('grayscale', gs); + color.installMethod('greyscale', gs).installMethod('grayscale', gs); }; diff --git a/lib/plugins/isDark.js b/lib/plugins/isDark.js index c6c0289..ed679c5 100644 --- a/lib/plugins/isDark.js +++ b/lib/plugins/isDark.js @@ -1,10 +1,11 @@ module.exports = function isDark(color) { - color.installMethod('isDark', function () { var rgb = this.rgb(); // YIQ equation from http://24ways.org/2010/calculating-color-contrast - var yiq = (rgb._red * 255 * 299 + rgb._green * 255 * 587 + rgb._blue * 255 * 114) / 1000; + var yiq = + (rgb._red * 255 * 299 + rgb._green * 255 * 587 + rgb._blue * 255 * 114) / + 1000; return yiq < 128; }); }; diff --git a/lib/plugins/isLight.js b/lib/plugins/isLight.js index 8463cbe..3da1c32 100644 --- a/lib/plugins/isLight.js +++ b/lib/plugins/isLight.js @@ -1,5 +1,4 @@ module.exports = function isLight(color) { - color.use(require('./isDark')); color.installMethod('isLight', function () { diff --git a/lib/plugins/lighten.js b/lib/plugins/lighten.js index cddcab4..3ccc80d 100644 --- a/lib/plugins/lighten.js +++ b/lib/plugins/lighten.js @@ -1,7 +1,7 @@ module.exports = function lighten(color) { - color.use(require('../HSL')); + color.use(require('../HSL')); - color.installMethod('lighten', function (amount) { - return this.lightness(isNaN(amount) ? 0.1 : amount, true); - }); + color.installMethod('lighten', function (amount) { + return this.lightness(isNaN(amount) ? 0.1 : amount, true); + }); }; diff --git a/lib/plugins/luminance.js b/lib/plugins/luminance.js index ea6b4ca..4890f7c 100644 --- a/lib/plugins/luminance.js +++ b/lib/plugins/luminance.js @@ -2,11 +2,17 @@ module.exports = function luminance(color) { // http://www.w3.org/TR/WCAG20/#relativeluminancedef function channelLuminance(value) { - return (value <= 0.03928) ? value / 12.92 : Math.pow(((value + 0.055) / 1.055), 2.4); + return value <= 0.03928 + ? value / 12.92 + : Math.pow((value + 0.055) / 1.055, 2.4); } color.installMethod('luminance', function () { var rgb = this.rgb(); - return 0.2126 * channelLuminance(rgb._red) + 0.7152 * channelLuminance(rgb._green) + 0.0722 * channelLuminance(rgb._blue); + return ( + 0.2126 * channelLuminance(rgb._red) + + 0.7152 * channelLuminance(rgb._green) + + 0.0722 * channelLuminance(rgb._blue) + ); }); }; diff --git a/lib/plugins/mix.js b/lib/plugins/mix.js index 7011658..9fa9366 100644 --- a/lib/plugins/mix.js +++ b/lib/plugins/mix.js @@ -1,19 +1,19 @@ module.exports = function mix(color) { - color.installMethod('mix', function (otherColor, weight) { - otherColor = color(otherColor).rgb(); - weight = 1 - (isNaN(weight) ? 0.5 : weight); + color.installMethod('mix', function (otherColor, weight) { + otherColor = color(otherColor).rgb(); + weight = 1 - (isNaN(weight) ? 0.5 : weight); - var w = weight * 2 - 1, - a = this._alpha - otherColor._alpha, - weight1 = (((w * a === -1) ? w : (w + a) / (1 + w * a)) + 1) / 2, - weight2 = 1 - weight1, - rgb = this.rgb(); + var w = weight * 2 - 1, + a = this._alpha - otherColor._alpha, + weight1 = ((w * a === -1 ? w : (w + a) / (1 + w * a)) + 1) / 2, + weight2 = 1 - weight1, + rgb = this.rgb(); - return new color.RGB( - rgb._red * weight1 + otherColor._red * weight2, - rgb._green * weight1 + otherColor._green * weight2, - rgb._blue * weight1 + otherColor._blue * weight2, - rgb._alpha * weight + otherColor._alpha * (1 - weight) - ); - }); + return new color.RGB( + rgb._red * weight1 + otherColor._red * weight2, + rgb._green * weight1 + otherColor._green * weight2, + rgb._blue * weight1 + otherColor._blue * weight2, + rgb._alpha * weight + otherColor._alpha * (1 - weight) + ); + }); }; diff --git a/lib/plugins/namedColors.js b/lib/plugins/namedColors.js index 95e1734..88b69bf 100644 --- a/lib/plugins/namedColors.js +++ b/lib/plugins/namedColors.js @@ -1,152 +1,152 @@ module.exports = function namedColors(color) { - color.namedColors = { - aliceblue: 'f0f8ff', - antiquewhite: 'faebd7', - aqua: '0ff', - aquamarine: '7fffd4', - azure: 'f0ffff', - beige: 'f5f5dc', - bisque: 'ffe4c4', - black: '000', - blanchedalmond: 'ffebcd', - blue: '00f', - blueviolet: '8a2be2', - brown: 'a52a2a', - burlywood: 'deb887', - cadetblue: '5f9ea0', - chartreuse: '7fff00', - chocolate: 'd2691e', - coral: 'ff7f50', - cornflowerblue: '6495ed', - cornsilk: 'fff8dc', - crimson: 'dc143c', - cyan: '0ff', - darkblue: '00008b', - darkcyan: '008b8b', - darkgoldenrod: 'b8860b', - darkgray: 'a9a9a9', - darkgrey: 'a9a9a9', - darkgreen: '006400', - darkkhaki: 'bdb76b', - darkmagenta: '8b008b', - darkolivegreen: '556b2f', - darkorange: 'ff8c00', - darkorchid: '9932cc', - darkred: '8b0000', - darksalmon: 'e9967a', - darkseagreen: '8fbc8f', - darkslateblue: '483d8b', - darkslategray: '2f4f4f', - darkslategrey: '2f4f4f', - darkturquoise: '00ced1', - darkviolet: '9400d3', - deeppink: 'ff1493', - deepskyblue: '00bfff', - dimgray: '696969', - dimgrey: '696969', - dodgerblue: '1e90ff', - firebrick: 'b22222', - floralwhite: 'fffaf0', - forestgreen: '228b22', - fuchsia: 'f0f', - gainsboro: 'dcdcdc', - ghostwhite: 'f8f8ff', - gold: 'ffd700', - goldenrod: 'daa520', - gray: '808080', - grey: '808080', - green: '008000', - greenyellow: 'adff2f', - honeydew: 'f0fff0', - hotpink: 'ff69b4', - indianred: 'cd5c5c', - indigo: '4b0082', - ivory: 'fffff0', - khaki: 'f0e68c', - lavender: 'e6e6fa', - lavenderblush: 'fff0f5', - lawngreen: '7cfc00', - lemonchiffon: 'fffacd', - lightblue: 'add8e6', - lightcoral: 'f08080', - lightcyan: 'e0ffff', - lightgoldenrodyellow: 'fafad2', - lightgray: 'd3d3d3', - lightgrey: 'd3d3d3', - lightgreen: '90ee90', - lightpink: 'ffb6c1', - lightsalmon: 'ffa07a', - lightseagreen: '20b2aa', - lightskyblue: '87cefa', - lightslategray: '789', - lightslategrey: '789', - lightsteelblue: 'b0c4de', - lightyellow: 'ffffe0', - lime: '0f0', - limegreen: '32cd32', - linen: 'faf0e6', - magenta: 'f0f', - maroon: '800000', - mediumaquamarine: '66cdaa', - mediumblue: '0000cd', - mediumorchid: 'ba55d3', - mediumpurple: '9370d8', - mediumseagreen: '3cb371', - mediumslateblue: '7b68ee', - mediumspringgreen: '00fa9a', - mediumturquoise: '48d1cc', - mediumvioletred: 'c71585', - midnightblue: '191970', - mintcream: 'f5fffa', - mistyrose: 'ffe4e1', - moccasin: 'ffe4b5', - navajowhite: 'ffdead', - navy: '000080', - oldlace: 'fdf5e6', - olive: '808000', - olivedrab: '6b8e23', - orange: 'ffa500', - orangered: 'ff4500', - orchid: 'da70d6', - palegoldenrod: 'eee8aa', - palegreen: '98fb98', - paleturquoise: 'afeeee', - palevioletred: 'd87093', - papayawhip: 'ffefd5', - peachpuff: 'ffdab9', - peru: 'cd853f', - pink: 'ffc0cb', - plum: 'dda0dd', - powderblue: 'b0e0e6', - purple: '800080', - rebeccapurple: '639', - red: 'f00', - rosybrown: 'bc8f8f', - royalblue: '4169e1', - saddlebrown: '8b4513', - salmon: 'fa8072', - sandybrown: 'f4a460', - seagreen: '2e8b57', - seashell: 'fff5ee', - sienna: 'a0522d', - silver: 'c0c0c0', - skyblue: '87ceeb', - slateblue: '6a5acd', - slategray: '708090', - slategrey: '708090', - snow: 'fffafa', - springgreen: '00ff7f', - steelblue: '4682b4', - tan: 'd2b48c', - teal: '008080', - thistle: 'd8bfd8', - tomato: 'ff6347', - turquoise: '40e0d0', - violet: 'ee82ee', - wheat: 'f5deb3', - white: 'fff', - whitesmoke: 'f5f5f5', - yellow: 'ff0', - yellowgreen: '9acd32' - }; + color.namedColors = { + aliceblue: 'f0f8ff', + antiquewhite: 'faebd7', + aqua: '0ff', + aquamarine: '7fffd4', + azure: 'f0ffff', + beige: 'f5f5dc', + bisque: 'ffe4c4', + black: '000', + blanchedalmond: 'ffebcd', + blue: '00f', + blueviolet: '8a2be2', + brown: 'a52a2a', + burlywood: 'deb887', + cadetblue: '5f9ea0', + chartreuse: '7fff00', + chocolate: 'd2691e', + coral: 'ff7f50', + cornflowerblue: '6495ed', + cornsilk: 'fff8dc', + crimson: 'dc143c', + cyan: '0ff', + darkblue: '00008b', + darkcyan: '008b8b', + darkgoldenrod: 'b8860b', + darkgray: 'a9a9a9', + darkgrey: 'a9a9a9', + darkgreen: '006400', + darkkhaki: 'bdb76b', + darkmagenta: '8b008b', + darkolivegreen: '556b2f', + darkorange: 'ff8c00', + darkorchid: '9932cc', + darkred: '8b0000', + darksalmon: 'e9967a', + darkseagreen: '8fbc8f', + darkslateblue: '483d8b', + darkslategray: '2f4f4f', + darkslategrey: '2f4f4f', + darkturquoise: '00ced1', + darkviolet: '9400d3', + deeppink: 'ff1493', + deepskyblue: '00bfff', + dimgray: '696969', + dimgrey: '696969', + dodgerblue: '1e90ff', + firebrick: 'b22222', + floralwhite: 'fffaf0', + forestgreen: '228b22', + fuchsia: 'f0f', + gainsboro: 'dcdcdc', + ghostwhite: 'f8f8ff', + gold: 'ffd700', + goldenrod: 'daa520', + gray: '808080', + grey: '808080', + green: '008000', + greenyellow: 'adff2f', + honeydew: 'f0fff0', + hotpink: 'ff69b4', + indianred: 'cd5c5c', + indigo: '4b0082', + ivory: 'fffff0', + khaki: 'f0e68c', + lavender: 'e6e6fa', + lavenderblush: 'fff0f5', + lawngreen: '7cfc00', + lemonchiffon: 'fffacd', + lightblue: 'add8e6', + lightcoral: 'f08080', + lightcyan: 'e0ffff', + lightgoldenrodyellow: 'fafad2', + lightgray: 'd3d3d3', + lightgrey: 'd3d3d3', + lightgreen: '90ee90', + lightpink: 'ffb6c1', + lightsalmon: 'ffa07a', + lightseagreen: '20b2aa', + lightskyblue: '87cefa', + lightslategray: '789', + lightslategrey: '789', + lightsteelblue: 'b0c4de', + lightyellow: 'ffffe0', + lime: '0f0', + limegreen: '32cd32', + linen: 'faf0e6', + magenta: 'f0f', + maroon: '800000', + mediumaquamarine: '66cdaa', + mediumblue: '0000cd', + mediumorchid: 'ba55d3', + mediumpurple: '9370d8', + mediumseagreen: '3cb371', + mediumslateblue: '7b68ee', + mediumspringgreen: '00fa9a', + mediumturquoise: '48d1cc', + mediumvioletred: 'c71585', + midnightblue: '191970', + mintcream: 'f5fffa', + mistyrose: 'ffe4e1', + moccasin: 'ffe4b5', + navajowhite: 'ffdead', + navy: '000080', + oldlace: 'fdf5e6', + olive: '808000', + olivedrab: '6b8e23', + orange: 'ffa500', + orangered: 'ff4500', + orchid: 'da70d6', + palegoldenrod: 'eee8aa', + palegreen: '98fb98', + paleturquoise: 'afeeee', + palevioletred: 'd87093', + papayawhip: 'ffefd5', + peachpuff: 'ffdab9', + peru: 'cd853f', + pink: 'ffc0cb', + plum: 'dda0dd', + powderblue: 'b0e0e6', + purple: '800080', + rebeccapurple: '639', + red: 'f00', + rosybrown: 'bc8f8f', + royalblue: '4169e1', + saddlebrown: '8b4513', + salmon: 'fa8072', + sandybrown: 'f4a460', + seagreen: '2e8b57', + seashell: 'fff5ee', + sienna: 'a0522d', + silver: 'c0c0c0', + skyblue: '87ceeb', + slateblue: '6a5acd', + slategray: '708090', + slategrey: '708090', + snow: 'fffafa', + springgreen: '00ff7f', + steelblue: '4682b4', + tan: 'd2b48c', + teal: '008080', + thistle: 'd8bfd8', + tomato: 'ff6347', + turquoise: '40e0d0', + violet: 'ee82ee', + wheat: 'f5deb3', + white: 'fff', + whitesmoke: 'f5f5f5', + yellow: 'ff0', + yellowgreen: '9acd32', + }; }; diff --git a/lib/plugins/negate.js b/lib/plugins/negate.js index 8c3eef4..1bdf658 100644 --- a/lib/plugins/negate.js +++ b/lib/plugins/negate.js @@ -1,6 +1,11 @@ module.exports = function negate(color) { - color.installMethod('negate', function () { - var rgb = this.rgb(); - return new color.RGB(1 - rgb._red, 1 - rgb._green, 1 - rgb._blue, this._alpha); - }); + color.installMethod('negate', function () { + var rgb = this.rgb(); + return new color.RGB( + 1 - rgb._red, + 1 - rgb._green, + 1 - rgb._blue, + this._alpha + ); + }); }; diff --git a/lib/plugins/opaquer.js b/lib/plugins/opaquer.js index 1caa8db..d2d4e37 100644 --- a/lib/plugins/opaquer.js +++ b/lib/plugins/opaquer.js @@ -1,5 +1,5 @@ module.exports = function opaquer(color) { - color.installMethod('opaquer', function (amount) { - return this.alpha(isNaN(amount) ? 0.1 : amount, true); - }); + color.installMethod('opaquer', function (amount) { + return this.alpha(isNaN(amount) ? 0.1 : amount, true); + }); }; diff --git a/lib/plugins/rotate.js b/lib/plugins/rotate.js index 2c74a99..543b38c 100644 --- a/lib/plugins/rotate.js +++ b/lib/plugins/rotate.js @@ -1,7 +1,7 @@ module.exports = function rotate(color) { - color.use(require('../HSL')); + color.use(require('../HSL')); - color.installMethod('rotate', function (degrees) { - return this.hue((degrees || 0) / 360, true); - }); + color.installMethod('rotate', function (degrees) { + return this.hue((degrees || 0) / 360, true); + }); }; diff --git a/lib/plugins/saturate.js b/lib/plugins/saturate.js index a9ad5c6..0d2d99f 100644 --- a/lib/plugins/saturate.js +++ b/lib/plugins/saturate.js @@ -1,7 +1,7 @@ module.exports = function saturate(color) { - color.use(require('../HSL')); + color.use(require('../HSL')); - color.installMethod('saturate', function (amount) { - return this.saturation(isNaN(amount) ? 0.1 : amount, true); - }); + color.installMethod('saturate', function (amount) { + return this.saturation(isNaN(amount) ? 0.1 : amount, true); + }); }; diff --git a/lib/plugins/toAlpha.js b/lib/plugins/toAlpha.js index e52047c..a8c08c1 100644 --- a/lib/plugins/toAlpha.js +++ b/lib/plugins/toAlpha.js @@ -1,46 +1,46 @@ // Adapted from http://gimp.sourcearchive.com/documentation/2.6.6-1ubuntu1/color-to-alpha_8c-source.html // toAlpha returns a color where the values of the argument have been converted to alpha module.exports = function toAlpha(color) { - color.installMethod('toAlpha', function (color) { - var me = this.rgb(), - other = color(color).rgb(), - epsilon = 1e-10, - a = new color.RGB(0, 0, 0, me._alpha), - channels = ['_red', '_green', '_blue']; + color.installMethod('toAlpha', function (color) { + var me = this.rgb(), + other = color(color).rgb(), + epsilon = 1e-10, + a = new color.RGB(0, 0, 0, me._alpha), + channels = ['_red', '_green', '_blue']; - channels.forEach(function (channel) { - if (me[channel] < epsilon) { - a[channel] = me[channel]; - } else if (me[channel] > other[channel]) { - a[channel] = (me[channel] - other[channel]) / (1 - other[channel]); - } else if (me[channel] > other[channel]) { - a[channel] = (other[channel] - me[channel]) / other[channel]; - } else { - a[channel] = 0; - } - }); - - if (a._red > a._green) { - if (a._red > a._blue) { - me._alpha = a._red; - } else { - me._alpha = a._blue; - } - } else if (a._green > a._blue) { - me._alpha = a._green; - } else { - me._alpha = a._blue; - } + channels.forEach(function (channel) { + if (me[channel] < epsilon) { + a[channel] = me[channel]; + } else if (me[channel] > other[channel]) { + a[channel] = (me[channel] - other[channel]) / (1 - other[channel]); + } else if (me[channel] > other[channel]) { + a[channel] = (other[channel] - me[channel]) / other[channel]; + } else { + a[channel] = 0; + } + }); - if (me._alpha < epsilon) { - return me; - } + if (a._red > a._green) { + if (a._red > a._blue) { + me._alpha = a._red; + } else { + me._alpha = a._blue; + } + } else if (a._green > a._blue) { + me._alpha = a._green; + } else { + me._alpha = a._blue; + } - channels.forEach(function (channel) { - me[channel] = (me[channel] - other[channel]) / me._alpha + other[channel]; - }); - me._alpha *= a._alpha; + if (me._alpha < epsilon) { + return me; + } - return me; + channels.forEach(function (channel) { + me[channel] = (me[channel] - other[channel]) / me._alpha + other[channel]; }); + me._alpha *= a._alpha; + + return me; + }); }; diff --git a/minimal.js b/minimal.js index dfd8b7a..f3b0226 100644 --- a/minimal.js +++ b/minimal.js @@ -1,3 +1,3 @@ module.exports = require('./lib/color') - .use(require('./lib/HSV')) - .use(require('./lib/HSL')); + .use(require('./lib/HSV')) + .use(require('./lib/HSL')); diff --git a/rollup.config.js b/rollup.config.js index 237aa63..f65206a 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -8,7 +8,5 @@ module.exports = { sourceMap: true, - plugins: [ - commonjs() - ] + plugins: [commonjs()], }; diff --git a/test/color.js b/test/color.js index 2b2d611..8b66cac 100644 --- a/test/color.js +++ b/test/color.js @@ -1,208 +1,269 @@ var expect = require('unexpected'); var libs = [ - { - name: 'index.js', - lib: require('../') - } + { + name: 'index.js', + lib: require('../'), + }, ]; if (process.env.TEST_BUNDLES) { - libs.push({ - name: 'Bundle: one-color-all.js', - lib: require('../one-color-all') - }); + libs.push({ + name: 'Bundle: one-color-all.js', + lib: require('../one-color-all'), + }); } - var namedColorSamples = require('./samples'); var spaces = [ - { - name: 'RGB', - channels: ['red', 'green', 'blue', 'alpha'] - }, - { - name: 'HSV', - channels: ['hue', 'saturation', 'value', 'alpha'] - }, - { - name: 'HSL', - channels: ['hue', 'saturation', 'lightness', 'alpha'] - }, - { - name: 'CMYK', - channels: ['cyan', 'magenta', 'yellow', 'black', 'alpha'] - } - // { - // name: 'XYZ', - // channels: ['x', 'y', 'z', 'alpha'] - // }, - // { - // name: 'LAB', - // channels: ['l', 'a', 'b', 'alpha'] - // } + { + name: 'RGB', + channels: ['red', 'green', 'blue', 'alpha'], + }, + { + name: 'HSV', + channels: ['hue', 'saturation', 'value', 'alpha'], + }, + { + name: 'HSL', + channels: ['hue', 'saturation', 'lightness', 'alpha'], + }, + { + name: 'CMYK', + channels: ['cyan', 'magenta', 'yellow', 'black', 'alpha'], + }, + // { + // name: 'XYZ', + // channels: ['x', 'y', 'z', 'alpha'] + // }, + // { + // name: 'LAB', + // channels: ['l', 'a', 'b', 'alpha'] + // } ]; function testLib(libConfig) { - var color = libConfig.lib; + var color = libConfig.lib; + + describe(libConfig.name, function () { + describe('Named colors', function () { + Object.keys(namedColorSamples).forEach(function (namedColor) { + var hex = namedColorSamples[namedColor].toLowerCase(); + it('should parse ' + namedColor + ' as ' + hex, function () { + return expect(color(namedColor).hex(), 'to be', hex); + }); + }); + }); - describe(libConfig.name, function () { + spaces.forEach(function (colorSpace) { + describe(colorSpace.name, function () { + var spaceName = colorSpace.name; - describe('Named colors', function () { - Object.keys(namedColorSamples).forEach(function (namedColor) { - var hex = namedColorSamples[namedColor].toLowerCase(); - it('should parse ' + namedColor + ' as ' + hex, function () { - return expect(color(namedColor).hex(), 'to be', hex); - }); - }); + it('should have a constructor function', function () { + expect(color[spaceName], 'to be a function'); }); - spaces.forEach(function (colorSpace) { - describe(colorSpace.name, function () { - var spaceName = colorSpace.name; - - it('should have a constructor function', function () { - expect(color[spaceName], 'to be a function'); - }); + var clr = + colorSpace.name === 'CMYK' + ? new color[spaceName](1, 1, 1, 1, 1) + : new color[spaceName](0, 0, 0, 1); - var clr = colorSpace.name === 'CMYK' ? new color[spaceName](1, 1, 1, 1, 1) : new color[spaceName](0, 0, 0, 1); + it('should be constructed correctly', function () { + expect(clr, 'to satisfy', { + isColor: true, + }); + }); - it('should be constructed correctly', function () { - expect(clr, 'to satisfy', { - isColor: true - }); - }); - - describe('color space conversion', function () { - spaces.forEach(function (otherSpace) { - - it('should have a ' + otherSpace.name + ' conversion method', function () { - var expected = {}; - - expected[otherSpace.name.toLowerCase()] = expect.it('to be a function'); - - expect(clr, 'to satisfy', expected); - }); - - it('should convert to ' + otherSpace.name, function () { - var expected = { - isColor: true - }; - - otherSpace.channels.forEach(function (channelName) { - expected['_' + channelName] = expect.it('to be a number'); - }); - - expect(clr[otherSpace.name.toLowerCase()](), 'to satisfy', expected); - - // Awaiting unexpected patch - // expect(clr[otherSpace.name.toLowerCase()](), 'to exhaustively satisfy', expected); - }); - }); - }); - - describe('equality', function () { - it('should have an equals method', function () { - expect(clr, 'to satisfy', { - equals: expect.it('to be a function').and('to have arity', 2) - }); - }); - - spaces.forEach(function (otherSpace) { - it('should equal same color in ' + otherSpace.name, function () { - if (otherSpace.name === 'CMYK') { - expect(clr.equals(new color[otherSpace.name](1, 1, 1, 1, 1)), 'to be true'); - } else { - expect(clr.equals(new color[otherSpace.name](0, 0, 0, 1)), 'to be true'); - } - }); - }); - }); - - it('should convert to JSON', function () { - var clr = new color[colorSpace.name](Math.random(), Math.random(), Math.random(), Math.random(), Math.random()); - - expect(clr.equals(color(clr.toJSON())), 'to be true'); - }); - - describe('color channels', function () { - colorSpace.channels.forEach(function (channel) { - var shortHand = channel === 'black' ? 'k' : channel.charAt(0); - - describe(channel, function () { - it('should have a "' + channel + '" method', function () { - var expected = {}; - - expected[channel] = expect.it('to be a function').and('to have arity', 2); - - expect(clr, 'to satisfy', expected); - }); - - it('should have a "' + shortHand + '" shorthand method', function () { - var expected = {}; - - expected[shortHand] = expect.it('to be a function').and('to have arity', 2); - - expect(clr, 'to satisfy', expected); - }); - - it('should get the "' + channel + '" value', function () { - expect(new color[colorSpace.name](0, 0, 0, 0, 0)[channel](), 'to be', 0); - }); - - it('should get the "' + channel + '" shorthand "' + shortHand + '" value', function () { - expect(new color[colorSpace.name](0, 0, 0, 0, 0)[channel](), 'to be', 0); - }); - - it('should set the "' + channel + '" value', function () { - expect(clr[channel](0)[channel](), 'to be', 0); - expect(clr[channel](0.5)[channel](), 'to be', 0.5); - - if (channel === 'hue') { - // Hue is considered a circle, and thus has periodic boundary conditions - expect(clr[channel](1)[channel](), 'to be', 0); - expect(clr[channel](-0.1)[channel](), 'to be', 0.9); - expect(clr[channel](1.5)[channel](), 'to be', 0.5); - } else { - expect(clr[channel](1)[channel](), 'to be', 1); - expect(clr[channel](-0.1)[channel](), 'to be', 0); - expect(clr[channel](1.1)[channel](), 'to be', 1); - } - }); - - it('should set the "' + channel + '" shorthand "' + shortHand + '" value', function () { - expect(clr[shortHand](0)[channel](), 'to be', 0); - expect(clr[shortHand](0.5)[channel](), 'to be', 0.5); - - if (channel === 'hue') { - // Hue is considered a circle, and thus has periodic boundary conditions - expect(clr[shortHand](1)[channel](), 'to be', 0); - expect(clr[shortHand](-0.1)[channel](), 'to be', 0.9); - expect(clr[shortHand](1.5)[channel](), 'to be', 0.5); - } else { - expect(clr[shortHand](1)[channel](), 'to be', 1); - expect(clr[shortHand](-0.1)[channel](), 'to be', 0); - expect(clr[shortHand](1.1)[channel](), 'to be', 1); - } - }); - - it('should adjust the "' + channel + '" value', function () { - expect(clr[channel](0)[channel](0.5, true)[channel](), 'to be', 0.5); - }); - - it('should adjust the "' + channel + '", shorthand "' + shortHand + '" value', function () { - expect(clr[channel](0)[shortHand](0.5, true)[channel](), 'to be', 0.5); - }); - }); - - }); - }); + describe('color space conversion', function () { + spaces.forEach(function (otherSpace) { + it( + 'should have a ' + otherSpace.name + ' conversion method', + function () { + var expected = {}; + + expected[otherSpace.name.toLowerCase()] = expect.it( + 'to be a function' + ); + + expect(clr, 'to satisfy', expected); + } + ); + + it('should convert to ' + otherSpace.name, function () { + var expected = { + isColor: true, + }; + + otherSpace.channels.forEach(function (channelName) { + expected['_' + channelName] = expect.it('to be a number'); + }); + + expect( + clr[otherSpace.name.toLowerCase()](), + 'to satisfy', + expected + ); + + // Awaiting unexpected patch + // expect(clr[otherSpace.name.toLowerCase()](), 'to exhaustively satisfy', expected); + }); + }); + }); + describe('equality', function () { + it('should have an equals method', function () { + expect(clr, 'to satisfy', { + equals: expect.it('to be a function').and('to have arity', 2), + }); + }); + + spaces.forEach(function (otherSpace) { + it('should equal same color in ' + otherSpace.name, function () { + if (otherSpace.name === 'CMYK') { + expect( + clr.equals(new color[otherSpace.name](1, 1, 1, 1, 1)), + 'to be true' + ); + } else { + expect( + clr.equals(new color[otherSpace.name](0, 0, 0, 1)), + 'to be true' + ); + } }); + }); }); - }); + it('should convert to JSON', function () { + var clr = new color[colorSpace.name]( + Math.random(), + Math.random(), + Math.random(), + Math.random(), + Math.random() + ); + + expect(clr.equals(color(clr.toJSON())), 'to be true'); + }); + describe('color channels', function () { + colorSpace.channels.forEach(function (channel) { + var shortHand = channel === 'black' ? 'k' : channel.charAt(0); + + describe(channel, function () { + it('should have a "' + channel + '" method', function () { + var expected = {}; + + expected[channel] = expect + .it('to be a function') + .and('to have arity', 2); + + expect(clr, 'to satisfy', expected); + }); + + it( + 'should have a "' + shortHand + '" shorthand method', + function () { + var expected = {}; + + expected[shortHand] = expect + .it('to be a function') + .and('to have arity', 2); + + expect(clr, 'to satisfy', expected); + } + ); + + it('should get the "' + channel + '" value', function () { + expect( + new color[colorSpace.name](0, 0, 0, 0, 0)[channel](), + 'to be', + 0 + ); + }); + + it( + 'should get the "' + + channel + + '" shorthand "' + + shortHand + + '" value', + function () { + expect( + new color[colorSpace.name](0, 0, 0, 0, 0)[channel](), + 'to be', + 0 + ); + } + ); + + it('should set the "' + channel + '" value', function () { + expect(clr[channel](0)[channel](), 'to be', 0); + expect(clr[channel](0.5)[channel](), 'to be', 0.5); + + if (channel === 'hue') { + // Hue is considered a circle, and thus has periodic boundary conditions + expect(clr[channel](1)[channel](), 'to be', 0); + expect(clr[channel](-0.1)[channel](), 'to be', 0.9); + expect(clr[channel](1.5)[channel](), 'to be', 0.5); + } else { + expect(clr[channel](1)[channel](), 'to be', 1); + expect(clr[channel](-0.1)[channel](), 'to be', 0); + expect(clr[channel](1.1)[channel](), 'to be', 1); + } + }); + + it( + 'should set the "' + + channel + + '" shorthand "' + + shortHand + + '" value', + function () { + expect(clr[shortHand](0)[channel](), 'to be', 0); + expect(clr[shortHand](0.5)[channel](), 'to be', 0.5); + + if (channel === 'hue') { + // Hue is considered a circle, and thus has periodic boundary conditions + expect(clr[shortHand](1)[channel](), 'to be', 0); + expect(clr[shortHand](-0.1)[channel](), 'to be', 0.9); + expect(clr[shortHand](1.5)[channel](), 'to be', 0.5); + } else { + expect(clr[shortHand](1)[channel](), 'to be', 1); + expect(clr[shortHand](-0.1)[channel](), 'to be', 0); + expect(clr[shortHand](1.1)[channel](), 'to be', 1); + } + } + ); + + it('should adjust the "' + channel + '" value', function () { + expect( + clr[channel](0)[channel](0.5, true)[channel](), + 'to be', + 0.5 + ); + }); + + it( + 'should adjust the "' + + channel + + '", shorthand "' + + shortHand + + '" value', + function () { + expect( + clr[channel](0)[shortHand](0.5, true)[channel](), + 'to be', + 0.5 + ); + } + ); + }); + }); + }); + }); + }); + }); } libs.forEach(testLib); diff --git a/test/contrast.js b/test/contrast.js index 634dffb..7c2525d 100644 --- a/test/contrast.js +++ b/test/contrast.js @@ -3,16 +3,16 @@ var color = require('../'); var expect = require('unexpected').clone(); function contrast(color1, color2) { - var contrast = color(color1).contrast(color(color2)); - return Math.round(contrast * 100) / 100; + var contrast = color(color1).contrast(color(color2)); + return Math.round(contrast * 100) / 100; } describe('contrast', function () { - it('should return the contrast for colors', function () { - expect(contrast('white', 'black'), 'to equal', 21); - expect(contrast('white', 'red'), 'to equal', 4); - expect(contrast('red', 'white'), 'to equal', 4); - expect(contrast('005aff', 'eeeeee'), 'to equal', 4.63); - expect(contrast('blue', 'blue'), 'to equal', 1); - }); + it('should return the contrast for colors', function () { + expect(contrast('white', 'black'), 'to equal', 21); + expect(contrast('white', 'red'), 'to equal', 4); + expect(contrast('red', 'white'), 'to equal', 4); + expect(contrast('005aff', 'eeeeee'), 'to equal', 4.63); + expect(contrast('blue', 'blue'), 'to equal', 1); + }); }); diff --git a/test/conversion.js b/test/conversion.js index 699bf76..3e9cb22 100644 --- a/test/conversion.js +++ b/test/conversion.js @@ -1,22 +1,17 @@ var expect = require('unexpected'); var namedColorSamples = require('./samples'); var color = require('../'); -var spaces = [ - 'rgb', - 'hsl', - 'hsv', - 'cmyk' -]; +var spaces = ['rgb', 'hsl', 'hsv', 'cmyk']; describe('conversion', function () { - Object.keys(namedColorSamples).forEach(function (namedColor) { - describe('with named color sample ' + namedColor, function () { - var instance = color(namedColorSamples[namedColor]); - spaces.forEach(function (space) { - it('should convert to ' + space, function () { - expect(instance[space]().hex(), 'to equal', instance.hex()); - }); - }); + Object.keys(namedColorSamples).forEach(function (namedColor) { + describe('with named color sample ' + namedColor, function () { + var instance = color(namedColorSamples[namedColor]); + spaces.forEach(function (space) { + it('should convert to ' + space, function () { + expect(instance[space]().hex(), 'to equal', instance.hex()); }); + }); }); + }); }); diff --git a/test/grayscale.js b/test/grayscale.js index 53b8807..865a3d3 100644 --- a/test/grayscale.js +++ b/test/grayscale.js @@ -3,7 +3,7 @@ var color = require('../'); var expect = require('unexpected').clone(); describe('grayscale', function () { - it('should convert a non-gray to a shade of gray', function () { - expect(color('#550022').grayscale().hex(), 'to equal', '#1d1d1d'); - }); + it('should convert a non-gray to a shade of gray', function () { + expect(color('#550022').grayscale().hex(), 'to equal', '#1d1d1d'); + }); }); diff --git a/test/isDark.js b/test/isDark.js index dfb4b2a..b79ac59 100644 --- a/test/isDark.js +++ b/test/isDark.js @@ -3,13 +3,13 @@ var color = require('../'); var expect = require('unexpected').clone(); describe('isDark', function () { - it('should return true, if the color is dark', function () { - expect(color('black').isDark(), 'to equal', true); - expect(color('white').isDark(), 'to equal', false); - expect(color('blue').isDark(), 'to equal', true); - expect(color('darkgreen').isDark(), 'to equal', true); - expect(color('pink').isDark(), 'to equal', false); - expect(color('goldenrod').isDark(), 'to equal', false); - expect(color('red').isDark(), 'to equal', true); - }); + it('should return true, if the color is dark', function () { + expect(color('black').isDark(), 'to equal', true); + expect(color('white').isDark(), 'to equal', false); + expect(color('blue').isDark(), 'to equal', true); + expect(color('darkgreen').isDark(), 'to equal', true); + expect(color('pink').isDark(), 'to equal', false); + expect(color('goldenrod').isDark(), 'to equal', false); + expect(color('red').isDark(), 'to equal', true); + }); }); diff --git a/test/isLight.js b/test/isLight.js index ace581d..6b12237 100644 --- a/test/isLight.js +++ b/test/isLight.js @@ -3,13 +3,13 @@ var color = require('../'); var expect = require('unexpected').clone(); describe('isLight', function () { - it('should return true, if the color is light', function () { - expect(color('black').isLight(), 'to equal', false); - expect(color('white').isLight(), 'to equal', true); - expect(color('blue').isLight(), 'to equal', false); - expect(color('darkgreen').isLight(), 'to equal', false); - expect(color('pink').isLight(), 'to equal', true); - expect(color('goldenrod').isLight(), 'to equal', true); - expect(color('red').isLight(), 'to equal', false); - }); + it('should return true, if the color is light', function () { + expect(color('black').isLight(), 'to equal', false); + expect(color('white').isLight(), 'to equal', true); + expect(color('blue').isLight(), 'to equal', false); + expect(color('darkgreen').isLight(), 'to equal', false); + expect(color('pink').isLight(), 'to equal', true); + expect(color('goldenrod').isLight(), 'to equal', true); + expect(color('red').isLight(), 'to equal', false); + }); }); diff --git a/test/luminance.js b/test/luminance.js index a287ba1..470aa01 100644 --- a/test/luminance.js +++ b/test/luminance.js @@ -3,11 +3,11 @@ var color = require('../'); var expect = require('unexpected').clone(); describe('luminance', function () { - it('should return the luminance for colors', function () { - expect(color('white').luminance(), 'to equal', 1); - expect(color('black').luminance(), 'to equal', 0); - expect(color('ff0000').luminance(), 'to equal', 0.2126); - expect(color('00ff00').luminance(), 'to equal', 0.7152); - expect(color('0000ff').luminance(), 'to equal', 0.0722); - }); + it('should return the luminance for colors', function () { + expect(color('white').luminance(), 'to equal', 1); + expect(color('black').luminance(), 'to equal', 0); + expect(color('ff0000').luminance(), 'to equal', 0.2126); + expect(color('00ff00').luminance(), 'to equal', 0.7152); + expect(color('0000ff').luminance(), 'to equal', 0.0722); + }); }); diff --git a/test/mix.js b/test/mix.js index 6d915d8..e63b32e 100644 --- a/test/mix.js +++ b/test/mix.js @@ -3,7 +3,7 @@ var color = require('../'); var expect = require('unexpected').clone(); describe('mix', function () { - it('black and white 50% mix should be gray', function () { - expect(color('white').mix('black').hex(), 'to equal', '#808080'); - }); + it('black and white 50% mix should be gray', function () { + expect(color('white').mix('black').hex(), 'to equal', '#808080'); + }); }); diff --git a/test/parse.js b/test/parse.js index 42f7018..d5305f2 100644 --- a/test/parse.js +++ b/test/parse.js @@ -1,51 +1,56 @@ var color = require('../'); var expect = require('unexpected').clone(); -expect.addAssertion(' to be a color instance', function (expect, subject) { - expect(subject, 'to satisfy', { isColor: true }); +expect.addAssertion(' to be a color instance', function ( + expect, + subject +) { + expect(subject, 'to satisfy', { isColor: true }); }); - describe('parsing', function () { - describe('when parsing cmyk example from https://github.com/One-com/one-color/issues/25', function () { - expect(color('cmyk(1.95468%,3.82086%,5.06294%,11.3802%)'), 'to be a color instance'); + describe('when parsing cmyk example from https://github.com/One-com/one-color/issues/25', function () { + expect( + color('cmyk(1.95468%,3.82086%,5.06294%,11.3802%)'), + 'to be a color instance' + ); + }); + + describe('when parsing white cmyk', function () { + var instance = color('cmyk(0%,0%,0%,0%)'); + + it('should return a color instance', function () { + expect(instance, 'to be a color instance'); }); - describe('when parsing white cmyk', function () { - var instance = color('cmyk(0%,0%,0%,0%)'); - - it('should return a color instance', function () { - expect(instance, 'to be a color instance'); - }); - - it('should be white', function () { - expect(instance.hex(), 'to equal', '#ffffff'); - }); + it('should be white', function () { + expect(instance.hex(), 'to equal', '#ffffff'); }); + }); - describe('when parsing black cmyk', function () { - var instance = color('cmyk(100%,100%,100%,100%)'); + describe('when parsing black cmyk', function () { + var instance = color('cmyk(100%,100%,100%,100%)'); - it('should return a color instance', function () { - expect(instance, 'to be a color instance'); - }); + it('should return a color instance', function () { + expect(instance, 'to be a color instance'); + }); - it('should be black', function () { - expect(instance.hex(), 'to equal', '#000000'); - }); + it('should be black', function () { + expect(instance.hex(), 'to equal', '#000000'); }); + }); - describe('with invalid strings', function () { - it('should refuse a percentage > 100', function () { - expect(color('cmyk(100.1%,100%,100%,100%)'), 'to be false'); - }); + describe('with invalid strings', function () { + it('should refuse a percentage > 100', function () { + expect(color('cmyk(100.1%,100%,100%,100%)'), 'to be false'); + }); - it('should refuse to parse a non-percentage', function () { - expect(color('cmyk(100,100%,100%,100%)'), 'to be false'); - }); + it('should refuse to parse a non-percentage', function () { + expect(color('cmyk(100,100%,100%,100%)'), 'to be false'); + }); - it('should refuse to parse less than 4 channels', function () { - expect(color('cmyk(100,100%,100%)'), 'to be false'); - }); + it('should refuse to parse less than 4 channels', function () { + expect(color('cmyk(100,100%,100%)'), 'to be false'); }); + }); }); diff --git a/test/samples.js b/test/samples.js index 109c7be..7f5a32e 100644 --- a/test/samples.js +++ b/test/samples.js @@ -1,147 +1,147 @@ module.exports = { - AliceBlue: '#F0F8FF', - AntiqueWhite: '#FAEBD7', - Aqua: '#00FFFF', - Aquamarine: '#7FFFD4', - Azure: '#F0FFFF', - Beige: '#F5F5DC', - Bisque: '#FFE4C4', - Black: '#000000', - BlanchedAlmond: '#FFEBCD', - Blue: '#0000FF', - BlueViolet: '#8A2BE2', - Brown: '#A52A2A', - BurlyWood: '#DEB887', - CadetBlue: '#5F9EA0', - Chartreuse: '#7FFF00', - Chocolate: '#D2691E', - Coral: '#FF7F50', - CornflowerBlue: '#6495ED', - Cornsilk: '#FFF8DC', - Crimson: '#DC143C', - Cyan: '#00FFFF', - DarkBlue: '#00008B', - DarkCyan: '#008B8B', - DarkGoldenRod: '#B8860B', - DarkGray: '#A9A9A9', - DarkGrey: '#A9A9A9', - DarkGreen: '#006400', - DarkKhaki: '#BDB76B', - DarkMagenta: '#8B008B', - DarkOliveGreen: '#556B2F', - Darkorange: '#FF8C00', - DarkOrchid: '#9932CC', - DarkRed: '#8B0000', - DarkSalmon: '#E9967A', - DarkSeaGreen: '#8FBC8F', - DarkSlateBlue: '#483D8B', - DarkSlateGray: '#2F4F4F', - DarkSlateGrey: '#2F4F4F', - DarkTurquoise: '#00CED1', - DarkViolet: '#9400D3', - DeepPink: '#FF1493', - DeepSkyBlue: '#00BFFF', - DimGray: '#696969', - DimGrey: '#696969', - DodgerBlue: '#1E90FF', - FireBrick: '#B22222', - FloralWhite: '#FFFAF0', - ForestGreen: '#228B22', - Fuchsia: '#FF00FF', - Gainsboro: '#DCDCDC', - GhostWhite: '#F8F8FF', - Gold: '#FFD700', - GoldenRod: '#DAA520', - Gray: '#808080', - Grey: '#808080', - Green: '#008000', - GreenYellow: '#ADFF2F', - HoneyDew: '#F0FFF0', - HotPink: '#FF69B4', - Ivory: '#FFFFF0', - Khaki: '#F0E68C', - Lavender: '#E6E6FA', - LavenderBlush: '#FFF0F5', - LawnGreen: '#7CFC00', - LemonChiffon: '#FFFACD', - LightBlue: '#ADD8E6', - LightCoral: '#F08080', - LightCyan: '#E0FFFF', - LightGoldenRodYellow: '#FAFAD2', - LightGray: '#D3D3D3', - LightGrey: '#D3D3D3', - LightGreen: '#90EE90', - LightPink: '#FFB6C1', - LightSalmon: '#FFA07A', - LightSeaGreen: '#20B2AA', - LightSkyBlue: '#87CEFA', - LightSlateGray: '#778899', - LightSlateGrey: '#778899', - LightSteelBlue: '#B0C4DE', - LightYellow: '#FFFFE0', - Lime: '#00FF00', - LimeGreen: '#32CD32', - Linen: '#FAF0E6', - Magenta: '#FF00FF', - Maroon: '#800000', - MediumAquaMarine: '#66CDAA', - MediumBlue: '#0000CD', - MediumOrchid: '#BA55D3', - MediumPurple: '#9370D8', - MediumSeaGreen: '#3CB371', - MediumSlateBlue: '#7B68EE', - MediumSpringGreen: '#00FA9A', - MediumTurquoise: '#48D1CC', - MediumVioletRed: '#C71585', - MidnightBlue: '#191970', - MintCream: '#F5FFFA', - MistyRose: '#FFE4E1', - Moccasin: '#FFE4B5', - NavajoWhite: '#FFDEAD', - Navy: '#000080', - OldLace: '#FDF5E6', - Olive: '#808000', - OliveDrab: '#6B8E23', - Orange: '#FFA500', - OrangeRed: '#FF4500', - Orchid: '#DA70D6', - PaleGoldenRod: '#EEE8AA', - PaleGreen: '#98FB98', - PaleTurquoise: '#AFEEEE', - PaleVioletRed: '#D87093', - PapayaWhip: '#FFEFD5', - PeachPuff: '#FFDAB9', - Peru: '#CD853F', - Pink: '#FFC0CB', - Plum: '#DDA0DD', - PowderBlue: '#B0E0E6', - Purple: '#800080', - Red: '#FF0000', - RosyBrown: '#BC8F8F', - RoyalBlue: '#4169E1', - SaddleBrown: '#8B4513', - Salmon: '#FA8072', - SandyBrown: '#F4A460', - SeaGreen: '#2E8B57', - SeaShell: '#FFF5EE', - Sienna: '#A0522D', - Silver: '#C0C0C0', - SkyBlue: '#87CEEB', - SlateBlue: '#6A5ACD', - SlateGray: '#708090', - SlateGrey: '#708090', - Snow: '#FFFAFA', - SpringGreen: '#00FF7F', - SteelBlue: '#4682B4', - Tan: '#D2B48C', - Teal: '#008080', - Thistle: '#D8BFD8', - Tomato: '#FF6347', - Turquoise: '#40E0D0', - Violet: '#EE82EE', - Wheat: '#F5DEB3', - White: '#FFFFFF', - WhiteSmoke: '#F5F5F5', - Yellow: '#FFFF00', - YellowGreen: '#9ACD32' + AliceBlue: '#F0F8FF', + AntiqueWhite: '#FAEBD7', + Aqua: '#00FFFF', + Aquamarine: '#7FFFD4', + Azure: '#F0FFFF', + Beige: '#F5F5DC', + Bisque: '#FFE4C4', + Black: '#000000', + BlanchedAlmond: '#FFEBCD', + Blue: '#0000FF', + BlueViolet: '#8A2BE2', + Brown: '#A52A2A', + BurlyWood: '#DEB887', + CadetBlue: '#5F9EA0', + Chartreuse: '#7FFF00', + Chocolate: '#D2691E', + Coral: '#FF7F50', + CornflowerBlue: '#6495ED', + Cornsilk: '#FFF8DC', + Crimson: '#DC143C', + Cyan: '#00FFFF', + DarkBlue: '#00008B', + DarkCyan: '#008B8B', + DarkGoldenRod: '#B8860B', + DarkGray: '#A9A9A9', + DarkGrey: '#A9A9A9', + DarkGreen: '#006400', + DarkKhaki: '#BDB76B', + DarkMagenta: '#8B008B', + DarkOliveGreen: '#556B2F', + Darkorange: '#FF8C00', + DarkOrchid: '#9932CC', + DarkRed: '#8B0000', + DarkSalmon: '#E9967A', + DarkSeaGreen: '#8FBC8F', + DarkSlateBlue: '#483D8B', + DarkSlateGray: '#2F4F4F', + DarkSlateGrey: '#2F4F4F', + DarkTurquoise: '#00CED1', + DarkViolet: '#9400D3', + DeepPink: '#FF1493', + DeepSkyBlue: '#00BFFF', + DimGray: '#696969', + DimGrey: '#696969', + DodgerBlue: '#1E90FF', + FireBrick: '#B22222', + FloralWhite: '#FFFAF0', + ForestGreen: '#228B22', + Fuchsia: '#FF00FF', + Gainsboro: '#DCDCDC', + GhostWhite: '#F8F8FF', + Gold: '#FFD700', + GoldenRod: '#DAA520', + Gray: '#808080', + Grey: '#808080', + Green: '#008000', + GreenYellow: '#ADFF2F', + HoneyDew: '#F0FFF0', + HotPink: '#FF69B4', + Ivory: '#FFFFF0', + Khaki: '#F0E68C', + Lavender: '#E6E6FA', + LavenderBlush: '#FFF0F5', + LawnGreen: '#7CFC00', + LemonChiffon: '#FFFACD', + LightBlue: '#ADD8E6', + LightCoral: '#F08080', + LightCyan: '#E0FFFF', + LightGoldenRodYellow: '#FAFAD2', + LightGray: '#D3D3D3', + LightGrey: '#D3D3D3', + LightGreen: '#90EE90', + LightPink: '#FFB6C1', + LightSalmon: '#FFA07A', + LightSeaGreen: '#20B2AA', + LightSkyBlue: '#87CEFA', + LightSlateGray: '#778899', + LightSlateGrey: '#778899', + LightSteelBlue: '#B0C4DE', + LightYellow: '#FFFFE0', + Lime: '#00FF00', + LimeGreen: '#32CD32', + Linen: '#FAF0E6', + Magenta: '#FF00FF', + Maroon: '#800000', + MediumAquaMarine: '#66CDAA', + MediumBlue: '#0000CD', + MediumOrchid: '#BA55D3', + MediumPurple: '#9370D8', + MediumSeaGreen: '#3CB371', + MediumSlateBlue: '#7B68EE', + MediumSpringGreen: '#00FA9A', + MediumTurquoise: '#48D1CC', + MediumVioletRed: '#C71585', + MidnightBlue: '#191970', + MintCream: '#F5FFFA', + MistyRose: '#FFE4E1', + Moccasin: '#FFE4B5', + NavajoWhite: '#FFDEAD', + Navy: '#000080', + OldLace: '#FDF5E6', + Olive: '#808000', + OliveDrab: '#6B8E23', + Orange: '#FFA500', + OrangeRed: '#FF4500', + Orchid: '#DA70D6', + PaleGoldenRod: '#EEE8AA', + PaleGreen: '#98FB98', + PaleTurquoise: '#AFEEEE', + PaleVioletRed: '#D87093', + PapayaWhip: '#FFEFD5', + PeachPuff: '#FFDAB9', + Peru: '#CD853F', + Pink: '#FFC0CB', + Plum: '#DDA0DD', + PowderBlue: '#B0E0E6', + Purple: '#800080', + Red: '#FF0000', + RosyBrown: '#BC8F8F', + RoyalBlue: '#4169E1', + SaddleBrown: '#8B4513', + Salmon: '#FA8072', + SandyBrown: '#F4A460', + SeaGreen: '#2E8B57', + SeaShell: '#FFF5EE', + Sienna: '#A0522D', + Silver: '#C0C0C0', + SkyBlue: '#87CEEB', + SlateBlue: '#6A5ACD', + SlateGray: '#708090', + SlateGrey: '#708090', + Snow: '#FFFAFA', + SpringGreen: '#00FF7F', + SteelBlue: '#4682B4', + Tan: '#D2B48C', + Teal: '#008080', + Thistle: '#D8BFD8', + Tomato: '#FF6347', + Turquoise: '#40E0D0', + Violet: '#EE82EE', + Wheat: '#F5DEB3', + White: '#FFFFFF', + WhiteSmoke: '#F5F5F5', + Yellow: '#FFFF00', + YellowGreen: '#9ACD32', }; From 80eaf3901f11bafbab962be899bfae24903900d9 Mon Sep 17 00:00:00 2001 From: Andreas Lind Date: Thu, 16 Jul 2020 12:45:24 +0200 Subject: [PATCH 17/26] Replace jshint with eslint --- .eslintignore | 6 ++++ .eslintrc | 12 ++++++++ .jshintignore | 6 ---- .jshintrc | 78 --------------------------------------------------- package.json | 11 ++++++-- 5 files changed, 27 insertions(+), 86 deletions(-) create mode 100644 .eslintignore create mode 100644 .eslintrc delete mode 100644 .jshintignore delete mode 100644 .jshintrc diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..0d0e877 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,6 @@ +/node_modules/ +/demo/ +/slides/ +/one-color-all.js +/one-color.js +/coverage/ diff --git a/.eslintrc b/.eslintrc new file mode 100644 index 0000000..dc577f8 --- /dev/null +++ b/.eslintrc @@ -0,0 +1,12 @@ +{ + "extends": ["standard", "prettier", "prettier/standard"], + "plugins": ["import", "mocha"], + "env": { + "mocha": true + }, + "rules": { + "mocha/no-exclusive-tests": "error", + "mocha/no-nested-tests": "error", + "mocha/no-identical-title": "error" + } +} diff --git a/.jshintignore b/.jshintignore deleted file mode 100644 index 3df53d5..0000000 --- a/.jshintignore +++ /dev/null @@ -1,6 +0,0 @@ -node_modules -demo -slides -one-color-all.js -one-color.js -coverage diff --git a/.jshintrc b/.jshintrc deleted file mode 100644 index a74fe2b..0000000 --- a/.jshintrc +++ /dev/null @@ -1,78 +0,0 @@ -{ - // JSHint Default Configuration File (as on JSHint website) - // See http://jshint.com/docs/ for more details - - "maxerr" : 50, // {int} Maximum error before stopping - - // Enforcing - "bitwise" : true, // true: Prohibit bitwise operators (&, |, ^, etc.) - "camelcase" : true, // true: Identifiers must be in camelCase - "curly" : true, // true: Require {} for every new block or scope - "eqeqeq" : true, // true: Require triple equals (===) for comparison - "forin" : true, // true: Require filtering for..in loops with obj.hasOwnProperty() - "immed" : true, // true: Require immediate invocations to be wrapped in parens e.g. `(function () { } ());` - "indent" : 2, // {int} Number of spaces to use for indentation - "latedef" : true, // true: Require variables/functions to be defined before being used - "newcap" : true, // true: Require capitalization of all constructor functions e.g. `new F()` - "noarg" : true, // true: Prohibit use of `arguments.caller` and `arguments.callee` - "noempty" : true, // true: Prohibit use of empty blocks - "nonew" : false, // true: Prohibit use of constructors for side-effects (without assignment) - "plusplus" : true, // true: Prohibit use of `++` & `--` - "quotmark" : "single", // Quotation mark consistency: - // false : do nothing (default) - // true : ensure whatever is used is consistent - // "single" : require single quotes - // "double" : require double quotes - "undef" : true, // true: Require all non-global variables to be declared (prevents global leaks) - "unused" : true, // true: Require all defined variables be used - "strict" : "implied", // true: Requires all functions run in ES5 Strict Mode - "trailing" : true, // true: Prohibit trailing whitespaces - "maxparams" : false, // {int} Max number of formal params allowed per function - "maxdepth" : false, // {int} Max depth of nested blocks (within functions) - "maxstatements" : false, // {int} Max number statements per function - "maxcomplexity" : false, // {int} Max cyclomatic complexity per function - "maxlen" : false, // {int} Max number of characters per line - - // Relaxing - "asi" : false, // true: Tolerate Automatic Semicolon Insertion (no semicolons) - "boss" : false, // true: Tolerate assignments where comparisons would be expected - "debug" : false, // true: Allow debugger statements e.g. browser breakpoints. - "eqnull" : false, // true: Tolerate use of `== null` - "es5" : false, // true: Allow ES5 syntax (ex: getters and setters) - "esnext" : false, // true: Allow ES.next (ES6) syntax (ex: `const`) - // (ex: `for each`, multiple try/catch, function expression…) - "evil" : false, // true: Tolerate use of `eval` and `new Function()` - "expr" : false, // true: Tolerate `ExpressionStatement` as Programs - "funcscope" : false, // true: Tolerate defining variables inside control statements" - "globalstrict" : false, // true: Allow global "use strict" (also enables 'strict') - "iterator" : false, // true: Tolerate using the `__iterator__` property - "lastsemic" : false, // true: Tolerate omitting a semicolon for the last statement of a 1-line block - "laxbreak" : false, // true: Tolerate possibly unsafe line breakings - "laxcomma" : false, // true: Tolerate comma-first style coding - "loopfunc" : false, // true: Tolerate functions being defined in loops - "multistr" : false, // true: Tolerate multi-line strings - "proto" : false, // true: Tolerate using the `__proto__` property - "scripturl" : false, // true: Tolerate script-targeted URLs - "smarttabs" : false, // true: Tolerate mixed tabs/spaces when used for alignment - "shadow" : false, // true: Allows re-define variables later in code e.g. `var x=1; x=2;` - "sub" : false, // true: Tolerate using `[]` notation when it can still be expressed in dot notation - "supernew" : false, // true: Tolerate `new function () { ... };` and `new Object;` - "validthis" : false, // true: Tolerate using this in a non-constructor function - - // Environments - "browser" : false, // Web Browser (window, document, etc) - "devel" : false, // Development/debugging (alert, confirm, etc) - "mocha" : true, // Mocha - "node" : true, // Node.js - "nonstandard" : true, // Widely adopted globals (escape, unescape, etc) - - // Legacy - "nomen" : false, // true: Prohibit dangling `_` in variables - "onevar" : false, // true: Allow only one `var` statement per function - "passfail" : false, // true: Stop on first error - "white" : true, // true: Check against strict whitespace and indentation rules - - // Custom Globals - "predef" : [ // additional predefined global variables - ] -} diff --git a/package.json b/package.json index 5339bcf..60804a8 100644 --- a/package.json +++ b/package.json @@ -25,8 +25,15 @@ ], "devDependencies": { "coveralls": "2.11.9", + "eslint": "^7.4.0", + "eslint-config-prettier": "^6.11.0", + "eslint-config-standard": "^14.1.1", + "eslint-plugin-import": "^2.22.0", + "eslint-plugin-mocha": "^7.0.1", + "eslint-plugin-node": "^11.1.0", + "eslint-plugin-promise": "^4.2.1", + "eslint-plugin-standard": "^4.0.1", "istanbul": "0.4.2", - "jshint": "^2.9.1", "mocha": "2.4.5", "mocha-lcov-reporter": "1.2.0", "prettier": "^2.0.5", @@ -57,7 +64,7 @@ "postone-color": "rimraf OUT.*", "build": "npm run one-color && npm run one-color-all", "preversion": "npm run lint && npm run build && TEST_BUNDLES=true npm test && bash -c 'git add one-color{-all,}.{js,map}'", - "lint": "jshint . && prettier --check '**/*.{js,md}'", + "lint": "eslint . && prettier --check '**/*.{js,md}'", "test": "npm run lint && mocha", "coverage": "istanbul cover _mocha -- --reporter dot", "ci:test": "TEST_BUNDLES=true npm run coverage" From f0b7419df69ffff90d62f23c027d488218edd9f8 Mon Sep 17 00:00:00 2001 From: Andreas Lind Date: Thu, 16 Jul 2020 12:45:41 +0200 Subject: [PATCH 18/26] eslint --fix . && prettier --write '**/*.js' --- lib/CMYK.js | 14 +++++----- lib/HSL.js | 6 ++--- lib/HSV.js | 48 ++++++++++++++++----------------- lib/LAB.js | 12 ++++----- lib/XYZ.js | 44 +++++++++++++++--------------- lib/color.js | 58 ++++++++++++++++++++-------------------- lib/plugins/grayscale.js | 6 ++--- lib/plugins/mix.js | 10 +++---- lib/plugins/toAlpha.js | 10 +++---- 9 files changed, 104 insertions(+), 104 deletions(-) diff --git a/lib/CMYK.js b/lib/CMYK.js index 8e60622..9fbfba4 100644 --- a/lib/CMYK.js +++ b/lib/CMYK.js @@ -15,13 +15,13 @@ module.exports = function CMYK(color) { fromRgb: function () { // Becomes one.color.RGB.prototype.cmyk // Adapted from http://www.javascripter.net/faq/rgb2cmyk.htm - var red = this._red, - green = this._green, - blue = this._blue, - cyan = 1 - red, - magenta = 1 - green, - yellow = 1 - blue, - black = 1; + var red = this._red; + var green = this._green; + var blue = this._blue; + var cyan = 1 - red; + var magenta = 1 - green; + var yellow = 1 - blue; + var black = 1; if (red || green || blue) { black = Math.min(cyan, Math.min(magenta, yellow)); cyan = (cyan - black) / (1 - black); diff --git a/lib/HSL.js b/lib/HSL.js index 8c0d698..cfea9d1 100644 --- a/lib/HSL.js +++ b/lib/HSL.js @@ -4,9 +4,9 @@ module.exports = function HSL(color) { color.installColorSpace('HSL', ['hue', 'saturation', 'lightness', 'alpha'], { hsv: function () { // Algorithm adapted from http://wiki.secondlife.com/wiki/Color_conversion_scripts - var l = this._lightness * 2, - s = this._saturation * (l <= 1 ? l : 2 - l), - saturation; + var l = this._lightness * 2; + var s = this._saturation * (l <= 1 ? l : 2 - l); + var saturation; // Avoid division by zero when l + s is very small (approaching black): if (l + s < 1e-9) { diff --git a/lib/HSV.js b/lib/HSV.js index 86df5c4..d29c100 100644 --- a/lib/HSV.js +++ b/lib/HSV.js @@ -1,17 +1,17 @@ module.exports = function HSV(color) { color.installColorSpace('HSV', ['hue', 'saturation', 'value', 'alpha'], { rgb: function () { - var hue = this._hue, - saturation = this._saturation, - value = this._value, - i = Math.min(5, Math.floor(hue * 6)), - f = hue * 6 - i, - p = value * (1 - saturation), - q = value * (1 - f * saturation), - t = value * (1 - (1 - f) * saturation), - red, - green, - blue; + var hue = this._hue; + var saturation = this._saturation; + var value = this._value; + var i = Math.min(5, Math.floor(hue * 6)); + var f = hue * 6 - i; + var p = value * (1 - saturation); + var q = value * (1 - f * saturation); + var t = value * (1 - (1 - f) * saturation); + var red; + var green; + var blue; switch (i) { case 0: red = value; @@ -48,10 +48,10 @@ module.exports = function HSV(color) { }, hsl: function () { - var l = (2 - this._saturation) * this._value, - sv = this._saturation * this._value, - svDivisor = l <= 1 ? l : 2 - l, - saturation; + var l = (2 - this._saturation) * this._value; + var sv = this._saturation * this._value; + var svDivisor = l <= 1 ? l : 2 - l; + var saturation; // Avoid division by zero when lightness approaches zero: if (svDivisor < 1e-9) { @@ -64,15 +64,15 @@ module.exports = function HSV(color) { fromRgb: function () { // Becomes one.color.RGB.prototype.hsv - var red = this._red, - green = this._green, - blue = this._blue, - max = Math.max(red, green, blue), - min = Math.min(red, green, blue), - delta = max - min, - hue, - saturation = max === 0 ? 0 : delta / max, - value = max; + var red = this._red; + var green = this._green; + var blue = this._blue; + var max = Math.max(red, green, blue); + var min = Math.min(red, green, blue); + var delta = max - min; + var hue; + var saturation = max === 0 ? 0 : delta / max; + var value = max; if (delta === 0) { hue = 0; } else { diff --git a/lib/LAB.js b/lib/LAB.js index 6f34ca5..9400517 100644 --- a/lib/LAB.js +++ b/lib/LAB.js @@ -13,12 +13,12 @@ module.exports = function LAB(color) { xyz: function () { // http://www.easyrgb.com/index.php?X=MATH&H=08#text8 var convert = function (channel) { - var pow = Math.pow(channel, 3); - return pow > 0.008856 ? pow : (channel - 16 / 116) / 7.87; - }, - y = (this._l + 16) / 116, - x = this._a / 500 + y, - z = y - this._b / 200; + var pow = Math.pow(channel, 3); + return pow > 0.008856 ? pow : (channel - 16 / 116) / 7.87; + }; + var y = (this._l + 16) / 116; + var x = this._a / 500 + y; + var z = y - this._b / 200; return new color.XYZ( convert(x) * 95.047, diff --git a/lib/XYZ.js b/lib/XYZ.js index c35e4be..aabc891 100644 --- a/lib/XYZ.js +++ b/lib/XYZ.js @@ -3,13 +3,13 @@ module.exports = function XYZ(color) { fromRgb: function () { // http://www.easyrgb.com/index.php?X=MATH&H=02#text2 var convert = function (channel) { - return channel > 0.04045 - ? Math.pow((channel + 0.055) / 1.055, 2.4) - : channel / 12.92; - }, - r = convert(this._red), - g = convert(this._green), - b = convert(this._blue); + return channel > 0.04045 + ? Math.pow((channel + 0.055) / 1.055, 2.4) + : channel / 12.92; + }; + var r = convert(this._red); + var g = convert(this._green); + var b = convert(this._blue); // Reference white point sRGB D65: // http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html @@ -23,14 +23,14 @@ module.exports = function XYZ(color) { rgb: function () { // http://www.easyrgb.com/index.php?X=MATH&H=01#text1 - var x = this._x, - y = this._y, - z = this._z, - convert = function (channel) { - return channel > 0.0031308 - ? 1.055 * Math.pow(channel, 1 / 2.4) - 0.055 - : 12.92 * channel; - }; + var x = this._x; + var y = this._y; + var z = this._z; + var convert = function (channel) { + return channel > 0.0031308 + ? 1.055 * Math.pow(channel, 1 / 2.4) - 0.055 + : 12.92 * channel; + }; // Reference white point sRGB D65: // http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html @@ -45,13 +45,13 @@ module.exports = function XYZ(color) { lab: function () { // http://www.easyrgb.com/index.php?X=MATH&H=07#text7 var convert = function (channel) { - return channel > 0.008856 - ? Math.pow(channel, 1 / 3) - : 7.787037 * channel + 4 / 29; - }, - x = convert(this._x / 95.047), - y = convert(this._y / 100.0), - z = convert(this._z / 108.883); + return channel > 0.008856 + ? Math.pow(channel, 1 / 3) + : 7.787037 * channel + 4 / 29; + }; + var x = convert(this._x / 95.047); + var y = convert(this._y / 100.0); + var z = convert(this._z / 108.883); return new color.LAB( 116 * y - 16, diff --git a/lib/color.js b/lib/color.js index 3838ed9..54efda9 100644 --- a/lib/color.js +++ b/lib/color.js @@ -1,24 +1,24 @@ -var installedColorSpaces = [], - undef = function (obj) { - return typeof obj === 'undefined'; - }, - channelRegExp = /\s*(\.\d+|\d+(?:\.\d+)?)(%)?\s*/, - percentageChannelRegExp = /\s*(\.\d+|100|\d?\d(?:\.\d+)?)%\s*/, - alphaChannelRegExp = /\s*(\.\d+|\d+(?:\.\d+)?)\s*/, - cssColorRegExp = new RegExp( - '^(rgb|hsl|hsv)a?' + - '\\(' + - channelRegExp.source + - ',' + - channelRegExp.source + - ',' + - channelRegExp.source + - '(?:,' + - alphaChannelRegExp.source + - ')?' + - '\\)$', - 'i' - ); +var installedColorSpaces = []; +var undef = function (obj) { + return typeof obj === 'undefined'; +}; +var channelRegExp = /\s*(\.\d+|\d+(?:\.\d+)?)(%)?\s*/; +var percentageChannelRegExp = /\s*(\.\d+|100|\d?\d(?:\.\d+)?)%\s*/; +var alphaChannelRegExp = /\s*(\.\d+|\d+(?:\.\d+)?)\s*/; +var cssColorRegExp = new RegExp( + '^(rgb|hsl|hsv)a?' + + '\\(' + + channelRegExp.source + + ',' + + channelRegExp.source + + ',' + + channelRegExp.source + + '(?:,' + + alphaChannelRegExp.source + + ')?' + + '\\)$', + 'i' +); function color(obj) { if (Array.isArray(obj)) { @@ -45,14 +45,14 @@ function color(obj) { // Test for CSS rgb(....) string var matchCssSyntax = obj.match(cssColorRegExp); if (matchCssSyntax) { - var colorSpaceName = matchCssSyntax[1].toUpperCase(), - alpha = undef(matchCssSyntax[8]) - ? matchCssSyntax[8] - : parseFloat(matchCssSyntax[8]), - hasHue = colorSpaceName[0] === 'H', - firstChannelDivisor = matchCssSyntax[3] ? 100 : hasHue ? 360 : 255, - secondChannelDivisor = matchCssSyntax[5] || hasHue ? 100 : 255, - thirdChannelDivisor = matchCssSyntax[7] || hasHue ? 100 : 255; + var colorSpaceName = matchCssSyntax[1].toUpperCase(); + var alpha = undef(matchCssSyntax[8]) + ? matchCssSyntax[8] + : parseFloat(matchCssSyntax[8]); + var hasHue = colorSpaceName[0] === 'H'; + var firstChannelDivisor = matchCssSyntax[3] ? 100 : hasHue ? 360 : 255; + var secondChannelDivisor = matchCssSyntax[5] || hasHue ? 100 : 255; + var thirdChannelDivisor = matchCssSyntax[7] || hasHue ? 100 : 255; if (undef(color[colorSpaceName])) { throw new Error('color.' + colorSpaceName + ' is not installed.'); } diff --git a/lib/plugins/grayscale.js b/lib/plugins/grayscale.js index 3717049..5ac31ee 100644 --- a/lib/plugins/grayscale.js +++ b/lib/plugins/grayscale.js @@ -1,8 +1,8 @@ module.exports = function grayscale(color) { function gs() { - /*jslint strict:false*/ - var rgb = this.rgb(), - val = rgb._red * 0.3 + rgb._green * 0.59 + rgb._blue * 0.11; + /* jslint strict:false */ + var rgb = this.rgb(); + var val = rgb._red * 0.3 + rgb._green * 0.59 + rgb._blue * 0.11; return new color.RGB(val, val, val, rgb._alpha); } diff --git a/lib/plugins/mix.js b/lib/plugins/mix.js index 9fa9366..0caaad3 100644 --- a/lib/plugins/mix.js +++ b/lib/plugins/mix.js @@ -3,11 +3,11 @@ module.exports = function mix(color) { otherColor = color(otherColor).rgb(); weight = 1 - (isNaN(weight) ? 0.5 : weight); - var w = weight * 2 - 1, - a = this._alpha - otherColor._alpha, - weight1 = ((w * a === -1 ? w : (w + a) / (1 + w * a)) + 1) / 2, - weight2 = 1 - weight1, - rgb = this.rgb(); + var w = weight * 2 - 1; + var a = this._alpha - otherColor._alpha; + var weight1 = ((w * a === -1 ? w : (w + a) / (1 + w * a)) + 1) / 2; + var weight2 = 1 - weight1; + var rgb = this.rgb(); return new color.RGB( rgb._red * weight1 + otherColor._red * weight2, diff --git a/lib/plugins/toAlpha.js b/lib/plugins/toAlpha.js index a8c08c1..f370d1b 100644 --- a/lib/plugins/toAlpha.js +++ b/lib/plugins/toAlpha.js @@ -2,11 +2,11 @@ // toAlpha returns a color where the values of the argument have been converted to alpha module.exports = function toAlpha(color) { color.installMethod('toAlpha', function (color) { - var me = this.rgb(), - other = color(color).rgb(), - epsilon = 1e-10, - a = new color.RGB(0, 0, 0, me._alpha), - channels = ['_red', '_green', '_blue']; + var me = this.rgb(); + var other = color(color).rgb(); + var epsilon = 1e-10; + var a = new color.RGB(0, 0, 0, me._alpha); + var channels = ['_red', '_green', '_blue']; channels.forEach(function (channel) { if (me[channel] < epsilon) { From b4b548e4ce6a524ec39d37e06b3d1ef9efe9b2fb Mon Sep 17 00:00:00 2001 From: Andreas Lind Date: Thu, 16 Jul 2020 12:48:50 +0200 Subject: [PATCH 19/26] Avoid no-prototype-builtins error --- lib/color.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/color.js b/lib/color.js index 54efda9..bb01518 100644 --- a/lib/color.js +++ b/lib/color.js @@ -194,7 +194,7 @@ color.installColorSpace = function (colorSpaceName, propertyNames, config) { }; for (var propertyName in config) { - if (config.hasOwnProperty(propertyName)) { + if (Object.prototype.hasOwnProperty.call(config, propertyName)) { var matchFromColorSpace = propertyName.match(/^from(.*)$/); if (matchFromColorSpace) { color[matchFromColorSpace[1].toUpperCase()].prototype[ @@ -270,7 +270,7 @@ color.installColorSpace = function (colorSpaceName, propertyNames, config) { }); for (var prop in obj) { if ( - obj.hasOwnProperty(prop) && + Object.prototype.hasOwnProperty.call(obj, prop) && color[targetColorSpaceName].prototype[prop] === undefined ) { color[targetColorSpaceName].prototype[prop] = obj[prop]; From a1eb708ff6170fe91d5a2a950fe2889fbdc145fe Mon Sep 17 00:00:00 2001 From: Andreas Lind Date: Thu, 16 Jul 2020 12:55:19 +0200 Subject: [PATCH 20/26] Test on more node.js versions, lint and build on 14. --- .travis.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 47bb799..00c2aff 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,12 +10,18 @@ node_js: - '2' - '3' - '4' + - '6' + - '8' + - '10' + - '12' + - '14' + - node matrix: include: - name: Lint - node_js: 12 + node_js: 14 script: npm run lint -script: '(nvm i 12 && npm run build) && npm run ci:test' +script: '(nvm i 14 && npm run build) && npm run ci:test' after_success: ' Date: Thu, 16 Jul 2020 13:03:03 +0200 Subject: [PATCH 21/26] Replace uglify-js with rollup-plugin-terser, update rollup, simplify build setup --- package.json | 15 +++++---------- rollup.config.js | 8 ++++---- 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/package.json b/package.json index 60804a8..6a7d658 100644 --- a/package.json +++ b/package.json @@ -37,10 +37,9 @@ "mocha": "2.4.5", "mocha-lcov-reporter": "1.2.0", "prettier": "^2.0.5", - "rimraf": "2.6.2", - "rollup": "0.41.6", - "rollup-plugin-commonjs": "8.0.2", - "uglify-js": "2.8.21", + "rollup": "^2.21.0", + "rollup-plugin-commonjs": "^10.1.0", + "rollup-plugin-terser": "^6.1.0", "unexpected": "10.11.1" }, "engines": { @@ -56,12 +55,8 @@ "lib" ], "scripts": { - "preone-color-all": "rollup -c rollup.config.js index.js", - "one-color-all": "uglifyjs --compress --mangle --in-source-map OUT.js.map --source-map one-color-all.map OUT.js > one-color-all.js", - "postone-color-all": "rimraf OUT.*", - "preone-color": "rollup -c rollup.config.js minimal.js ", - "one-color": "uglifyjs --compress --mangle --in-source-map OUT.js.map --source-map one-color.map OUT.js > one-color.js", - "postone-color": "rimraf OUT.*", + "one-color-all": "rollup -c rollup.config.js index.js -o one-color-all.js", + "one-color": "rollup -c rollup.config.js minimal.js -o one-color.js", "build": "npm run one-color && npm run one-color-all", "preversion": "npm run lint && npm run build && TEST_BUNDLES=true npm test && bash -c 'git add one-color{-all,}.{js,map}'", "lint": "eslint . && prettier --check '**/*.{js,md}'", diff --git a/rollup.config.js b/rollup.config.js index f65206a..6dcc907 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -1,12 +1,12 @@ -var commonjs = require('rollup-plugin-commonjs'); - module.exports = { // entry: 'index.js', format: 'umd', moduleName: 'one.color', - dest: 'OUT.js', sourceMap: true, - plugins: [commonjs()], + plugins: [ + require('rollup-plugin-commonjs')(), + require('rollup-plugin-terser').terser(), + ], }; From 327d3e7faf7ff42f892aacbd7adcb4650e0e4e50 Mon Sep 17 00:00:00 2001 From: Andreas Lind Date: Thu, 16 Jul 2020 13:12:05 +0200 Subject: [PATCH 22/26] Switch from rollup-plugin-commonjs to @rollup/plugin-commonjs --- package.json | 2 +- rollup.config.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 6a7d658..38fee86 100644 --- a/package.json +++ b/package.json @@ -24,6 +24,7 @@ } ], "devDependencies": { + "@rollup/plugin-commonjs": "^14.0.0", "coveralls": "2.11.9", "eslint": "^7.4.0", "eslint-config-prettier": "^6.11.0", @@ -38,7 +39,6 @@ "mocha-lcov-reporter": "1.2.0", "prettier": "^2.0.5", "rollup": "^2.21.0", - "rollup-plugin-commonjs": "^10.1.0", "rollup-plugin-terser": "^6.1.0", "unexpected": "10.11.1" }, diff --git a/rollup.config.js b/rollup.config.js index 6dcc907..0f75a3f 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -6,7 +6,7 @@ module.exports = { sourceMap: true, plugins: [ - require('rollup-plugin-commonjs')(), + require('@rollup/plugin-commonjs')(), require('rollup-plugin-terser').terser(), ], }; From 4712c7baf369da35bedd6a76f60de070c591175b Mon Sep 17 00:00:00 2001 From: Andreas Lind Date: Thu, 16 Jul 2020 13:23:21 +0200 Subject: [PATCH 23/26] Fix rollup config --- rollup.config.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/rollup.config.js b/rollup.config.js index 0f75a3f..6ba8fb6 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -1,12 +1,14 @@ module.exports = { // entry: 'index.js', - format: 'umd', - moduleName: 'one.color', - - sourceMap: true, plugins: [ require('@rollup/plugin-commonjs')(), require('rollup-plugin-terser').terser(), ], + + output: { + format: 'umd', + name: 'one.color', + sourcemap: true, + }, }; From c80da9e82414a013d511043c85cfc3877b8ebe4e Mon Sep 17 00:00:00 2001 From: Andreas Lind Date: Thu, 16 Jul 2020 13:23:55 +0200 Subject: [PATCH 24/26] New build --- one-color-all.js | 4 ++-- one-color-all.js.map | 1 + one-color-all.map | 1 - one-color.js | 4 ++-- one-color.js.map | 1 + one-color.map | 1 - 6 files changed, 6 insertions(+), 6 deletions(-) create mode 100644 one-color-all.js.map delete mode 100644 one-color-all.map create mode 100644 one-color.js.map delete mode 100644 one-color.map diff --git a/one-color-all.js b/one-color-all.js index 7dde931..57d8c27 100644 --- a/one-color-all.js +++ b/one-color-all.js @@ -1,2 +1,2 @@ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e.one=e.one||{},e.one.color=t())}(this,function(){"use strict";function e(t){if(Array.isArray(t)){if("string"==typeof t[0]&&"function"==typeof e[t[0]])return new e[t[0]](t.slice(1,t.length));if(4===t.length)return new e.RGB(t[0]/255,t[1]/255,t[2]/255,t[3]/255)}else if("string"==typeof t){var r=t.toLowerCase();e.namedColors[r]&&(t="#"+e.namedColors[r]),"transparent"===r&&(t="rgba(0,0,0,0)");var o=t.match(i);if(o){var s=o[1].toUpperCase(),f=a(o[8])?o[8]:parseFloat(o[8]),u="H"===s[0],l=o[3]?100:u?360:255,h=o[5]||u?100:255,c=o[7]||u?100:255;if(a(e[s]))throw new Error("color."+s+" is not installed.");return new e[s](parseFloat(o[2])/l,parseFloat(o[4])/h,parseFloat(o[6])/c,f)}t.length<6&&(t=t.replace(/^#?([0-9a-f])([0-9a-f])([0-9a-f])$/i,"$1$1$2$2$3$3"));var d=t.match(/^#?([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])$/i);if(d)return new e.RGB(parseInt(d[1],16)/255,parseInt(d[2],16)/255,parseInt(d[3],16)/255);if(e.CMYK){var b=t.match(new RegExp("^cmyk\\("+n.source+","+n.source+","+n.source+","+n.source+"\\)$","i"));if(b)return new e.CMYK(parseFloat(b[1])/100,parseFloat(b[2])/100,parseFloat(b[3])/100,parseFloat(b[4])/100)}}else if("object"==typeof t&&t.isColor)return t;return!1}var t=[],a=function(e){return void 0===e},r=/\s*(\.\d+|\d+(?:\.\d+)?)(%)?\s*/,n=/\s*(\.\d+|100|\d?\d(?:\.\d+)?)%\s*/,i=new RegExp("^(rgb|hsl|hsv)a?\\("+r.source+","+r.source+","+r.source+"(?:,"+/\s*(\.\d+|\d+(?:\.\d+)?)\s*/.source+")?\\)$","i");e.namedColors={},e.installColorSpace=function(r,n,i){function o(t,a){var r={};r[a.toLowerCase()]=function(){return this.rgb()[a.toLowerCase()]()},e[a].propertyNames.forEach(function(e){var t="black"===e?"k":e.charAt(0);r[e]=r[t]=function(t,r){return this[a.toLowerCase()]()[e](t,r)}});for(var n in r)r.hasOwnProperty(n)&&void 0===e[t].prototype[n]&&(e[t].prototype[n]=r[n])}e[r]=function(e){var t=Array.isArray(e)?e:arguments;n.forEach(function(e,a){var i=t[a];if("alpha"===e)this._alpha=isNaN(i)||i>1?1:i<0?0:i;else{if(isNaN(i))throw new Error("["+r+"]: Invalid color: ("+n.join(",")+")");"hue"===e?this._hue=i<0?i-Math.floor(i):i%1:this["_"+e]=i<0?0:i>1?1:i}},this)},e[r].propertyNames=n;var s=e[r].prototype;["valueOf","hex","hexa","css","cssa"].forEach(function(e){s[e]=s[e]||("RGB"===r?s.hex:function(){return this.rgb()[e]()})}),s.isColor=!0,s.equals=function(e,t){a(t)&&(t=1e-10),e=e[r.toLowerCase()]();for(var i=0;it)return!1;return!0},s.toJSON=function(){return[r].concat(n.map(function(e){return this["_"+e]},this))};for(var f in i)if(i.hasOwnProperty(f)){var u=f.match(/^from(.*)$/);u?e[u[1].toUpperCase()].prototype[r.toLowerCase()]=i[f]:s[f]=i[f]}return s[r.toLowerCase()]=function(){return this},s.toString=function(){return"["+r+" "+n.map(function(e){return this["_"+e]},this).join(", ")+"]"},n.forEach(function(e){var t="black"===e?"k":e.charAt(0);s[e]=s[t]=function(t,a){return void 0===t?this["_"+e]:a?new this.constructor(n.map(function(a){return this["_"+a]+(e===a?t:0)},this)):new this.constructor(n.map(function(a){return e===a?t:this["_"+a]},this))}}),t.forEach(function(e){o(r,e),o(e,r)}),t.push(r),e},e.pluginList=[],e.use=function(t){return-1===e.pluginList.indexOf(t)&&(this.pluginList.push(t),t(e)),e},e.installMethod=function(a,r){return t.forEach(function(t){e[t].prototype[a]=r}),this},e.installColorSpace("RGB",["red","green","blue","alpha"],{hex:function(){var e=(65536*Math.round(255*this._red)+256*Math.round(255*this._green)+Math.round(255*this._blue)).toString(16);return"#"+"00000".substr(0,6-e.length)+e},hexa:function(){var e=Math.round(255*this._alpha).toString(16);return"#"+"00".substr(0,2-e.length)+e+this.hex().substr(1,6)},css:function(){return"rgb("+Math.round(255*this._red)+","+Math.round(255*this._green)+","+Math.round(255*this._blue)+")"},cssa:function(){return"rgba("+Math.round(255*this._red)+","+Math.round(255*this._green)+","+Math.round(255*this._blue)+","+this._alpha+")"}});var o=e,s=function(e){e.installColorSpace("XYZ",["x","y","z","alpha"],{fromRgb:function(){var t=function(e){return e>.04045?Math.pow((e+.055)/1.055,2.4):e/12.92},a=t(this._red),r=t(this._green),n=t(this._blue);return new e.XYZ(.4124564*a+.3575761*r+.1804375*n,.2126729*a+.7151522*r+.072175*n,.0193339*a+.119192*r+.9503041*n,this._alpha)},rgb:function(){var t=this._x,a=this._y,r=this._z,n=function(e){return e>.0031308?1.055*Math.pow(e,1/2.4)-.055:12.92*e};return new e.RGB(n(3.2404542*t+-1.5371385*a+-.4985314*r),n(-.969266*t+1.8760108*a+.041556*r),n(.0556434*t+-.2040259*a+1.0572252*r),this._alpha)},lab:function(){var t=function(e){return e>.008856?Math.pow(e,1/3):7.787037*e+4/29},a=t(this._x/95.047),r=t(this._y/100),n=t(this._z/108.883);return new e.LAB(116*r-16,500*(a-r),200*(r-n),this._alpha)}})},f=function(e){e.use(s),e.installColorSpace("LAB",["l","a","b","alpha"],{fromRgb:function(){return this.xyz().lab()},rgb:function(){return this.xyz().rgb()},xyz:function(){var t=function(e){var t=Math.pow(e,3);return t>.008856?t:(e-16/116)/7.87},a=(this._l+16)/116,r=this._a/500+a,n=a-this._b/200;return new e.XYZ(95.047*t(r),100*t(a),108.883*t(n),this._alpha)}})},u=function(e){e.installColorSpace("HSV",["hue","saturation","value","alpha"],{rgb:function(){var t,a,r,n=this._hue,i=this._saturation,o=this._value,s=Math.min(5,Math.floor(6*n)),f=6*n-s,u=o*(1-i),l=o*(1-f*i),h=o*(1-(1-f)*i);switch(s){case 0:t=o,a=h,r=u;break;case 1:t=l,a=o,r=u;break;case 2:t=u,a=o,r=h;break;case 3:t=u,a=l,r=o;break;case 4:t=h,a=u,r=o;break;case 5:t=o,a=u,r=l}return new e.RGB(t,a,r,this._alpha)},hsl:function(){var t,a=(2-this._saturation)*this._value,r=this._saturation*this._value,n=a<=1?a:2-a;return t=n<1e-9?0:r/n,new e.HSL(this._hue,t,a/2,this._alpha)},fromRgb:function(){var t,a=this._red,r=this._green,n=this._blue,i=Math.max(a,r,n),o=Math.min(a,r,n),s=i-o,f=0===i?0:s/i,u=i;if(0===s)t=0;else switch(i){case a:t=(r-n)/s/6+(ra?(t+.05)/(a+.05):(a+.05)/(t+.05)})},p=function(e){e.use(l),e.installMethod("darken",function(e){return this.lightness(isNaN(e)?-.1:-e,!0)})},_=function(e){e.use(l),e.installMethod("desaturate",function(e){return this.saturation(isNaN(e)?-.1:-e,!0)})},m=function(e){function t(){var t=this.rgb(),a=.3*t._red+.59*t._green+.11*t._blue;return new e.RGB(a,a,a,t._alpha)}e.installMethod("greyscale",t).installMethod("grayscale",t)},w=function(e){e.installMethod("isDark",function(){var e=this.rgb();return(255*e._red*299+255*e._green*587+255*e._blue*114)/1e3<128})},y=function(e){e.use(w),e.installMethod("isLight",function(){return!this.isDark()})},v=function(e){e.use(l),e.installMethod("lighten",function(e){return this.lightness(isNaN(e)?.1:e,!0)})},k=function(e){e.installMethod("mix",function(t,a){t=e(t).rgb(),a=1-(isNaN(a)?.5:a);var r=2*a-1,n=this._alpha-t._alpha,i=((r*n==-1?r:(r+n)/(1+r*n))+1)/2,o=1-i,s=this.rgb();return new e.RGB(s._red*i+t._red*o,s._green*i+t._green*o,s._blue*i+t._blue*o,s._alpha*a+t._alpha*(1-a))})},M=function(e){e.installMethod("negate",function(){var t=this.rgb();return new e.RGB(1-t._red,1-t._green,1-t._blue,this._alpha)})},C=function(e){e.installMethod("opaquer",function(e){return this.alpha(isNaN(e)?.1:e,!0)})},N=function(e){e.use(l),e.installMethod("rotate",function(e){return this.hue((e||0)/360,!0)})},x=function(e){e.use(l),e.installMethod("saturate",function(e){return this.saturation(isNaN(e)?.1:e,!0)})},R=function(e){e.installMethod("toAlpha",function(e){var t=this.rgb(),a=e(e).rgb(),r=new e.RGB(0,0,0,t._alpha),n=["_red","_green","_blue"];return n.forEach(function(e){t[e]<1e-10?r[e]=t[e]:t[e]>a[e]?r[e]=(t[e]-a[e])/(1-a[e]):t[e]>a[e]?r[e]=(a[e]-t[e])/a[e]:r[e]=0}),r._red>r._green?r._red>r._blue?t._alpha=r._red:t._alpha=r._blue:r._green>r._blue?t._alpha=r._green:t._alpha=r._blue,t._alpha<1e-10?t:(n.forEach(function(e){t[e]=(t[e]-a[e])/t._alpha+a[e]}),t._alpha*=r._alpha,t)})};return o.use(s).use(f).use(u).use(l).use(h).use(c).use(d).use(g).use(p).use(_).use(m).use(w).use(y).use(v).use(b).use(k).use(M).use(C).use(N).use(x).use(R)}); -//# sourceMappingURL=one-color-all.map +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):((e=e||self).one=e.one||{},e.one.color=t())}(this,(function(){"use strict";var e=[],t=function(e){return void 0===e},a=/\s*(\.\d+|\d+(?:\.\d+)?)(%)?\s*/,r=/\s*(\.\d+|100|\d?\d(?:\.\d+)?)%\s*/,n=new RegExp("^(rgb|hsl|hsv)a?\\("+a.source+","+a.source+","+a.source+"(?:,"+/\s*(\.\d+|\d+(?:\.\d+)?)\s*/.source+")?\\)$","i");function i(e){if(Array.isArray(e)){if("string"==typeof e[0]&&"function"==typeof i[e[0]])return new i[e[0]](e.slice(1,e.length));if(4===e.length)return new i.RGB(e[0]/255,e[1]/255,e[2]/255,e[3]/255)}else if("string"==typeof e){var a=e.toLowerCase();i.namedColors[a]&&(e="#"+i.namedColors[a]),"transparent"===a&&(e="rgba(0,0,0,0)");var o=e.match(n);if(o){var s=o[1].toUpperCase(),f=t(o[8])?o[8]:parseFloat(o[8]),u="H"===s[0],l=o[3]?100:u?360:255,h=o[5]||u?100:255,c=o[7]||u?100:255;if(t(i[s]))throw new Error("color."+s+" is not installed.");return new i[s](parseFloat(o[2])/l,parseFloat(o[4])/h,parseFloat(o[6])/c,f)}e.length<6&&(e=e.replace(/^#?([0-9a-f])([0-9a-f])([0-9a-f])$/i,"$1$1$2$2$3$3"));var d=e.match(/^#?([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])$/i);if(d)return new i.RGB(parseInt(d[1],16)/255,parseInt(d[2],16)/255,parseInt(d[3],16)/255);if(i.CMYK){var b=e.match(new RegExp("^cmyk\\("+r.source+","+r.source+","+r.source+","+r.source+"\\)$","i"));if(b)return new i.CMYK(parseFloat(b[1])/100,parseFloat(b[2])/100,parseFloat(b[3])/100,parseFloat(b[4])/100)}}else if("object"==typeof e&&e.isColor)return e;return!1}i.namedColors={},i.installColorSpace=function(a,r,n){i[a]=function(e){var t=Array.isArray(e)?e:arguments;r.forEach((function(e,n){var i=t[n];if("alpha"===e)this._alpha=isNaN(i)||i>1?1:i<0?0:i;else{if(isNaN(i))throw new Error("["+a+"]: Invalid color: ("+r.join(",")+")");"hue"===e?this._hue=i<0?i-Math.floor(i):i%1:this["_"+e]=i<0?0:i>1?1:i}}),this)},i[a].propertyNames=r;var o=i[a].prototype;for(var s in["valueOf","hex","hexa","css","cssa"].forEach((function(e){o[e]=o[e]||("RGB"===a?o.hex:function(){return this.rgb()[e]()})})),o.isColor=!0,o.equals=function(e,n){t(n)&&(n=1e-10),e=e[a.toLowerCase()]();for(var i=0;in)return!1;return!0},o.toJSON=function(){return[a].concat(r.map((function(e){return this["_"+e]}),this))},n)if(Object.prototype.hasOwnProperty.call(n,s)){var f=s.match(/^from(.*)$/);f?i[f[1].toUpperCase()].prototype[a.toLowerCase()]=n[s]:o[s]=n[s]}function u(e,t){var a={};for(var r in a[t.toLowerCase()]=function(){return this.rgb()[t.toLowerCase()]()},i[t].propertyNames.forEach((function(e){var r="black"===e?"k":e.charAt(0);a[e]=a[r]=function(a,r){return this[t.toLowerCase()]()[e](a,r)}})),a)Object.prototype.hasOwnProperty.call(a,r)&&void 0===i[e].prototype[r]&&(i[e].prototype[r]=a[r])}return o[a.toLowerCase()]=function(){return this},o.toString=function(){return"["+a+" "+r.map((function(e){return this["_"+e]}),this).join(", ")+"]"},r.forEach((function(e){var t="black"===e?"k":e.charAt(0);o[e]=o[t]=function(t,a){return void 0===t?this["_"+e]:a?new this.constructor(r.map((function(a){return this["_"+a]+(e===a?t:0)}),this)):new this.constructor(r.map((function(a){return e===a?t:this["_"+a]}),this))}})),e.forEach((function(e){u(a,e),u(e,a)})),e.push(a),i},i.pluginList=[],i.use=function(e){return-1===i.pluginList.indexOf(e)&&(this.pluginList.push(e),e(i)),i},i.installMethod=function(t,a){return e.forEach((function(e){i[e].prototype[t]=a})),this},i.installColorSpace("RGB",["red","green","blue","alpha"],{hex:function(){var e=(65536*Math.round(255*this._red)+256*Math.round(255*this._green)+Math.round(255*this._blue)).toString(16);return"#"+"00000".substr(0,6-e.length)+e},hexa:function(){var e=Math.round(255*this._alpha).toString(16);return"#"+"00".substr(0,2-e.length)+e+this.hex().substr(1,6)},css:function(){return"rgb("+Math.round(255*this._red)+","+Math.round(255*this._green)+","+Math.round(255*this._blue)+")"},cssa:function(){return"rgba("+Math.round(255*this._red)+","+Math.round(255*this._green)+","+Math.round(255*this._blue)+","+this._alpha+")"}});var o=function(e){e.installColorSpace("XYZ",["x","y","z","alpha"],{fromRgb:function(){var t=function(e){return e>.04045?Math.pow((e+.055)/1.055,2.4):e/12.92},a=t(this._red),r=t(this._green),n=t(this._blue);return new e.XYZ(.4124564*a+.3575761*r+.1804375*n,.2126729*a+.7151522*r+.072175*n,.0193339*a+.119192*r+.9503041*n,this._alpha)},rgb:function(){var t=this._x,a=this._y,r=this._z,n=function(e){return e>.0031308?1.055*Math.pow(e,1/2.4)-.055:12.92*e};return new e.RGB(n(3.2404542*t+-1.5371385*a+-.4985314*r),n(-.969266*t+1.8760108*a+.041556*r),n(.0556434*t+-.2040259*a+1.0572252*r),this._alpha)},lab:function(){var t=function(e){return e>.008856?Math.pow(e,1/3):7.787037*e+4/29},a=t(this._x/95.047),r=t(this._y/100),n=t(this._z/108.883);return new e.LAB(116*r-16,500*(a-r),200*(r-n),this._alpha)}})},s=function(e){e.installColorSpace("HSV",["hue","saturation","value","alpha"],{rgb:function(){var t,a,r,n=this._hue,i=this._saturation,o=this._value,s=Math.min(5,Math.floor(6*n)),f=6*n-s,u=o*(1-i),l=o*(1-f*i),h=o*(1-(1-f)*i);switch(s){case 0:t=o,a=h,r=u;break;case 1:t=l,a=o,r=u;break;case 2:t=u,a=o,r=h;break;case 3:t=u,a=l,r=o;break;case 4:t=h,a=u,r=o;break;case 5:t=o,a=u,r=l}return new e.RGB(t,a,r,this._alpha)},hsl:function(){var t,a=(2-this._saturation)*this._value,r=this._saturation*this._value,n=a<=1?a:2-a;return t=n<1e-9?0:r/n,new e.HSL(this._hue,t,a/2,this._alpha)},fromRgb:function(){var t,a=this._red,r=this._green,n=this._blue,i=Math.max(a,r,n),o=i-Math.min(a,r,n),s=0===i?0:o/i,f=i;if(0===o)t=0;else switch(i){case a:t=(r-n)/o/6+(r.008856?t:(e-16/116)/7.87},a=(this._l+16)/116,r=this._a/500+a,n=a-this._b/200;return new e.XYZ(95.047*t(r),100*t(a),108.883*t(n),this._alpha)}})})).use(s).use(f).use((function(e){e.installColorSpace("CMYK",["cyan","magenta","yellow","black","alpha"],{rgb:function(){return new e.RGB(1-this._cyan*(1-this._black)-this._black,1-this._magenta*(1-this._black)-this._black,1-this._yellow*(1-this._black)-this._black,this._alpha)},fromRgb:function(){var t=this._red,a=this._green,r=this._blue,n=1-t,i=1-a,o=1-r,s=1;return t||a||r?(n=(n-(s=Math.min(n,Math.min(i,o))))/(1-s),i=(i-s)/(1-s),o=(o-s)/(1-s)):s=1,new e.CMYK(n,i,o,s,this._alpha)}})})).use((function(e){e.namedColors={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgrey:"a9a9a9",darkgreen:"006400",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",grey:"808080",green:"008000",greenyellow:"adff2f",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgrey:"d3d3d3",lightgreen:"90ee90",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370d8",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"d87093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"639",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"}})).use((function(e){e.installMethod("clearer",(function(e){return this.alpha(isNaN(e)?-.1:-e,!0)}))})).use((function(e){e.use(u),e.installMethod("contrast",(function(e){var t=this.luminance(),a=e.luminance();return t>a?(t+.05)/(a+.05):(a+.05)/(t+.05)}))})).use((function(e){e.use(f),e.installMethod("darken",(function(e){return this.lightness(isNaN(e)?-.1:-e,!0)}))})).use((function(e){e.use(f),e.installMethod("desaturate",(function(e){return this.saturation(isNaN(e)?-.1:-e,!0)}))})).use((function(e){function t(){var t=this.rgb(),a=.3*t._red+.59*t._green+.11*t._blue;return new e.RGB(a,a,a,t._alpha)}e.installMethod("greyscale",t).installMethod("grayscale",t)})).use(l).use((function(e){e.use(l),e.installMethod("isLight",(function(){return!this.isDark()}))})).use((function(e){e.use(f),e.installMethod("lighten",(function(e){return this.lightness(isNaN(e)?.1:e,!0)}))})).use(u).use((function(e){e.installMethod("mix",(function(t,a){t=e(t).rgb();var r=2*(a=1-(isNaN(a)?.5:a))-1,n=this._alpha-t._alpha,i=((r*n==-1?r:(r+n)/(1+r*n))+1)/2,o=1-i,s=this.rgb();return new e.RGB(s._red*i+t._red*o,s._green*i+t._green*o,s._blue*i+t._blue*o,s._alpha*a+t._alpha*(1-a))}))})).use((function(e){e.installMethod("negate",(function(){var t=this.rgb();return new e.RGB(1-t._red,1-t._green,1-t._blue,this._alpha)}))})).use((function(e){e.installMethod("opaquer",(function(e){return this.alpha(isNaN(e)?.1:e,!0)}))})).use((function(e){e.use(f),e.installMethod("rotate",(function(e){return this.hue((e||0)/360,!0)}))})).use((function(e){e.use(f),e.installMethod("saturate",(function(e){return this.saturation(isNaN(e)?.1:e,!0)}))})).use((function(e){e.installMethod("toAlpha",(function(e){var t=this.rgb(),a=e(e).rgb(),r=new e.RGB(0,0,0,t._alpha),n=["_red","_green","_blue"];return n.forEach((function(e){t[e]<1e-10?r[e]=t[e]:t[e]>a[e]?r[e]=(t[e]-a[e])/(1-a[e]):t[e]>a[e]?r[e]=(a[e]-t[e])/a[e]:r[e]=0})),r._red>r._green?r._red>r._blue?t._alpha=r._red:t._alpha=r._blue:r._green>r._blue?t._alpha=r._green:t._alpha=r._blue,t._alpha<1e-10||(n.forEach((function(e){t[e]=(t[e]-a[e])/t._alpha+a[e]})),t._alpha*=r._alpha),t}))}))})); +//# sourceMappingURL=one-color-all.js.map diff --git a/one-color-all.js.map b/one-color-all.js.map new file mode 100644 index 0000000..40e0cb9 --- /dev/null +++ b/one-color-all.js.map @@ -0,0 +1 @@ +{"version":3,"file":"one-color-all.js","sources":["lib/color.js","lib/XYZ.js","lib/HSV.js","lib/HSL.js","lib/plugins/luminance.js","lib/plugins/isDark.js","index.js","lib/LAB.js","lib/CMYK.js","lib/plugins/namedColors.js","lib/plugins/clearer.js","lib/plugins/contrast.js","lib/plugins/darken.js","lib/plugins/desaturate.js","lib/plugins/grayscale.js","lib/plugins/isLight.js","lib/plugins/lighten.js","lib/plugins/mix.js","lib/plugins/negate.js","lib/plugins/opaquer.js","lib/plugins/rotate.js","lib/plugins/saturate.js","lib/plugins/toAlpha.js"],"sourcesContent":["var installedColorSpaces = [];\nvar undef = function (obj) {\n return typeof obj === 'undefined';\n};\nvar channelRegExp = /\\s*(\\.\\d+|\\d+(?:\\.\\d+)?)(%)?\\s*/;\nvar percentageChannelRegExp = /\\s*(\\.\\d+|100|\\d?\\d(?:\\.\\d+)?)%\\s*/;\nvar alphaChannelRegExp = /\\s*(\\.\\d+|\\d+(?:\\.\\d+)?)\\s*/;\nvar cssColorRegExp = new RegExp(\n '^(rgb|hsl|hsv)a?' +\n '\\\\(' +\n channelRegExp.source +\n ',' +\n channelRegExp.source +\n ',' +\n channelRegExp.source +\n '(?:,' +\n alphaChannelRegExp.source +\n ')?' +\n '\\\\)$',\n 'i'\n);\n\nfunction color(obj) {\n if (Array.isArray(obj)) {\n if (typeof obj[0] === 'string' && typeof color[obj[0]] === 'function') {\n // Assumed array from .toJSON()\n return new color[obj[0]](obj.slice(1, obj.length));\n } else if (obj.length === 4) {\n // Assumed 4 element int RGB array from canvas with all channels [0;255]\n return new color.RGB(\n obj[0] / 255,\n obj[1] / 255,\n obj[2] / 255,\n obj[3] / 255\n );\n }\n } else if (typeof obj === 'string') {\n var lowerCased = obj.toLowerCase();\n if (color.namedColors[lowerCased]) {\n obj = '#' + color.namedColors[lowerCased];\n }\n if (lowerCased === 'transparent') {\n obj = 'rgba(0,0,0,0)';\n }\n // Test for CSS rgb(....) string\n var matchCssSyntax = obj.match(cssColorRegExp);\n if (matchCssSyntax) {\n var colorSpaceName = matchCssSyntax[1].toUpperCase();\n var alpha = undef(matchCssSyntax[8])\n ? matchCssSyntax[8]\n : parseFloat(matchCssSyntax[8]);\n var hasHue = colorSpaceName[0] === 'H';\n var firstChannelDivisor = matchCssSyntax[3] ? 100 : hasHue ? 360 : 255;\n var secondChannelDivisor = matchCssSyntax[5] || hasHue ? 100 : 255;\n var thirdChannelDivisor = matchCssSyntax[7] || hasHue ? 100 : 255;\n if (undef(color[colorSpaceName])) {\n throw new Error('color.' + colorSpaceName + ' is not installed.');\n }\n return new color[colorSpaceName](\n parseFloat(matchCssSyntax[2]) / firstChannelDivisor,\n parseFloat(matchCssSyntax[4]) / secondChannelDivisor,\n parseFloat(matchCssSyntax[6]) / thirdChannelDivisor,\n alpha\n );\n }\n // Assume hex syntax\n if (obj.length < 6) {\n // Allow CSS shorthand\n obj = obj.replace(/^#?([0-9a-f])([0-9a-f])([0-9a-f])$/i, '$1$1$2$2$3$3');\n }\n // Split obj into red, green, and blue components\n var hexMatch = obj.match(\n /^#?([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])$/i\n );\n if (hexMatch) {\n return new color.RGB(\n parseInt(hexMatch[1], 16) / 255,\n parseInt(hexMatch[2], 16) / 255,\n parseInt(hexMatch[3], 16) / 255\n );\n }\n\n // No match so far. Lets try the less likely ones\n if (color.CMYK) {\n var cmykMatch = obj.match(\n new RegExp(\n '^cmyk' +\n '\\\\(' +\n percentageChannelRegExp.source +\n ',' +\n percentageChannelRegExp.source +\n ',' +\n percentageChannelRegExp.source +\n ',' +\n percentageChannelRegExp.source +\n '\\\\)$',\n 'i'\n )\n );\n if (cmykMatch) {\n return new color.CMYK(\n parseFloat(cmykMatch[1]) / 100,\n parseFloat(cmykMatch[2]) / 100,\n parseFloat(cmykMatch[3]) / 100,\n parseFloat(cmykMatch[4]) / 100\n );\n }\n }\n } else if (typeof obj === 'object' && obj.isColor) {\n return obj;\n }\n return false;\n}\n\ncolor.namedColors = {};\n\ncolor.installColorSpace = function (colorSpaceName, propertyNames, config) {\n color[colorSpaceName] = function (a1) {\n // ...\n var args = Array.isArray(a1) ? a1 : arguments;\n propertyNames.forEach(function (propertyName, i) {\n var propertyValue = args[i];\n if (propertyName === 'alpha') {\n this._alpha =\n isNaN(propertyValue) || propertyValue > 1\n ? 1\n : propertyValue < 0\n ? 0\n : propertyValue;\n } else {\n if (isNaN(propertyValue)) {\n throw new Error(\n '[' +\n colorSpaceName +\n ']: Invalid color: (' +\n propertyNames.join(',') +\n ')'\n );\n }\n if (propertyName === 'hue') {\n this._hue =\n propertyValue < 0\n ? propertyValue - Math.floor(propertyValue)\n : propertyValue % 1;\n } else {\n this['_' + propertyName] =\n propertyValue < 0 ? 0 : propertyValue > 1 ? 1 : propertyValue;\n }\n }\n }, this);\n };\n color[colorSpaceName].propertyNames = propertyNames;\n\n var prototype = color[colorSpaceName].prototype;\n\n ['valueOf', 'hex', 'hexa', 'css', 'cssa'].forEach(function (methodName) {\n prototype[methodName] =\n prototype[methodName] ||\n (colorSpaceName === 'RGB'\n ? prototype.hex\n : function () {\n return this.rgb()[methodName]();\n });\n });\n\n prototype.isColor = true;\n\n prototype.equals = function (otherColor, epsilon) {\n if (undef(epsilon)) {\n epsilon = 1e-10;\n }\n\n otherColor = otherColor[colorSpaceName.toLowerCase()]();\n\n for (var i = 0; i < propertyNames.length; i = i + 1) {\n if (\n Math.abs(\n this['_' + propertyNames[i]] - otherColor['_' + propertyNames[i]]\n ) > epsilon\n ) {\n return false;\n }\n }\n\n return true;\n };\n\n prototype.toJSON = function () {\n return [colorSpaceName].concat(\n propertyNames.map(function (propertyName) {\n return this['_' + propertyName];\n }, this)\n );\n };\n\n for (var propertyName in config) {\n if (Object.prototype.hasOwnProperty.call(config, propertyName)) {\n var matchFromColorSpace = propertyName.match(/^from(.*)$/);\n if (matchFromColorSpace) {\n color[matchFromColorSpace[1].toUpperCase()].prototype[\n colorSpaceName.toLowerCase()\n ] = config[propertyName];\n } else {\n prototype[propertyName] = config[propertyName];\n }\n }\n }\n\n // It is pretty easy to implement the conversion to the same color space:\n prototype[colorSpaceName.toLowerCase()] = function () {\n return this;\n };\n prototype.toString = function () {\n return (\n '[' +\n colorSpaceName +\n ' ' +\n propertyNames\n .map(function (propertyName) {\n return this['_' + propertyName];\n }, this)\n .join(', ') +\n ']'\n );\n };\n\n // Generate getters and setters\n propertyNames.forEach(function (propertyName) {\n var shortName = propertyName === 'black' ? 'k' : propertyName.charAt(0);\n prototype[propertyName] = prototype[shortName] = function (value, isDelta) {\n // Simple getter mode: color.red()\n if (typeof value === 'undefined') {\n return this['_' + propertyName];\n } else if (isDelta) {\n // Adjuster: color.red(+.2, true)\n return new this.constructor(\n propertyNames.map(function (otherPropertyName) {\n return (\n this['_' + otherPropertyName] +\n (propertyName === otherPropertyName ? value : 0)\n );\n }, this)\n );\n } else {\n // Setter: color.red(.2);\n return new this.constructor(\n propertyNames.map(function (otherPropertyName) {\n return propertyName === otherPropertyName\n ? value\n : this['_' + otherPropertyName];\n }, this)\n );\n }\n };\n });\n\n function installForeignMethods(targetColorSpaceName, sourceColorSpaceName) {\n var obj = {};\n obj[sourceColorSpaceName.toLowerCase()] = function () {\n return this.rgb()[sourceColorSpaceName.toLowerCase()]();\n };\n color[sourceColorSpaceName].propertyNames.forEach(function (propertyName) {\n var shortName = propertyName === 'black' ? 'k' : propertyName.charAt(0);\n obj[propertyName] = obj[shortName] = function (value, isDelta) {\n return this[sourceColorSpaceName.toLowerCase()]()[propertyName](\n value,\n isDelta\n );\n };\n });\n for (var prop in obj) {\n if (\n Object.prototype.hasOwnProperty.call(obj, prop) &&\n color[targetColorSpaceName].prototype[prop] === undefined\n ) {\n color[targetColorSpaceName].prototype[prop] = obj[prop];\n }\n }\n }\n\n installedColorSpaces.forEach(function (otherColorSpaceName) {\n installForeignMethods(colorSpaceName, otherColorSpaceName);\n installForeignMethods(otherColorSpaceName, colorSpaceName);\n });\n\n installedColorSpaces.push(colorSpaceName);\n return color;\n};\n\ncolor.pluginList = [];\n\ncolor.use = function (plugin) {\n if (color.pluginList.indexOf(plugin) === -1) {\n this.pluginList.push(plugin);\n plugin(color);\n }\n return color;\n};\n\ncolor.installMethod = function (name, fn) {\n installedColorSpaces.forEach(function (colorSpace) {\n color[colorSpace].prototype[name] = fn;\n });\n return this;\n};\n\ncolor.installColorSpace('RGB', ['red', 'green', 'blue', 'alpha'], {\n hex: function () {\n var hexString = (\n Math.round(255 * this._red) * 0x10000 +\n Math.round(255 * this._green) * 0x100 +\n Math.round(255 * this._blue)\n ).toString(16);\n return '#' + '00000'.substr(0, 6 - hexString.length) + hexString;\n },\n\n hexa: function () {\n var alphaString = Math.round(this._alpha * 255).toString(16);\n return (\n '#' +\n '00'.substr(0, 2 - alphaString.length) +\n alphaString +\n this.hex().substr(1, 6)\n );\n },\n\n css: function () {\n return (\n 'rgb(' +\n Math.round(255 * this._red) +\n ',' +\n Math.round(255 * this._green) +\n ',' +\n Math.round(255 * this._blue) +\n ')'\n );\n },\n\n cssa: function () {\n return (\n 'rgba(' +\n Math.round(255 * this._red) +\n ',' +\n Math.round(255 * this._green) +\n ',' +\n Math.round(255 * this._blue) +\n ',' +\n this._alpha +\n ')'\n );\n },\n});\n\nmodule.exports = color;\n","module.exports = function XYZ(color) {\n color.installColorSpace('XYZ', ['x', 'y', 'z', 'alpha'], {\n fromRgb: function () {\n // http://www.easyrgb.com/index.php?X=MATH&H=02#text2\n var convert = function (channel) {\n return channel > 0.04045\n ? Math.pow((channel + 0.055) / 1.055, 2.4)\n : channel / 12.92;\n };\n var r = convert(this._red);\n var g = convert(this._green);\n var b = convert(this._blue);\n\n // Reference white point sRGB D65:\n // http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html\n return new color.XYZ(\n r * 0.4124564 + g * 0.3575761 + b * 0.1804375,\n r * 0.2126729 + g * 0.7151522 + b * 0.072175,\n r * 0.0193339 + g * 0.119192 + b * 0.9503041,\n this._alpha\n );\n },\n\n rgb: function () {\n // http://www.easyrgb.com/index.php?X=MATH&H=01#text1\n var x = this._x;\n var y = this._y;\n var z = this._z;\n var convert = function (channel) {\n return channel > 0.0031308\n ? 1.055 * Math.pow(channel, 1 / 2.4) - 0.055\n : 12.92 * channel;\n };\n\n // Reference white point sRGB D65:\n // http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html\n return new color.RGB(\n convert(x * 3.2404542 + y * -1.5371385 + z * -0.4985314),\n convert(x * -0.969266 + y * 1.8760108 + z * 0.041556),\n convert(x * 0.0556434 + y * -0.2040259 + z * 1.0572252),\n this._alpha\n );\n },\n\n lab: function () {\n // http://www.easyrgb.com/index.php?X=MATH&H=07#text7\n var convert = function (channel) {\n return channel > 0.008856\n ? Math.pow(channel, 1 / 3)\n : 7.787037 * channel + 4 / 29;\n };\n var x = convert(this._x / 95.047);\n var y = convert(this._y / 100.0);\n var z = convert(this._z / 108.883);\n\n return new color.LAB(\n 116 * y - 16,\n 500 * (x - y),\n 200 * (y - z),\n this._alpha\n );\n },\n });\n};\n","module.exports = function HSV(color) {\n color.installColorSpace('HSV', ['hue', 'saturation', 'value', 'alpha'], {\n rgb: function () {\n var hue = this._hue;\n var saturation = this._saturation;\n var value = this._value;\n var i = Math.min(5, Math.floor(hue * 6));\n var f = hue * 6 - i;\n var p = value * (1 - saturation);\n var q = value * (1 - f * saturation);\n var t = value * (1 - (1 - f) * saturation);\n var red;\n var green;\n var blue;\n switch (i) {\n case 0:\n red = value;\n green = t;\n blue = p;\n break;\n case 1:\n red = q;\n green = value;\n blue = p;\n break;\n case 2:\n red = p;\n green = value;\n blue = t;\n break;\n case 3:\n red = p;\n green = q;\n blue = value;\n break;\n case 4:\n red = t;\n green = p;\n blue = value;\n break;\n case 5:\n red = value;\n green = p;\n blue = q;\n break;\n }\n return new color.RGB(red, green, blue, this._alpha);\n },\n\n hsl: function () {\n var l = (2 - this._saturation) * this._value;\n var sv = this._saturation * this._value;\n var svDivisor = l <= 1 ? l : 2 - l;\n var saturation;\n\n // Avoid division by zero when lightness approaches zero:\n if (svDivisor < 1e-9) {\n saturation = 0;\n } else {\n saturation = sv / svDivisor;\n }\n return new color.HSL(this._hue, saturation, l / 2, this._alpha);\n },\n\n fromRgb: function () {\n // Becomes one.color.RGB.prototype.hsv\n var red = this._red;\n var green = this._green;\n var blue = this._blue;\n var max = Math.max(red, green, blue);\n var min = Math.min(red, green, blue);\n var delta = max - min;\n var hue;\n var saturation = max === 0 ? 0 : delta / max;\n var value = max;\n if (delta === 0) {\n hue = 0;\n } else {\n switch (max) {\n case red:\n hue = (green - blue) / delta / 6 + (green < blue ? 1 : 0);\n break;\n case green:\n hue = (blue - red) / delta / 6 + 1 / 3;\n break;\n case blue:\n hue = (red - green) / delta / 6 + 2 / 3;\n break;\n }\n }\n return new color.HSV(hue, saturation, value, this._alpha);\n },\n });\n};\n","module.exports = function HSL(color) {\n color.use(require('./HSV'));\n\n color.installColorSpace('HSL', ['hue', 'saturation', 'lightness', 'alpha'], {\n hsv: function () {\n // Algorithm adapted from http://wiki.secondlife.com/wiki/Color_conversion_scripts\n var l = this._lightness * 2;\n var s = this._saturation * (l <= 1 ? l : 2 - l);\n var saturation;\n\n // Avoid division by zero when l + s is very small (approaching black):\n if (l + s < 1e-9) {\n saturation = 0;\n } else {\n saturation = (2 * s) / (l + s);\n }\n\n return new color.HSV(this._hue, saturation, (l + s) / 2, this._alpha);\n },\n\n rgb: function () {\n return this.hsv().rgb();\n },\n\n fromRgb: function () {\n // Becomes one.color.RGB.prototype.hsv\n return this.hsv().hsl();\n },\n });\n};\n","module.exports = function luminance(color) {\n // http://www.w3.org/TR/WCAG20/#relativeluminancedef\n\n function channelLuminance(value) {\n return value <= 0.03928\n ? value / 12.92\n : Math.pow((value + 0.055) / 1.055, 2.4);\n }\n\n color.installMethod('luminance', function () {\n var rgb = this.rgb();\n return (\n 0.2126 * channelLuminance(rgb._red) +\n 0.7152 * channelLuminance(rgb._green) +\n 0.0722 * channelLuminance(rgb._blue)\n );\n });\n};\n","module.exports = function isDark(color) {\n color.installMethod('isDark', function () {\n var rgb = this.rgb();\n\n // YIQ equation from http://24ways.org/2010/calculating-color-contrast\n var yiq =\n (rgb._red * 255 * 299 + rgb._green * 255 * 587 + rgb._blue * 255 * 114) /\n 1000;\n return yiq < 128;\n });\n};\n","module.exports = require('./lib/color')\n .use(require('./lib/XYZ'))\n .use(require('./lib/LAB'))\n .use(require('./lib/HSV'))\n .use(require('./lib/HSL'))\n .use(require('./lib/CMYK'))\n\n // Convenience functions\n .use(require('./lib/plugins/namedColors'))\n .use(require('./lib/plugins/clearer.js'))\n .use(require('./lib/plugins/contrast.js'))\n .use(require('./lib/plugins/darken.js'))\n .use(require('./lib/plugins/desaturate.js'))\n .use(require('./lib/plugins/grayscale.js'))\n .use(require('./lib/plugins/isDark.js'))\n .use(require('./lib/plugins/isLight.js'))\n .use(require('./lib/plugins/lighten.js'))\n .use(require('./lib/plugins/luminance.js'))\n .use(require('./lib/plugins/mix.js'))\n .use(require('./lib/plugins/negate.js'))\n .use(require('./lib/plugins/opaquer.js'))\n .use(require('./lib/plugins/rotate.js'))\n .use(require('./lib/plugins/saturate.js'))\n .use(require('./lib/plugins/toAlpha.js'));\n","module.exports = function LAB(color) {\n color.use(require('./XYZ.js'));\n\n color.installColorSpace('LAB', ['l', 'a', 'b', 'alpha'], {\n fromRgb: function () {\n return this.xyz().lab();\n },\n\n rgb: function () {\n return this.xyz().rgb();\n },\n\n xyz: function () {\n // http://www.easyrgb.com/index.php?X=MATH&H=08#text8\n var convert = function (channel) {\n var pow = Math.pow(channel, 3);\n return pow > 0.008856 ? pow : (channel - 16 / 116) / 7.87;\n };\n var y = (this._l + 16) / 116;\n var x = this._a / 500 + y;\n var z = y - this._b / 200;\n\n return new color.XYZ(\n convert(x) * 95.047,\n convert(y) * 100.0,\n convert(z) * 108.883,\n this._alpha\n );\n },\n });\n};\n","module.exports = function CMYK(color) {\n color.installColorSpace(\n 'CMYK',\n ['cyan', 'magenta', 'yellow', 'black', 'alpha'],\n {\n rgb: function () {\n return new color.RGB(\n 1 - this._cyan * (1 - this._black) - this._black,\n 1 - this._magenta * (1 - this._black) - this._black,\n 1 - this._yellow * (1 - this._black) - this._black,\n this._alpha\n );\n },\n\n fromRgb: function () {\n // Becomes one.color.RGB.prototype.cmyk\n // Adapted from http://www.javascripter.net/faq/rgb2cmyk.htm\n var red = this._red;\n var green = this._green;\n var blue = this._blue;\n var cyan = 1 - red;\n var magenta = 1 - green;\n var yellow = 1 - blue;\n var black = 1;\n if (red || green || blue) {\n black = Math.min(cyan, Math.min(magenta, yellow));\n cyan = (cyan - black) / (1 - black);\n magenta = (magenta - black) / (1 - black);\n yellow = (yellow - black) / (1 - black);\n } else {\n black = 1;\n }\n return new color.CMYK(cyan, magenta, yellow, black, this._alpha);\n },\n }\n );\n};\n","module.exports = function namedColors(color) {\n color.namedColors = {\n aliceblue: 'f0f8ff',\n antiquewhite: 'faebd7',\n aqua: '0ff',\n aquamarine: '7fffd4',\n azure: 'f0ffff',\n beige: 'f5f5dc',\n bisque: 'ffe4c4',\n black: '000',\n blanchedalmond: 'ffebcd',\n blue: '00f',\n blueviolet: '8a2be2',\n brown: 'a52a2a',\n burlywood: 'deb887',\n cadetblue: '5f9ea0',\n chartreuse: '7fff00',\n chocolate: 'd2691e',\n coral: 'ff7f50',\n cornflowerblue: '6495ed',\n cornsilk: 'fff8dc',\n crimson: 'dc143c',\n cyan: '0ff',\n darkblue: '00008b',\n darkcyan: '008b8b',\n darkgoldenrod: 'b8860b',\n darkgray: 'a9a9a9',\n darkgrey: 'a9a9a9',\n darkgreen: '006400',\n darkkhaki: 'bdb76b',\n darkmagenta: '8b008b',\n darkolivegreen: '556b2f',\n darkorange: 'ff8c00',\n darkorchid: '9932cc',\n darkred: '8b0000',\n darksalmon: 'e9967a',\n darkseagreen: '8fbc8f',\n darkslateblue: '483d8b',\n darkslategray: '2f4f4f',\n darkslategrey: '2f4f4f',\n darkturquoise: '00ced1',\n darkviolet: '9400d3',\n deeppink: 'ff1493',\n deepskyblue: '00bfff',\n dimgray: '696969',\n dimgrey: '696969',\n dodgerblue: '1e90ff',\n firebrick: 'b22222',\n floralwhite: 'fffaf0',\n forestgreen: '228b22',\n fuchsia: 'f0f',\n gainsboro: 'dcdcdc',\n ghostwhite: 'f8f8ff',\n gold: 'ffd700',\n goldenrod: 'daa520',\n gray: '808080',\n grey: '808080',\n green: '008000',\n greenyellow: 'adff2f',\n honeydew: 'f0fff0',\n hotpink: 'ff69b4',\n indianred: 'cd5c5c',\n indigo: '4b0082',\n ivory: 'fffff0',\n khaki: 'f0e68c',\n lavender: 'e6e6fa',\n lavenderblush: 'fff0f5',\n lawngreen: '7cfc00',\n lemonchiffon: 'fffacd',\n lightblue: 'add8e6',\n lightcoral: 'f08080',\n lightcyan: 'e0ffff',\n lightgoldenrodyellow: 'fafad2',\n lightgray: 'd3d3d3',\n lightgrey: 'd3d3d3',\n lightgreen: '90ee90',\n lightpink: 'ffb6c1',\n lightsalmon: 'ffa07a',\n lightseagreen: '20b2aa',\n lightskyblue: '87cefa',\n lightslategray: '789',\n lightslategrey: '789',\n lightsteelblue: 'b0c4de',\n lightyellow: 'ffffe0',\n lime: '0f0',\n limegreen: '32cd32',\n linen: 'faf0e6',\n magenta: 'f0f',\n maroon: '800000',\n mediumaquamarine: '66cdaa',\n mediumblue: '0000cd',\n mediumorchid: 'ba55d3',\n mediumpurple: '9370d8',\n mediumseagreen: '3cb371',\n mediumslateblue: '7b68ee',\n mediumspringgreen: '00fa9a',\n mediumturquoise: '48d1cc',\n mediumvioletred: 'c71585',\n midnightblue: '191970',\n mintcream: 'f5fffa',\n mistyrose: 'ffe4e1',\n moccasin: 'ffe4b5',\n navajowhite: 'ffdead',\n navy: '000080',\n oldlace: 'fdf5e6',\n olive: '808000',\n olivedrab: '6b8e23',\n orange: 'ffa500',\n orangered: 'ff4500',\n orchid: 'da70d6',\n palegoldenrod: 'eee8aa',\n palegreen: '98fb98',\n paleturquoise: 'afeeee',\n palevioletred: 'd87093',\n papayawhip: 'ffefd5',\n peachpuff: 'ffdab9',\n peru: 'cd853f',\n pink: 'ffc0cb',\n plum: 'dda0dd',\n powderblue: 'b0e0e6',\n purple: '800080',\n rebeccapurple: '639',\n red: 'f00',\n rosybrown: 'bc8f8f',\n royalblue: '4169e1',\n saddlebrown: '8b4513',\n salmon: 'fa8072',\n sandybrown: 'f4a460',\n seagreen: '2e8b57',\n seashell: 'fff5ee',\n sienna: 'a0522d',\n silver: 'c0c0c0',\n skyblue: '87ceeb',\n slateblue: '6a5acd',\n slategray: '708090',\n slategrey: '708090',\n snow: 'fffafa',\n springgreen: '00ff7f',\n steelblue: '4682b4',\n tan: 'd2b48c',\n teal: '008080',\n thistle: 'd8bfd8',\n tomato: 'ff6347',\n turquoise: '40e0d0',\n violet: 'ee82ee',\n wheat: 'f5deb3',\n white: 'fff',\n whitesmoke: 'f5f5f5',\n yellow: 'ff0',\n yellowgreen: '9acd32',\n };\n};\n","module.exports = function clearer(color) {\n color.installMethod('clearer', function (amount) {\n return this.alpha(isNaN(amount) ? -0.1 : -amount, true);\n });\n};\n","module.exports = function contrast(color) {\n // http://www.w3.org/TR/WCAG20/#contrast-ratiodef\n\n color.use(require('./luminance'));\n\n color.installMethod('contrast', function (color2) {\n var lum1 = this.luminance();\n var lum2 = color2.luminance();\n if (lum1 > lum2) {\n return (lum1 + 0.05) / (lum2 + 0.05);\n }\n\n return (lum2 + 0.05) / (lum1 + 0.05);\n });\n};\n","module.exports = function darken(color) {\n color.use(require('../HSL'));\n\n color.installMethod('darken', function (amount) {\n return this.lightness(isNaN(amount) ? -0.1 : -amount, true);\n });\n};\n","module.exports = function desaturate(color) {\n color.use(require('../HSL'));\n\n color.installMethod('desaturate', function (amount) {\n return this.saturation(isNaN(amount) ? -0.1 : -amount, true);\n });\n};\n","module.exports = function grayscale(color) {\n function gs() {\n /* jslint strict:false */\n var rgb = this.rgb();\n var val = rgb._red * 0.3 + rgb._green * 0.59 + rgb._blue * 0.11;\n\n return new color.RGB(val, val, val, rgb._alpha);\n }\n\n color.installMethod('greyscale', gs).installMethod('grayscale', gs);\n};\n","module.exports = function isLight(color) {\n color.use(require('./isDark'));\n\n color.installMethod('isLight', function () {\n return !this.isDark();\n });\n};\n","module.exports = function lighten(color) {\n color.use(require('../HSL'));\n\n color.installMethod('lighten', function (amount) {\n return this.lightness(isNaN(amount) ? 0.1 : amount, true);\n });\n};\n","module.exports = function mix(color) {\n color.installMethod('mix', function (otherColor, weight) {\n otherColor = color(otherColor).rgb();\n weight = 1 - (isNaN(weight) ? 0.5 : weight);\n\n var w = weight * 2 - 1;\n var a = this._alpha - otherColor._alpha;\n var weight1 = ((w * a === -1 ? w : (w + a) / (1 + w * a)) + 1) / 2;\n var weight2 = 1 - weight1;\n var rgb = this.rgb();\n\n return new color.RGB(\n rgb._red * weight1 + otherColor._red * weight2,\n rgb._green * weight1 + otherColor._green * weight2,\n rgb._blue * weight1 + otherColor._blue * weight2,\n rgb._alpha * weight + otherColor._alpha * (1 - weight)\n );\n });\n};\n","module.exports = function negate(color) {\n color.installMethod('negate', function () {\n var rgb = this.rgb();\n return new color.RGB(\n 1 - rgb._red,\n 1 - rgb._green,\n 1 - rgb._blue,\n this._alpha\n );\n });\n};\n","module.exports = function opaquer(color) {\n color.installMethod('opaquer', function (amount) {\n return this.alpha(isNaN(amount) ? 0.1 : amount, true);\n });\n};\n","module.exports = function rotate(color) {\n color.use(require('../HSL'));\n\n color.installMethod('rotate', function (degrees) {\n return this.hue((degrees || 0) / 360, true);\n });\n};\n","module.exports = function saturate(color) {\n color.use(require('../HSL'));\n\n color.installMethod('saturate', function (amount) {\n return this.saturation(isNaN(amount) ? 0.1 : amount, true);\n });\n};\n","// Adapted from http://gimp.sourcearchive.com/documentation/2.6.6-1ubuntu1/color-to-alpha_8c-source.html\n// toAlpha returns a color where the values of the argument have been converted to alpha\nmodule.exports = function toAlpha(color) {\n color.installMethod('toAlpha', function (color) {\n var me = this.rgb();\n var other = color(color).rgb();\n var epsilon = 1e-10;\n var a = new color.RGB(0, 0, 0, me._alpha);\n var channels = ['_red', '_green', '_blue'];\n\n channels.forEach(function (channel) {\n if (me[channel] < epsilon) {\n a[channel] = me[channel];\n } else if (me[channel] > other[channel]) {\n a[channel] = (me[channel] - other[channel]) / (1 - other[channel]);\n } else if (me[channel] > other[channel]) {\n a[channel] = (other[channel] - me[channel]) / other[channel];\n } else {\n a[channel] = 0;\n }\n });\n\n if (a._red > a._green) {\n if (a._red > a._blue) {\n me._alpha = a._red;\n } else {\n me._alpha = a._blue;\n }\n } else if (a._green > a._blue) {\n me._alpha = a._green;\n } else {\n me._alpha = a._blue;\n }\n\n if (me._alpha < epsilon) {\n return me;\n }\n\n channels.forEach(function (channel) {\n me[channel] = (me[channel] - other[channel]) / me._alpha + other[channel];\n });\n me._alpha *= a._alpha;\n\n return me;\n });\n};\n"],"names":["installedColorSpaces","undef","obj","channelRegExp","percentageChannelRegExp","cssColorRegExp","RegExp","source","color","Array","isArray","slice","length","RGB","lowerCased","toLowerCase","namedColors","matchCssSyntax","match","colorSpaceName","toUpperCase","alpha","parseFloat","hasHue","firstChannelDivisor","secondChannelDivisor","thirdChannelDivisor","Error","replace","hexMatch","parseInt","CMYK","cmykMatch","isColor","installColorSpace","propertyNames","config","a1","args","arguments","forEach","propertyName","i","propertyValue","this","_alpha","isNaN","join","_hue","Math","floor","prototype","methodName","hex","rgb","equals","otherColor","epsilon","abs","toJSON","concat","map","Object","hasOwnProperty","call","matchFromColorSpace","installForeignMethods","targetColorSpaceName","sourceColorSpaceName","prop","shortName","charAt","value","isDelta","undefined","toString","constructor","otherPropertyName","otherColorSpaceName","push","pluginList","use","plugin","indexOf","installMethod","name","fn","colorSpace","hexString","round","_red","_green","_blue","substr","hexa","alphaString","css","cssa","fromRgb","convert","channel","pow","r","g","b","XYZ","x","_x","y","_y","z","_z","lab","LAB","red","green","blue","hue","saturation","_saturation","_value","min","f","p","q","t","hsl","l","sv","svDivisor","HSL","max","delta","HSV","require$$0","hsv","_lightness","s","channelLuminance","require$$1","xyz","_l","_a","_b","require$$3","require$$4","_cyan","_black","_magenta","_yellow","cyan","magenta","yellow","black","aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","blanchedalmond","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","darkblue","darkcyan","darkgoldenrod","darkgray","darkgrey","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgrey","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","lime","limegreen","linen","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellowgreen","amount","color2","lum1","luminance","lum2","lightness","gs","val","require$$12","isDark","require$$15","weight","w","a","weight1","weight2","degrees","me","other","channels"],"mappings":"kNAAA,IAAIA,EAAuB,GACvBC,EAAQ,SAAUC,GACpB,YAAsB,IAARA,GAEZC,EAAgB,kCAChBC,EAA0B,qCAE1BC,EAAiB,IAAIC,OACvB,sBAEEH,EAAcI,OACd,IACAJ,EAAcI,OACd,IACAJ,EAAcI,OACd,OATqB,8BAUFA,OARrB,SAWA,KAGF,SAASC,EAAMN,GACb,GAAIO,MAAMC,QAAQR,GAAM,CACtB,GAAsB,iBAAXA,EAAI,IAA4C,mBAAlBM,EAAMN,EAAI,IAEjD,OAAO,IAAIM,EAAMN,EAAI,IAAIA,EAAIS,MAAM,EAAGT,EAAIU,SACrC,GAAmB,IAAfV,EAAIU,OAEb,OAAO,IAAIJ,EAAMK,IACfX,EAAI,GAAK,IACTA,EAAI,GAAK,IACTA,EAAI,GAAK,IACTA,EAAI,GAAK,UAGR,GAAmB,iBAARA,EAAkB,CAClC,IAAIY,EAAaZ,EAAIa,cACjBP,EAAMQ,YAAYF,KACpBZ,EAAM,IAAMM,EAAMQ,YAAYF,IAEb,gBAAfA,IACFZ,EAAM,iBAGR,IAAIe,EAAiBf,EAAIgB,MAAMb,GAC/B,GAAIY,EAAgB,CAClB,IAAIE,EAAiBF,EAAe,GAAGG,cACnCC,EAAQpB,EAAMgB,EAAe,IAC7BA,EAAe,GACfK,WAAWL,EAAe,IAC1BM,EAA+B,MAAtBJ,EAAe,GACxBK,EAAsBP,EAAe,GAAK,IAAMM,EAAS,IAAM,IAC/DE,EAAuBR,EAAe,IAAMM,EAAS,IAAM,IAC3DG,EAAsBT,EAAe,IAAMM,EAAS,IAAM,IAC9D,GAAItB,EAAMO,EAAMW,IACd,MAAM,IAAIQ,MAAM,SAAWR,EAAiB,sBAE9C,OAAO,IAAIX,EAAMW,GACfG,WAAWL,EAAe,IAAMO,EAChCF,WAAWL,EAAe,IAAMQ,EAChCH,WAAWL,EAAe,IAAMS,E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EvQ,QANN2Q"} \ No newline at end of file diff --git a/one-color-all.map b/one-color-all.map deleted file mode 100644 index c613edf..0000000 --- a/one-color-all.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["lib/color.js","lib/XYZ.js","lib/LAB.js","lib/HSV.js","lib/HSL.js","lib/CMYK.js","lib/plugins/namedColors.js","lib/plugins/clearer.js","lib/plugins/luminance.js","lib/plugins/contrast.js","lib/plugins/darken.js","lib/plugins/desaturate.js","lib/plugins/grayscale.js","lib/plugins/isDark.js","lib/plugins/isLight.js","lib/plugins/lighten.js","lib/plugins/mix.js","lib/plugins/negate.js","lib/plugins/opaquer.js","lib/plugins/rotate.js","lib/plugins/saturate.js","lib/plugins/toAlpha.js","index.js"],"names":["color","obj","Array","isArray","slice","length","RGB","lowerCased","toLowerCase","namedColors","matchCssSyntax","match","cssColorRegExp","colorSpaceName","toUpperCase","alpha","undef","parseFloat","hasHue","firstChannelDivisor","secondChannelDivisor","thirdChannelDivisor","Error","replace","hexMatch","parseInt","CMYK","cmykMatch","RegExp","percentageChannelRegExp","source","isColor","installedColorSpaces","channelRegExp","installColorSpace","propertyNames","config","installForeignMethods","targetColorSpaceName","sourceColorSpaceName","this","rgb","forEach","propertyName","shortName","charAt","value","isDelta","prop","hasOwnProperty","undefined","prototype","a1","args","arguments","i","propertyValue","_alpha","isNaN","join","_hue","Math","floor","methodName","hex","equals","otherColor","epsilon","abs","toJSON","concat","map","matchFromColorSpace","toString","constructor","otherPropertyName","otherColorSpaceName","push","pluginList","use","plugin","indexOf","installMethod","name","fn","colorSpace","hexString","round","_red","_green","_blue","substr","hexa","alphaString","css","cssa","color_1","XYZ","fromRgb","convert","channel","pow","r","g","b","x","_x","y","_y","z","_z","lab","LAB","require$$0","xyz","_l","_a","_b","HSV","red","green","blue","hue","saturation","_saturation","_value","min","f","p","q","t","hsl","l","sv","svDivisor","HSL","max","delta","hsv","_lightness","s","_cyan","_black","_magenta","_yellow","cyan","magenta","yellow","black","aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","blanchedalmond","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","darkblue","darkcyan","darkgoldenrod","darkgray","darkgrey","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgrey","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","lime","limegreen","linen","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellowgreen","clearer","amount","luminance","channelLuminance","contrast","color2","lum1","lum2","darken","lightness","desaturate","grayscale","gs","val","isDark","isLight","lighten","mix","weight","w","a","weight1","weight2","negate","opaquer","rotate","degrees","saturate","toAlpha","me","other","channels","require$$1","require$$2","require$$3","require$$4","require$$5","require$$6","require$$7","require$$8","require$$9","require$$10","require$$11","require$$12","require$$13","require$$14","require$$15","require$$16","require$$17","require$$18","require$$19","require$$20","require$$21"],"mappings":"sMAgBA,SAASA,GAAMC,GACX,GAAIC,MAA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JxP,IAAIyP,GACJzP,IAAI0P,GACJ1P,IAAI2P,GACJ3P,IAAI4P,GACJ5P,IAAI6P,GACJ7P,IAAI8P,GACJ9P,IAAI+P,GACJ/P,IAAIgQ,GACJhQ,IAAIiQ,GACJjQ,IAAIkQ,GACJlQ,IAAImQ,GACJnQ,IAAIoQ,GACJpQ,IAAIqQ,GACJrQ,IAAIsQ,GACJtQ,IAAIuQ","sourcesContent":["var installedColorSpaces = [],\n undef = function (obj) {\n return typeof obj === 'undefined';\n },\n channelRegExp = /\\s*(\\.\\d+|\\d+(?:\\.\\d+)?)(%)?\\s*/,\n percentageChannelRegExp = /\\s*(\\.\\d+|100|\\d?\\d(?:\\.\\d+)?)%\\s*/,\n alphaChannelRegExp = /\\s*(\\.\\d+|\\d+(?:\\.\\d+)?)\\s*/,\n cssColorRegExp = new RegExp(\n '^(rgb|hsl|hsv)a?' +\n '\\\\(' +\n channelRegExp.source + ',' +\n channelRegExp.source + ',' +\n channelRegExp.source +\n '(?:,' + alphaChannelRegExp.source + ')?' +\n '\\\\)$', 'i');\n\nfunction color(obj) {\n if (Array.isArray(obj)) {\n if (typeof obj[0] === 'string' && typeof color[obj[0]] === 'function') {\n // Assumed array from .toJSON()\n return new color[obj[0]](obj.slice(1, obj.length));\n } else if (obj.length === 4) {\n // Assumed 4 element int RGB array from canvas with all channels [0;255]\n return new color.RGB(obj[0] / 255, obj[1] / 255, obj[2] / 255, obj[3] / 255);\n }\n } else if (typeof obj === 'string') {\n var lowerCased = obj.toLowerCase();\n if (color.namedColors[lowerCased]) {\n obj = '#' + color.namedColors[lowerCased];\n }\n if (lowerCased === 'transparent') {\n obj = 'rgba(0,0,0,0)';\n }\n // Test for CSS rgb(....) string\n var matchCssSyntax = obj.match(cssColorRegExp);\n if (matchCssSyntax) {\n var colorSpaceName = matchCssSyntax[1].toUpperCase(),\n alpha = undef(matchCssSyntax[8]) ? matchCssSyntax[8] : parseFloat(matchCssSyntax[8]),\n hasHue = colorSpaceName[0] === 'H',\n firstChannelDivisor = matchCssSyntax[3] ? 100 : (hasHue ? 360 : 255),\n secondChannelDivisor = (matchCssSyntax[5] || hasHue) ? 100 : 255,\n thirdChannelDivisor = (matchCssSyntax[7] || hasHue) ? 100 : 255;\n if (undef(color[colorSpaceName])) {\n throw new Error('color.' + colorSpaceName + ' is not installed.');\n }\n return new color[colorSpaceName](\n parseFloat(matchCssSyntax[2]) / firstChannelDivisor,\n parseFloat(matchCssSyntax[4]) / secondChannelDivisor,\n parseFloat(matchCssSyntax[6]) / thirdChannelDivisor,\n alpha\n );\n }\n // Assume hex syntax\n if (obj.length < 6) {\n // Allow CSS shorthand\n obj = obj.replace(/^#?([0-9a-f])([0-9a-f])([0-9a-f])$/i, '$1$1$2$2$3$3');\n }\n // Split obj into red, green, and blue components\n var hexMatch = obj.match(/^#?([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])$/i);\n if (hexMatch) {\n return new color.RGB(\n parseInt(hexMatch[1], 16) / 255,\n parseInt(hexMatch[2], 16) / 255,\n parseInt(hexMatch[3], 16) / 255\n );\n }\n\n // No match so far. Lets try the less likely ones\n if (color.CMYK) {\n var cmykMatch = obj.match(new RegExp(\n '^cmyk' +\n '\\\\(' +\n percentageChannelRegExp.source + ',' +\n percentageChannelRegExp.source + ',' +\n percentageChannelRegExp.source + ',' +\n percentageChannelRegExp.source +\n '\\\\)$', 'i'));\n if (cmykMatch) {\n return new color.CMYK(\n parseFloat(cmykMatch[1]) / 100,\n parseFloat(cmykMatch[2]) / 100,\n parseFloat(cmykMatch[3]) / 100,\n parseFloat(cmykMatch[4]) / 100\n );\n }\n }\n } else if (typeof obj === 'object' && obj.isColor) {\n return obj;\n }\n return false;\n}\n\ncolor.namedColors = {};\n\ncolor.installColorSpace = function (colorSpaceName, propertyNames, config) {\n color[colorSpaceName] = function (a1) { // ...\n var args = Array.isArray(a1) ? a1 : arguments;\n propertyNames.forEach(function (propertyName, i) {\n var propertyValue = args[i];\n if (propertyName === 'alpha') {\n this._alpha = (isNaN(propertyValue) || propertyValue > 1) ? 1 : (propertyValue < 0 ? 0 : propertyValue);\n } else {\n if (isNaN(propertyValue)) {\n throw new Error('[' + colorSpaceName + ']: Invalid color: (' + propertyNames.join(',') + ')');\n }\n if (propertyName === 'hue') {\n this._hue = propertyValue < 0 ? propertyValue - Math.floor(propertyValue) : propertyValue % 1;\n } else {\n this['_' + propertyName] = propertyValue < 0 ? 0 : (propertyValue > 1 ? 1 : propertyValue);\n }\n }\n }, this);\n };\n color[colorSpaceName].propertyNames = propertyNames;\n\n var prototype = color[colorSpaceName].prototype;\n\n ['valueOf', 'hex', 'hexa', 'css', 'cssa'].forEach(function (methodName) {\n prototype[methodName] = prototype[methodName] || (colorSpaceName === 'RGB' ? prototype.hex : function () {\n return this.rgb()[methodName]();\n });\n });\n\n prototype.isColor = true;\n\n prototype.equals = function (otherColor, epsilon) {\n if (undef(epsilon)) {\n epsilon = 1e-10;\n }\n\n otherColor = otherColor[colorSpaceName.toLowerCase()]();\n\n for (var i = 0; i < propertyNames.length; i = i + 1) {\n if (Math.abs(this['_' + propertyNames[i]] - otherColor['_' + propertyNames[i]]) > epsilon) {\n return false;\n }\n }\n\n return true;\n };\n\n prototype.toJSON = function () {\n return [colorSpaceName].concat(propertyNames.map(function (propertyName) {\n return this['_' + propertyName];\n }, this));\n };\n\n for (var propertyName in config) {\n if (config.hasOwnProperty(propertyName)) {\n var matchFromColorSpace = propertyName.match(/^from(.*)$/);\n if (matchFromColorSpace) {\n color[matchFromColorSpace[1].toUpperCase()].prototype[colorSpaceName.toLowerCase()] = config[propertyName];\n } else {\n prototype[propertyName] = config[propertyName];\n }\n }\n }\n\n // It is pretty easy to implement the conversion to the same color space:\n prototype[colorSpaceName.toLowerCase()] = function () {\n return this;\n };\n prototype.toString = function () {\n return '[' + colorSpaceName + ' ' + propertyNames.map(function (propertyName) {\n return this['_' + propertyName];\n }, this).join(', ') + ']';\n };\n\n // Generate getters and setters\n propertyNames.forEach(function (propertyName) {\n var shortName = propertyName === 'black' ? 'k' : propertyName.charAt(0);\n prototype[propertyName] = prototype[shortName] = function (value, isDelta) {\n // Simple getter mode: color.red()\n if (typeof value === 'undefined') {\n return this['_' + propertyName];\n } else if (isDelta) {\n // Adjuster: color.red(+.2, true)\n return new this.constructor(propertyNames.map(function (otherPropertyName) {\n return this['_' + otherPropertyName] + (propertyName === otherPropertyName ? value : 0);\n }, this));\n } else {\n // Setter: color.red(.2);\n return new this.constructor(propertyNames.map(function (otherPropertyName) {\n return (propertyName === otherPropertyName) ? value : this['_' + otherPropertyName];\n }, this));\n }\n };\n });\n\n function installForeignMethods(targetColorSpaceName, sourceColorSpaceName) {\n var obj = {};\n obj[sourceColorSpaceName.toLowerCase()] = function () {\n return this.rgb()[sourceColorSpaceName.toLowerCase()]();\n };\n color[sourceColorSpaceName].propertyNames.forEach(function (propertyName) {\n var shortName = propertyName === 'black' ? 'k' : propertyName.charAt(0);\n obj[propertyName] = obj[shortName] = function (value, isDelta) {\n return this[sourceColorSpaceName.toLowerCase()]()[propertyName](value, isDelta);\n };\n });\n for (var prop in obj) {\n if (obj.hasOwnProperty(prop) && color[targetColorSpaceName].prototype[prop] === undefined) {\n color[targetColorSpaceName].prototype[prop] = obj[prop];\n }\n }\n }\n\n installedColorSpaces.forEach(function (otherColorSpaceName) {\n installForeignMethods(colorSpaceName, otherColorSpaceName);\n installForeignMethods(otherColorSpaceName, colorSpaceName);\n });\n\n installedColorSpaces.push(colorSpaceName);\n return color;\n};\n\ncolor.pluginList = [];\n\ncolor.use = function (plugin) {\n if (color.pluginList.indexOf(plugin) === -1) {\n this.pluginList.push(plugin);\n plugin(color);\n }\n return color;\n};\n\ncolor.installMethod = function (name, fn) {\n installedColorSpaces.forEach(function (colorSpace) {\n color[colorSpace].prototype[name] = fn;\n });\n return this;\n};\n\ncolor.installColorSpace('RGB', ['red', 'green', 'blue', 'alpha'], {\n hex: function () {\n var hexString = (Math.round(255 * this._red) * 0x10000 + Math.round(255 * this._green) * 0x100 + Math.round(255 * this._blue)).toString(16);\n return '#' + ('00000'.substr(0, 6 - hexString.length)) + hexString;\n },\n\n hexa: function () {\n var alphaString = Math.round(this._alpha * 255).toString(16);\n return '#' + '00'.substr(0, 2 - alphaString.length) + alphaString + this.hex().substr(1, 6);\n },\n\n css: function () {\n return 'rgb(' + Math.round(255 * this._red) + ',' + Math.round(255 * this._green) + ',' + Math.round(255 * this._blue) + ')';\n },\n\n cssa: function () {\n return 'rgba(' + Math.round(255 * this._red) + ',' + Math.round(255 * this._green) + ',' + Math.round(255 * this._blue) + ',' + this._alpha + ')';\n }\n});\n\nmodule.exports = color;\n","module.exports = function XYZ(color) {\n color.installColorSpace('XYZ', ['x', 'y', 'z', 'alpha'], {\n fromRgb: function () {\n // http://www.easyrgb.com/index.php?X=MATH&H=02#text2\n var convert = function (channel) {\n return channel > 0.04045 ?\n Math.pow((channel + 0.055) / 1.055, 2.4) :\n channel / 12.92;\n },\n r = convert(this._red),\n g = convert(this._green),\n b = convert(this._blue);\n\n // Reference white point sRGB D65:\n // http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html\n return new color.XYZ(\n r * 0.4124564 + g * 0.3575761 + b * 0.1804375,\n r * 0.2126729 + g * 0.7151522 + b * 0.0721750,\n r * 0.0193339 + g * 0.1191920 + b * 0.9503041,\n this._alpha\n );\n },\n\n rgb: function () {\n // http://www.easyrgb.com/index.php?X=MATH&H=01#text1\n var x = this._x,\n y = this._y,\n z = this._z,\n convert = function (channel) {\n return channel > 0.0031308 ?\n 1.055 * Math.pow(channel, 1 / 2.4) - 0.055 :\n 12.92 * channel;\n };\n\n // Reference white point sRGB D65:\n // http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html\n return new color.RGB(\n convert(x * 3.2404542 + y * -1.5371385 + z * -0.4985314),\n convert(x * -0.9692660 + y * 1.8760108 + z * 0.0415560),\n convert(x * 0.0556434 + y * -0.2040259 + z * 1.0572252),\n this._alpha\n );\n },\n\n lab: function () {\n // http://www.easyrgb.com/index.php?X=MATH&H=07#text7\n var convert = function (channel) {\n return channel > 0.008856 ?\n Math.pow(channel, 1 / 3) :\n 7.787037 * channel + 4 / 29;\n },\n x = convert(this._x / 95.047),\n y = convert(this._y / 100.000),\n z = convert(this._z / 108.883);\n\n return new color.LAB(\n (116 * y) - 16,\n 500 * (x - y),\n 200 * (y - z),\n this._alpha\n );\n }\n });\n};\n","module.exports = function LAB(color) {\n color.use(require('./XYZ.js'));\n\n color.installColorSpace('LAB', ['l', 'a', 'b', 'alpha'], {\n fromRgb: function () {\n return this.xyz().lab();\n },\n\n rgb: function () {\n return this.xyz().rgb();\n },\n\n xyz: function () {\n // http://www.easyrgb.com/index.php?X=MATH&H=08#text8\n var convert = function (channel) {\n var pow = Math.pow(channel, 3);\n return pow > 0.008856 ?\n pow :\n (channel - 16 / 116) / 7.87;\n },\n y = (this._l + 16) / 116,\n x = this._a / 500 + y,\n z = y - this._b / 200;\n\n return new color.XYZ(\n convert(x) * 95.047,\n convert(y) * 100.000,\n convert(z) * 108.883,\n this._alpha\n );\n }\n });\n};\n","module.exports = function HSV(color) {\n color.installColorSpace('HSV', ['hue', 'saturation', 'value', 'alpha'], {\n rgb: function () {\n var hue = this._hue,\n saturation = this._saturation,\n value = this._value,\n i = Math.min(5, Math.floor(hue * 6)),\n f = hue * 6 - i,\n p = value * (1 - saturation),\n q = value * (1 - f * saturation),\n t = value * (1 - (1 - f) * saturation),\n red,\n green,\n blue;\n switch (i) {\n case 0:\n red = value;\n green = t;\n blue = p;\n break;\n case 1:\n red = q;\n green = value;\n blue = p;\n break;\n case 2:\n red = p;\n green = value;\n blue = t;\n break;\n case 3:\n red = p;\n green = q;\n blue = value;\n break;\n case 4:\n red = t;\n green = p;\n blue = value;\n break;\n case 5:\n red = value;\n green = p;\n blue = q;\n break;\n }\n return new color.RGB(red, green, blue, this._alpha);\n },\n\n hsl: function () {\n var l = (2 - this._saturation) * this._value,\n sv = this._saturation * this._value,\n svDivisor = l <= 1 ? l : (2 - l),\n saturation;\n\n // Avoid division by zero when lightness approaches zero:\n if (svDivisor < 1e-9) {\n saturation = 0;\n } else {\n saturation = sv / svDivisor;\n }\n return new color.HSL(this._hue, saturation, l / 2, this._alpha);\n },\n\n fromRgb: function () { // Becomes one.color.RGB.prototype.hsv\n var red = this._red,\n green = this._green,\n blue = this._blue,\n max = Math.max(red, green, blue),\n min = Math.min(red, green, blue),\n delta = max - min,\n hue,\n saturation = (max === 0) ? 0 : (delta / max),\n value = max;\n if (delta === 0) {\n hue = 0;\n } else {\n switch (max) {\n case red:\n hue = (green - blue) / delta / 6 + (green < blue ? 1 : 0);\n break;\n case green:\n hue = (blue - red) / delta / 6 + 1 / 3;\n break;\n case blue:\n hue = (red - green) / delta / 6 + 2 / 3;\n break;\n }\n }\n return new color.HSV(hue, saturation, value, this._alpha);\n }\n });\n};\n","module.exports = function HSL(color) {\n color.use(require('./HSV'));\n\n color.installColorSpace('HSL', ['hue', 'saturation', 'lightness', 'alpha'], {\n hsv: function () {\n // Algorithm adapted from http://wiki.secondlife.com/wiki/Color_conversion_scripts\n var l = this._lightness * 2,\n s = this._saturation * ((l <= 1) ? l : 2 - l),\n saturation;\n\n // Avoid division by zero when l + s is very small (approaching black):\n if (l + s < 1e-9) {\n saturation = 0;\n } else {\n saturation = (2 * s) / (l + s);\n }\n\n return new color.HSV(this._hue, saturation, (l + s) / 2, this._alpha);\n },\n\n rgb: function () {\n return this.hsv().rgb();\n },\n\n fromRgb: function () { // Becomes one.color.RGB.prototype.hsv\n return this.hsv().hsl();\n }\n });\n};\n","module.exports = function CMYK(color) {\n color.installColorSpace('CMYK', ['cyan', 'magenta', 'yellow', 'black', 'alpha'], {\n rgb: function () {\n return new color.RGB((1 - this._cyan * (1 - this._black) - this._black),\n (1 - this._magenta * (1 - this._black) - this._black),\n (1 - this._yellow * (1 - this._black) - this._black),\n this._alpha);\n },\n\n fromRgb: function () { // Becomes one.color.RGB.prototype.cmyk\n // Adapted from http://www.javascripter.net/faq/rgb2cmyk.htm\n var red = this._red,\n green = this._green,\n blue = this._blue,\n cyan = 1 - red,\n magenta = 1 - green,\n yellow = 1 - blue,\n black = 1;\n if (red || green || blue) {\n black = Math.min(cyan, Math.min(magenta, yellow));\n cyan = (cyan - black) / (1 - black);\n magenta = (magenta - black) / (1 - black);\n yellow = (yellow - black) / (1 - black);\n } else {\n black = 1;\n }\n return new color.CMYK(cyan, magenta, yellow, black, this._alpha);\n }\n });\n};\n","module.exports = function namedColors(color) {\n color.namedColors = {\n aliceblue: 'f0f8ff',\n antiquewhite: 'faebd7',\n aqua: '0ff',\n aquamarine: '7fffd4',\n azure: 'f0ffff',\n beige: 'f5f5dc',\n bisque: 'ffe4c4',\n black: '000',\n blanchedalmond: 'ffebcd',\n blue: '00f',\n blueviolet: '8a2be2',\n brown: 'a52a2a',\n burlywood: 'deb887',\n cadetblue: '5f9ea0',\n chartreuse: '7fff00',\n chocolate: 'd2691e',\n coral: 'ff7f50',\n cornflowerblue: '6495ed',\n cornsilk: 'fff8dc',\n crimson: 'dc143c',\n cyan: '0ff',\n darkblue: '00008b',\n darkcyan: '008b8b',\n darkgoldenrod: 'b8860b',\n darkgray: 'a9a9a9',\n darkgrey: 'a9a9a9',\n darkgreen: '006400',\n darkkhaki: 'bdb76b',\n darkmagenta: '8b008b',\n darkolivegreen: '556b2f',\n darkorange: 'ff8c00',\n darkorchid: '9932cc',\n darkred: '8b0000',\n darksalmon: 'e9967a',\n darkseagreen: '8fbc8f',\n darkslateblue: '483d8b',\n darkslategray: '2f4f4f',\n darkslategrey: '2f4f4f',\n darkturquoise: '00ced1',\n darkviolet: '9400d3',\n deeppink: 'ff1493',\n deepskyblue: '00bfff',\n dimgray: '696969',\n dimgrey: '696969',\n dodgerblue: '1e90ff',\n firebrick: 'b22222',\n floralwhite: 'fffaf0',\n forestgreen: '228b22',\n fuchsia: 'f0f',\n gainsboro: 'dcdcdc',\n ghostwhite: 'f8f8ff',\n gold: 'ffd700',\n goldenrod: 'daa520',\n gray: '808080',\n grey: '808080',\n green: '008000',\n greenyellow: 'adff2f',\n honeydew: 'f0fff0',\n hotpink: 'ff69b4',\n indianred: 'cd5c5c',\n indigo: '4b0082',\n ivory: 'fffff0',\n khaki: 'f0e68c',\n lavender: 'e6e6fa',\n lavenderblush: 'fff0f5',\n lawngreen: '7cfc00',\n lemonchiffon: 'fffacd',\n lightblue: 'add8e6',\n lightcoral: 'f08080',\n lightcyan: 'e0ffff',\n lightgoldenrodyellow: 'fafad2',\n lightgray: 'd3d3d3',\n lightgrey: 'd3d3d3',\n lightgreen: '90ee90',\n lightpink: 'ffb6c1',\n lightsalmon: 'ffa07a',\n lightseagreen: '20b2aa',\n lightskyblue: '87cefa',\n lightslategray: '789',\n lightslategrey: '789',\n lightsteelblue: 'b0c4de',\n lightyellow: 'ffffe0',\n lime: '0f0',\n limegreen: '32cd32',\n linen: 'faf0e6',\n magenta: 'f0f',\n maroon: '800000',\n mediumaquamarine: '66cdaa',\n mediumblue: '0000cd',\n mediumorchid: 'ba55d3',\n mediumpurple: '9370d8',\n mediumseagreen: '3cb371',\n mediumslateblue: '7b68ee',\n mediumspringgreen: '00fa9a',\n mediumturquoise: '48d1cc',\n mediumvioletred: 'c71585',\n midnightblue: '191970',\n mintcream: 'f5fffa',\n mistyrose: 'ffe4e1',\n moccasin: 'ffe4b5',\n navajowhite: 'ffdead',\n navy: '000080',\n oldlace: 'fdf5e6',\n olive: '808000',\n olivedrab: '6b8e23',\n orange: 'ffa500',\n orangered: 'ff4500',\n orchid: 'da70d6',\n palegoldenrod: 'eee8aa',\n palegreen: '98fb98',\n paleturquoise: 'afeeee',\n palevioletred: 'd87093',\n papayawhip: 'ffefd5',\n peachpuff: 'ffdab9',\n peru: 'cd853f',\n pink: 'ffc0cb',\n plum: 'dda0dd',\n powderblue: 'b0e0e6',\n purple: '800080',\n rebeccapurple: '639',\n red: 'f00',\n rosybrown: 'bc8f8f',\n royalblue: '4169e1',\n saddlebrown: '8b4513',\n salmon: 'fa8072',\n sandybrown: 'f4a460',\n seagreen: '2e8b57',\n seashell: 'fff5ee',\n sienna: 'a0522d',\n silver: 'c0c0c0',\n skyblue: '87ceeb',\n slateblue: '6a5acd',\n slategray: '708090',\n slategrey: '708090',\n snow: 'fffafa',\n springgreen: '00ff7f',\n steelblue: '4682b4',\n tan: 'd2b48c',\n teal: '008080',\n thistle: 'd8bfd8',\n tomato: 'ff6347',\n turquoise: '40e0d0',\n violet: 'ee82ee',\n wheat: 'f5deb3',\n white: 'fff',\n whitesmoke: 'f5f5f5',\n yellow: 'ff0',\n yellowgreen: '9acd32'\n };\n};\n","module.exports = function clearer(color) {\n color.installMethod('clearer', function (amount) {\n return this.alpha(isNaN(amount) ? -0.1 : -amount, true);\n });\n};\n","module.exports = function luminance(color) {\n // http://www.w3.org/TR/WCAG20/#relativeluminancedef\n\n function channelLuminance(value) {\n return (value <= 0.03928) ? value / 12.92 : Math.pow(((value + 0.055) / 1.055), 2.4);\n }\n\n color.installMethod('luminance', function () {\n var rgb = this.rgb();\n return 0.2126 * channelLuminance(rgb._red) + 0.7152 * channelLuminance(rgb._green) + 0.0722 * channelLuminance(rgb._blue);\n });\n};\n","module.exports = function contrast(color) {\n // http://www.w3.org/TR/WCAG20/#contrast-ratiodef\n\n color.use(require('./luminance'));\n\n color.installMethod('contrast', function (color2) {\n var lum1 = this.luminance();\n var lum2 = color2.luminance();\n if (lum1 > lum2) {\n return (lum1 + 0.05) / (lum2 + 0.05);\n }\n\n return (lum2 + 0.05) / (lum1 + 0.05);\n });\n};\n","module.exports = function darken(color) {\n color.use(require('../HSL'));\n\n color.installMethod('darken', function (amount) {\n return this.lightness(isNaN(amount) ? -0.1 : -amount, true);\n });\n};\n","module.exports = function desaturate(color) {\n color.use(require('../HSL'));\n\n color.installMethod('desaturate', function (amount) {\n return this.saturation(isNaN(amount) ? -0.1 : -amount, true);\n });\n};\n","module.exports = function grayscale(color) {\n function gs () {\n /*jslint strict:false*/\n var rgb = this.rgb(),\n val = rgb._red * 0.3 + rgb._green * 0.59 + rgb._blue * 0.11;\n\n return new color.RGB(val, val, val, rgb._alpha);\n }\n\n color.installMethod('greyscale', gs).installMethod('grayscale', gs);\n};\n","module.exports = function isDark(color) {\n\n color.installMethod('isDark', function () {\n var rgb = this.rgb();\n\n // YIQ equation from http://24ways.org/2010/calculating-color-contrast\n var yiq = (rgb._red * 255 * 299 + rgb._green * 255 * 587 + rgb._blue * 255 * 114) / 1000;\n return yiq < 128;\n });\n};\n","module.exports = function isLight(color) {\n\n color.use(require('./isDark'));\n\n color.installMethod('isLight', function () {\n return !this.isDark();\n });\n};\n","module.exports = function lighten(color) {\n color.use(require('../HSL'));\n\n color.installMethod('lighten', function (amount) {\n return this.lightness(isNaN(amount) ? 0.1 : amount, true);\n });\n};\n","module.exports = function mix(color) {\n color.installMethod('mix', function (otherColor, weight) {\n otherColor = color(otherColor).rgb();\n weight = 1 - (isNaN(weight) ? 0.5 : weight);\n\n var w = weight * 2 - 1,\n a = this._alpha - otherColor._alpha,\n weight1 = (((w * a === -1) ? w : (w + a) / (1 + w * a)) + 1) / 2,\n weight2 = 1 - weight1,\n rgb = this.rgb();\n\n return new color.RGB(\n rgb._red * weight1 + otherColor._red * weight2,\n rgb._green * weight1 + otherColor._green * weight2,\n rgb._blue * weight1 + otherColor._blue * weight2,\n rgb._alpha * weight + otherColor._alpha * (1 - weight)\n );\n });\n};\n","module.exports = function negate(color) {\n color.installMethod('negate', function () {\n var rgb = this.rgb();\n return new color.RGB(1 - rgb._red, 1 - rgb._green, 1 - rgb._blue, this._alpha);\n });\n};\n","module.exports = function opaquer(color) {\n color.installMethod('opaquer', function (amount) {\n return this.alpha(isNaN(amount) ? 0.1 : amount, true);\n });\n};\n","module.exports = function rotate(color) {\n color.use(require('../HSL'));\n\n color.installMethod('rotate', function (degrees) {\n return this.hue((degrees || 0) / 360, true);\n });\n};\n","module.exports = function saturate(color) {\n color.use(require('../HSL'));\n\n color.installMethod('saturate', function (amount) {\n return this.saturation(isNaN(amount) ? 0.1 : amount, true);\n });\n};\n","// Adapted from http://gimp.sourcearchive.com/documentation/2.6.6-1ubuntu1/color-to-alpha_8c-source.html\n// toAlpha returns a color where the values of the argument have been converted to alpha\nmodule.exports = function toAlpha(color) {\n color.installMethod('toAlpha', function (color) {\n var me = this.rgb(),\n other = color(color).rgb(),\n epsilon = 1e-10,\n a = new color.RGB(0, 0, 0, me._alpha),\n channels = ['_red', '_green', '_blue'];\n\n channels.forEach(function (channel) {\n if (me[channel] < epsilon) {\n a[channel] = me[channel];\n } else if (me[channel] > other[channel]) {\n a[channel] = (me[channel] - other[channel]) / (1 - other[channel]);\n } else if (me[channel] > other[channel]) {\n a[channel] = (other[channel] - me[channel]) / other[channel];\n } else {\n a[channel] = 0;\n }\n });\n\n if (a._red > a._green) {\n if (a._red > a._blue) {\n me._alpha = a._red;\n } else {\n me._alpha = a._blue;\n }\n } else if (a._green > a._blue) {\n me._alpha = a._green;\n } else {\n me._alpha = a._blue;\n }\n\n if (me._alpha < epsilon) {\n return me;\n }\n\n channels.forEach(function (channel) {\n me[channel] = (me[channel] - other[channel]) / me._alpha + other[channel];\n });\n me._alpha *= a._alpha;\n\n return me;\n });\n};\n","module.exports = require('./lib/color')\n .use(require('./lib/XYZ'))\n .use(require('./lib/LAB'))\n .use(require('./lib/HSV'))\n .use(require('./lib/HSL'))\n .use(require('./lib/CMYK'))\n\n // Convenience functions\n .use(require('./lib/plugins/namedColors'))\n .use(require('./lib/plugins/clearer.js'))\n .use(require('./lib/plugins/contrast.js'))\n .use(require('./lib/plugins/darken.js'))\n .use(require('./lib/plugins/desaturate.js'))\n .use(require('./lib/plugins/grayscale.js'))\n .use(require('./lib/plugins/isDark.js'))\n .use(require('./lib/plugins/isLight.js'))\n .use(require('./lib/plugins/lighten.js'))\n .use(require('./lib/plugins/luminance.js'))\n .use(require('./lib/plugins/mix.js'))\n .use(require('./lib/plugins/negate.js'))\n .use(require('./lib/plugins/opaquer.js'))\n .use(require('./lib/plugins/rotate.js'))\n .use(require('./lib/plugins/saturate.js'))\n .use(require('./lib/plugins/toAlpha.js'));\n"]} \ No newline at end of file diff --git a/one-color.js b/one-color.js index fd29d3b..431b244 100644 --- a/one-color.js +++ b/one-color.js @@ -1,2 +1,2 @@ -!function(t,r){"object"==typeof exports&&"undefined"!=typeof module?module.exports=r():"function"==typeof define&&define.amd?define(r):(t.one=t.one||{},t.one.color=r())}(this,function(){"use strict";function t(r){if(Array.isArray(r)){if("string"==typeof r[0]&&"function"==typeof t[r[0]])return new t[r[0]](r.slice(1,r.length));if(4===r.length)return new t.RGB(r[0]/255,r[1]/255,r[2]/255,r[3]/255)}else if("string"==typeof r){var n=r.toLowerCase();t.namedColors[n]&&(r="#"+t.namedColors[n]),"transparent"===n&&(r="rgba(0,0,0,0)");var s=r.match(o);if(s){var i=s[1].toUpperCase(),u=e(s[8])?s[8]:parseFloat(s[8]),h="H"===i[0],c=s[3]?100:h?360:255,f=s[5]||h?100:255,l=s[7]||h?100:255;if(e(t[i]))throw new Error("color."+i+" is not installed.");return new t[i](parseFloat(s[2])/c,parseFloat(s[4])/f,parseFloat(s[6])/l,u)}r.length<6&&(r=r.replace(/^#?([0-9a-f])([0-9a-f])([0-9a-f])$/i,"$1$1$2$2$3$3"));var p=r.match(/^#?([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])$/i);if(p)return new t.RGB(parseInt(p[1],16)/255,parseInt(p[2],16)/255,parseInt(p[3],16)/255);if(t.CMYK){var d=r.match(new RegExp("^cmyk\\("+a.source+","+a.source+","+a.source+","+a.source+"\\)$","i"));if(d)return new t.CMYK(parseFloat(d[1])/100,parseFloat(d[2])/100,parseFloat(d[3])/100,parseFloat(d[4])/100)}}else if("object"==typeof r&&r.isColor)return r;return!1}var r=[],e=function(t){return void 0===t},n=/\s*(\.\d+|\d+(?:\.\d+)?)(%)?\s*/,a=/\s*(\.\d+|100|\d?\d(?:\.\d+)?)%\s*/,o=new RegExp("^(rgb|hsl|hsv)a?\\("+n.source+","+n.source+","+n.source+"(?:,"+/\s*(\.\d+|\d+(?:\.\d+)?)\s*/.source+")?\\)$","i");t.namedColors={},t.installColorSpace=function(n,a,o){function s(r,e){var n={};n[e.toLowerCase()]=function(){return this.rgb()[e.toLowerCase()]()},t[e].propertyNames.forEach(function(t){var r="black"===t?"k":t.charAt(0);n[t]=n[r]=function(r,n){return this[e.toLowerCase()]()[t](r,n)}});for(var a in n)n.hasOwnProperty(a)&&void 0===t[r].prototype[a]&&(t[r].prototype[a]=n[a])}t[n]=function(t){var r=Array.isArray(t)?t:arguments;a.forEach(function(t,e){var o=r[e];if("alpha"===t)this._alpha=isNaN(o)||o>1?1:o<0?0:o;else{if(isNaN(o))throw new Error("["+n+"]: Invalid color: ("+a.join(",")+")");"hue"===t?this._hue=o<0?o-Math.floor(o):o%1:this["_"+t]=o<0?0:o>1?1:o}},this)},t[n].propertyNames=a;var i=t[n].prototype;["valueOf","hex","hexa","css","cssa"].forEach(function(t){i[t]=i[t]||("RGB"===n?i.hex:function(){return this.rgb()[t]()})}),i.isColor=!0,i.equals=function(t,r){e(r)&&(r=1e-10),t=t[n.toLowerCase()]();for(var o=0;or)return!1;return!0},i.toJSON=function(){return[n].concat(a.map(function(t){return this["_"+t]},this))};for(var u in o)if(o.hasOwnProperty(u)){var h=u.match(/^from(.*)$/);h?t[h[1].toUpperCase()].prototype[n.toLowerCase()]=o[u]:i[u]=o[u]}return i[n.toLowerCase()]=function(){return this},i.toString=function(){return"["+n+" "+a.map(function(t){return this["_"+t]},this).join(", ")+"]"},a.forEach(function(t){var r="black"===t?"k":t.charAt(0);i[t]=i[r]=function(r,e){return void 0===r?this["_"+t]:e?new this.constructor(a.map(function(e){return this["_"+e]+(t===e?r:0)},this)):new this.constructor(a.map(function(e){return t===e?r:this["_"+e]},this))}}),r.forEach(function(t){s(n,t),s(t,n)}),r.push(n),t},t.pluginList=[],t.use=function(r){return-1===t.pluginList.indexOf(r)&&(this.pluginList.push(r),r(t)),t},t.installMethod=function(e,n){return r.forEach(function(r){t[r].prototype[e]=n}),this},t.installColorSpace("RGB",["red","green","blue","alpha"],{hex:function(){var t=(65536*Math.round(255*this._red)+256*Math.round(255*this._green)+Math.round(255*this._blue)).toString(16);return"#"+"00000".substr(0,6-t.length)+t},hexa:function(){var t=Math.round(255*this._alpha).toString(16);return"#"+"00".substr(0,2-t.length)+t+this.hex().substr(1,6)},css:function(){return"rgb("+Math.round(255*this._red)+","+Math.round(255*this._green)+","+Math.round(255*this._blue)+")"},cssa:function(){return"rgba("+Math.round(255*this._red)+","+Math.round(255*this._green)+","+Math.round(255*this._blue)+","+this._alpha+")"}});var s=t,i=function(t){t.installColorSpace("HSV",["hue","saturation","value","alpha"],{rgb:function(){var r,e,n,a=this._hue,o=this._saturation,s=this._value,i=Math.min(5,Math.floor(6*a)),u=6*a-i,h=s*(1-o),c=s*(1-u*o),f=s*(1-(1-u)*o);switch(i){case 0:r=s,e=f,n=h;break;case 1:r=c,e=s,n=h;break;case 2:r=h,e=s,n=f;break;case 3:r=h,e=c,n=s;break;case 4:r=f,e=h,n=s;break;case 5:r=s,e=h,n=c}return new t.RGB(r,e,n,this._alpha)},hsl:function(){var r,e=(2-this._saturation)*this._value,n=this._saturation*this._value,a=e<=1?e:2-e;return r=a<1e-9?0:n/a,new t.HSL(this._hue,r,e/2,this._alpha)},fromRgb:function(){var r,e=this._red,n=this._green,a=this._blue,o=Math.max(e,n,a),s=Math.min(e,n,a),i=o-s,u=0===o?0:i/o,h=o;if(0===i)r=0;else switch(o){case e:r=(n-a)/i/6+(n1?1:o<0?0:o;else{if(isNaN(o))throw new Error("["+e+"]: Invalid color: ("+n.join(",")+")");"hue"===t?this._hue=o<0?o-Math.floor(o):o%1:this["_"+t]=o<0?0:o>1?1:o}}),this)},o[e].propertyNames=n;var s=o[e].prototype;for(var i in["valueOf","hex","hexa","css","cssa"].forEach((function(t){s[t]=s[t]||("RGB"===e?s.hex:function(){return this.rgb()[t]()})})),s.isColor=!0,s.equals=function(t,a){r(a)&&(a=1e-10),t=t[e.toLowerCase()]();for(var o=0;oa)return!1;return!0},s.toJSON=function(){return[e].concat(n.map((function(t){return this["_"+t]}),this))},a)if(Object.prototype.hasOwnProperty.call(a,i)){var u=i.match(/^from(.*)$/);u?o[u[1].toUpperCase()].prototype[e.toLowerCase()]=a[i]:s[i]=a[i]}function h(t,r){var e={};for(var n in e[r.toLowerCase()]=function(){return this.rgb()[r.toLowerCase()]()},o[r].propertyNames.forEach((function(t){var n="black"===t?"k":t.charAt(0);e[t]=e[n]=function(e,n){return this[r.toLowerCase()]()[t](e,n)}})),e)Object.prototype.hasOwnProperty.call(e,n)&&void 0===o[t].prototype[n]&&(o[t].prototype[n]=e[n])}return s[e.toLowerCase()]=function(){return this},s.toString=function(){return"["+e+" "+n.map((function(t){return this["_"+t]}),this).join(", ")+"]"},n.forEach((function(t){var r="black"===t?"k":t.charAt(0);s[t]=s[r]=function(r,e){return void 0===r?this["_"+t]:e?new this.constructor(n.map((function(e){return this["_"+e]+(t===e?r:0)}),this)):new this.constructor(n.map((function(e){return t===e?r:this["_"+e]}),this))}})),t.forEach((function(t){h(e,t),h(t,e)})),t.push(e),o},o.pluginList=[],o.use=function(t){return-1===o.pluginList.indexOf(t)&&(this.pluginList.push(t),t(o)),o},o.installMethod=function(r,e){return t.forEach((function(t){o[t].prototype[r]=e})),this},o.installColorSpace("RGB",["red","green","blue","alpha"],{hex:function(){var t=(65536*Math.round(255*this._red)+256*Math.round(255*this._green)+Math.round(255*this._blue)).toString(16);return"#"+"00000".substr(0,6-t.length)+t},hexa:function(){var t=Math.round(255*this._alpha).toString(16);return"#"+"00".substr(0,2-t.length)+t+this.hex().substr(1,6)},css:function(){return"rgb("+Math.round(255*this._red)+","+Math.round(255*this._green)+","+Math.round(255*this._blue)+")"},cssa:function(){return"rgba("+Math.round(255*this._red)+","+Math.round(255*this._green)+","+Math.round(255*this._blue)+","+this._alpha+")"}});var s=function(t){t.installColorSpace("HSV",["hue","saturation","value","alpha"],{rgb:function(){var r,e,n,a=this._hue,o=this._saturation,s=this._value,i=Math.min(5,Math.floor(6*a)),u=6*a-i,h=s*(1-o),c=s*(1-u*o),f=s*(1-(1-u)*o);switch(i){case 0:r=s,e=f,n=h;break;case 1:r=c,e=s,n=h;break;case 2:r=h,e=s,n=f;break;case 3:r=h,e=c,n=s;break;case 4:r=f,e=h,n=s;break;case 5:r=s,e=h,n=c}return new t.RGB(r,e,n,this._alpha)},hsl:function(){var r,e=(2-this._saturation)*this._value,n=this._saturation*this._value,a=e<=1?e:2-e;return r=a<1e-9?0:n/a,new t.HSL(this._hue,r,e/2,this._alpha)},fromRgb:function(){var r,e=this._red,n=this._green,a=this._blue,o=Math.max(e,n,a),s=o-Math.min(e,n,a),i=0===o?0:s/o,u=o;if(0===s)r=0;else switch(o){case e:r=(n-a)/s/6+(n 1\n ? 1\n : propertyValue < 0\n ? 0\n : propertyValue;\n } else {\n if (isNaN(propertyValue)) {\n throw new Error(\n '[' +\n colorSpaceName +\n ']: Invalid color: (' +\n propertyNames.join(',') +\n ')'\n );\n }\n if (propertyName === 'hue') {\n this._hue =\n propertyValue < 0\n ? propertyValue - Math.floor(propertyValue)\n : propertyValue % 1;\n } else {\n this['_' + propertyName] =\n propertyValue < 0 ? 0 : propertyValue > 1 ? 1 : propertyValue;\n }\n }\n }, this);\n };\n color[colorSpaceName].propertyNames = propertyNames;\n\n var prototype = color[colorSpaceName].prototype;\n\n ['valueOf', 'hex', 'hexa', 'css', 'cssa'].forEach(function (methodName) {\n prototype[methodName] =\n prototype[methodName] ||\n (colorSpaceName === 'RGB'\n ? prototype.hex\n : function () {\n return this.rgb()[methodName]();\n });\n });\n\n prototype.isColor = true;\n\n prototype.equals = function (otherColor, epsilon) {\n if (undef(epsilon)) {\n epsilon = 1e-10;\n }\n\n otherColor = otherColor[colorSpaceName.toLowerCase()]();\n\n for (var i = 0; i < propertyNames.length; i = i + 1) {\n if (\n Math.abs(\n this['_' + propertyNames[i]] - otherColor['_' + propertyNames[i]]\n ) > epsilon\n ) {\n return false;\n }\n }\n\n return true;\n };\n\n prototype.toJSON = function () {\n return [colorSpaceName].concat(\n propertyNames.map(function (propertyName) {\n return this['_' + propertyName];\n }, this)\n );\n };\n\n for (var propertyName in config) {\n if (Object.prototype.hasOwnProperty.call(config, propertyName)) {\n var matchFromColorSpace = propertyName.match(/^from(.*)$/);\n if (matchFromColorSpace) {\n color[matchFromColorSpace[1].toUpperCase()].prototype[\n colorSpaceName.toLowerCase()\n ] = config[propertyName];\n } else {\n prototype[propertyName] = config[propertyName];\n }\n }\n }\n\n // It is pretty easy to implement the conversion to the same color space:\n prototype[colorSpaceName.toLowerCase()] = function () {\n return this;\n };\n prototype.toString = function () {\n return (\n '[' +\n colorSpaceName +\n ' ' +\n propertyNames\n .map(function (propertyName) {\n return this['_' + propertyName];\n }, this)\n .join(', ') +\n ']'\n );\n };\n\n // Generate getters and setters\n propertyNames.forEach(function (propertyName) {\n var shortName = propertyName === 'black' ? 'k' : propertyName.charAt(0);\n prototype[propertyName] = prototype[shortName] = function (value, isDelta) {\n // Simple getter mode: color.red()\n if (typeof value === 'undefined') {\n return this['_' + propertyName];\n } else if (isDelta) {\n // Adjuster: color.red(+.2, true)\n return new this.constructor(\n propertyNames.map(function (otherPropertyName) {\n return (\n this['_' + otherPropertyName] +\n (propertyName === otherPropertyName ? value : 0)\n );\n }, this)\n );\n } else {\n // Setter: color.red(.2);\n return new this.constructor(\n propertyNames.map(function (otherPropertyName) {\n return propertyName === otherPropertyName\n ? value\n : this['_' + otherPropertyName];\n }, this)\n );\n }\n };\n });\n\n function installForeignMethods(targetColorSpaceName, sourceColorSpaceName) {\n var obj = {};\n obj[sourceColorSpaceName.toLowerCase()] = function () {\n return this.rgb()[sourceColorSpaceName.toLowerCase()]();\n };\n color[sourceColorSpaceName].propertyNames.forEach(function (propertyName) {\n var shortName = propertyName === 'black' ? 'k' : propertyName.charAt(0);\n obj[propertyName] = obj[shortName] = function (value, isDelta) {\n return this[sourceColorSpaceName.toLowerCase()]()[propertyName](\n value,\n isDelta\n );\n };\n });\n for (var prop in obj) {\n if (\n Object.prototype.hasOwnProperty.call(obj, prop) &&\n color[targetColorSpaceName].prototype[prop] === undefined\n ) {\n color[targetColorSpaceName].prototype[prop] = obj[prop];\n }\n }\n }\n\n installedColorSpaces.forEach(function (otherColorSpaceName) {\n installForeignMethods(colorSpaceName, otherColorSpaceName);\n installForeignMethods(otherColorSpaceName, colorSpaceName);\n });\n\n installedColorSpaces.push(colorSpaceName);\n return color;\n};\n\ncolor.pluginList = [];\n\ncolor.use = function (plugin) {\n if (color.pluginList.indexOf(plugin) === -1) {\n this.pluginList.push(plugin);\n plugin(color);\n }\n return color;\n};\n\ncolor.installMethod = function (name, fn) {\n installedColorSpaces.forEach(function (colorSpace) {\n color[colorSpace].prototype[name] = fn;\n });\n return this;\n};\n\ncolor.installColorSpace('RGB', ['red', 'green', 'blue', 'alpha'], {\n hex: function () {\n var hexString = (\n Math.round(255 * this._red) * 0x10000 +\n Math.round(255 * this._green) * 0x100 +\n Math.round(255 * this._blue)\n ).toString(16);\n return '#' + '00000'.substr(0, 6 - hexString.length) + hexString;\n },\n\n hexa: function () {\n var alphaString = Math.round(this._alpha * 255).toString(16);\n return (\n '#' +\n '00'.substr(0, 2 - alphaString.length) +\n alphaString +\n this.hex().substr(1, 6)\n );\n },\n\n css: function () {\n return (\n 'rgb(' +\n Math.round(255 * this._red) +\n ',' +\n Math.round(255 * this._green) +\n ',' +\n Math.round(255 * this._blue) +\n ')'\n );\n },\n\n cssa: function () {\n return (\n 'rgba(' +\n Math.round(255 * this._red) +\n ',' +\n Math.round(255 * this._green) +\n ',' +\n Math.round(255 * this._blue) +\n ',' +\n this._alpha +\n ')'\n );\n },\n});\n\nmodule.exports = color;\n","module.exports = function HSV(color) {\n color.installColorSpace('HSV', ['hue', 'saturation', 'value', 'alpha'], {\n rgb: function () {\n var hue = this._hue;\n var saturation = this._saturation;\n var value = this._value;\n var i = Math.min(5, Math.floor(hue * 6));\n var f = hue * 6 - i;\n var p = value * (1 - saturation);\n var q = value * (1 - f * saturation);\n var t = value * (1 - (1 - f) * saturation);\n var red;\n var green;\n var blue;\n switch (i) {\n case 0:\n red = value;\n green = t;\n blue = p;\n break;\n case 1:\n red = q;\n green = value;\n blue = p;\n break;\n case 2:\n red = p;\n green = value;\n blue = t;\n break;\n case 3:\n red = p;\n green = q;\n blue = value;\n break;\n case 4:\n red = t;\n green = p;\n blue = value;\n break;\n case 5:\n red = value;\n green = p;\n blue = q;\n break;\n }\n return new color.RGB(red, green, blue, this._alpha);\n },\n\n hsl: function () {\n var l = (2 - this._saturation) * this._value;\n var sv = this._saturation * this._value;\n var svDivisor = l <= 1 ? l : 2 - l;\n var saturation;\n\n // Avoid division by zero when lightness approaches zero:\n if (svDivisor < 1e-9) {\n saturation = 0;\n } else {\n saturation = sv / svDivisor;\n }\n return new color.HSL(this._hue, saturation, l / 2, this._alpha);\n },\n\n fromRgb: function () {\n // Becomes one.color.RGB.prototype.hsv\n var red = this._red;\n var green = this._green;\n var blue = this._blue;\n var max = Math.max(red, green, blue);\n var min = Math.min(red, green, blue);\n var delta = max - min;\n var hue;\n var saturation = max === 0 ? 0 : delta / max;\n var value = max;\n if (delta === 0) {\n hue = 0;\n } else {\n switch (max) {\n case red:\n hue = (green - blue) / delta / 6 + (green < blue ? 1 : 0);\n break;\n case green:\n hue = (blue - red) / delta / 6 + 1 / 3;\n break;\n case blue:\n hue = (red - green) / delta / 6 + 2 / 3;\n break;\n }\n }\n return new color.HSV(hue, saturation, value, this._alpha);\n },\n });\n};\n","module.exports = require('./lib/color')\n .use(require('./lib/HSV'))\n .use(require('./lib/HSL'));\n","module.exports = function HSL(color) {\n color.use(require('./HSV'));\n\n color.installColorSpace('HSL', ['hue', 'saturation', 'lightness', 'alpha'], {\n hsv: function () {\n // Algorithm adapted from http://wiki.secondlife.com/wiki/Color_conversion_scripts\n var l = this._lightness * 2;\n var s = this._saturation * (l <= 1 ? l : 2 - l);\n var saturation;\n\n // Avoid division by zero when l + s is very small (approaching black):\n if (l + s < 1e-9) {\n saturation = 0;\n } else {\n saturation = (2 * s) / (l + s);\n }\n\n return new color.HSV(this._hue, saturation, (l + s) / 2, this._alpha);\n },\n\n rgb: function () {\n return this.hsv().rgb();\n },\n\n fromRgb: function () {\n // Becomes one.color.RGB.prototype.hsv\n return this.hsv().hsl();\n },\n });\n};\n"],"names":["installedColorSpaces","undef","obj","channelRegExp","percentageChannelRegExp","cssColorRegExp","RegExp","source","color","Array","isArray","slice","length","RGB","lowerCased","toLowerCase","namedColors","matchCssSyntax","match","colorSpaceName","toUpperCase","alpha","parseFloat","hasHue","firstChannelDivisor","secondChannelDivisor","thirdChannelDivisor","Error","replace","hexMatch","parseInt","CMYK","cmykMatch","isColor","installColorSpace","propertyNames","config","a1","args","arguments","forEach","propertyName","i","propertyValue","this","_alpha","isNaN","join","_hue","Math","floor","prototype","methodName","hex","rgb","equals","otherColor","epsilon","abs","toJSON","concat","map","Object","hasOwnProperty","call","matchFromColorSpace","installForeignMethods","targetColorSpaceName","sourceColorSpaceName","prop","shortName","charAt","value","isDelta","undefined","toString","constructor","otherPropertyName","otherColorSpaceName","push","pluginList","use","plugin","indexOf","installMethod","name","fn","colorSpace","hexString","round","_red","_green","_blue","substr","hexa","alphaString","css","cssa","red","green","blue","hue","saturation","_saturation","_value","min","f","p","q","t","hsl","l","sv","svDivisor","HSL","fromRgb","max","delta","HSV","require$$1","require$$0","hsv","_lightness","s"],"mappings":"kNAAA,IAAIA,EAAuB,GACvBC,EAAQ,SAAUC,GACpB,YAAsB,IAARA,GAEZC,EAAgB,kCAChBC,EAA0B,qCAE1BC,EAAiB,IAAIC,OACvB,sBAEEH,EAAcI,OACd,IACAJ,EAAcI,OACd,IACAJ,EAAcI,OACd,OATqB,8BAUFA,OARrB,SAWA,KAGF,SAASC,EAAMN,GACb,GAAIO,MAAMC,QAAQR,GAAM,CACtB,GAA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,IAAK,WACH,OAAOV,KAAK6E,MAAMnE,OAGpB6D,QAAS,WAEP,OAAOvE,KAAK6E,MAAMX"} \ No newline at end of file diff --git a/one-color.map b/one-color.map deleted file mode 100644 index 33951ff..0000000 --- a/one-color.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["lib/color.js","lib/HSV.js","lib/HSL.js","minimal.js"],"names":["color","obj","Array","isArray","slice","length","RGB","lowerCased","toLowerCase","namedColors","matchCssSyntax","match","cssColorRegExp","colorSpaceName","toUpperCase","alpha","undef","parseFloat","hasHue","firstChannelDivisor","secondChannelDivisor","thirdChannelDivisor","Error","replace","hexMatch","parseInt","CMYK","cmykMatch","RegExp","percentageChannelRegExp","source","isColor","installedColorSpaces","channelRegExp","installColorSpace","propertyNames","config","installForeignMethods","targetColorSpaceName","sourceColorSpaceName","this","rgb","forEach","propertyName","shortName","charAt","value","isDelta","prop","hasOwnProperty","undefined","prototype","a1","args","arguments","i","propertyValue","_alpha","isNaN","join","_hue","Math","floor","methodName","hex","equals","otherColor","epsilon","abs","toJSON","concat","map","matchFromColorSpace","toString","constructor","otherPropertyName","otherColorSpaceName","push","pluginList","use","plugin","indexOf","installMethod","name","fn","colorSpace","hexString","round","_red","_green","_blue","substr","hexa","alphaString","css","cssa","color_1","HSV","red","green","blue","hue","saturation","_saturation","_value","min","f","p","q","t","hsl","l","sv","svDivisor","HSL","fromRgb","max","delta","require$$0","hsv","_lightness","s","require$$1","require$$2"],"mappings":"sMAgBA,SAASA,GAAMC,GACX,GAAIC,MAAMC,QAAQF,GAAM,CACpB,GAAsB,gBAAXA,GAAI,IAA4C,kBAAlBD,GAAMC,EAAI,IAE/C,MAAO,IAAID,GAAMC,EAAI,IAAIA,EAAIG,MAAM,EAAGH,EAAII,QACvC,IAAmB,IAAfJ,EAAII,OAEX,MAAO,IAAIL,GAAMM,IAAIL,EAAI,GAAK,IAAKA,EAAI,GAAK,IAAKA,EAAI,GAAK,IAAKA,EAAI,GAAK,SAEzE,IAA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AO3E,MAAK+E,MAAMT,gBCzBbQ,GACZvC,IAAI2C,GACJ3C,IAAI4C","sourcesContent":["var installedColorSpaces = [],\n undef = function (obj) {\n return typeof obj === 'undefined';\n },\n channelRegExp = /\\s*(\\.\\d+|\\d+(?:\\.\\d+)?)(%)?\\s*/,\n percentageChannelRegExp = /\\s*(\\.\\d+|100|\\d?\\d(?:\\.\\d+)?)%\\s*/,\n alphaChannelRegExp = /\\s*(\\.\\d+|\\d+(?:\\.\\d+)?)\\s*/,\n cssColorRegExp = new RegExp(\n '^(rgb|hsl|hsv)a?' +\n '\\\\(' +\n channelRegExp.source + ',' +\n channelRegExp.source + ',' +\n channelRegExp.source +\n '(?:,' + alphaChannelRegExp.source + ')?' +\n '\\\\)$', 'i');\n\nfunction color(obj) {\n if (Array.isArray(obj)) {\n if (typeof obj[0] === 'string' && typeof color[obj[0]] === 'function') {\n // Assumed array from .toJSON()\n return new color[obj[0]](obj.slice(1, obj.length));\n } else if (obj.length === 4) {\n // Assumed 4 element int RGB array from canvas with all channels [0;255]\n return new color.RGB(obj[0] / 255, obj[1] / 255, obj[2] / 255, obj[3] / 255);\n }\n } else if (typeof obj === 'string') {\n var lowerCased = obj.toLowerCase();\n if (color.namedColors[lowerCased]) {\n obj = '#' + color.namedColors[lowerCased];\n }\n if (lowerCased === 'transparent') {\n obj = 'rgba(0,0,0,0)';\n }\n // Test for CSS rgb(....) string\n var matchCssSyntax = obj.match(cssColorRegExp);\n if (matchCssSyntax) {\n var colorSpaceName = matchCssSyntax[1].toUpperCase(),\n alpha = undef(matchCssSyntax[8]) ? matchCssSyntax[8] : parseFloat(matchCssSyntax[8]),\n hasHue = colorSpaceName[0] === 'H',\n firstChannelDivisor = matchCssSyntax[3] ? 100 : (hasHue ? 360 : 255),\n secondChannelDivisor = (matchCssSyntax[5] || hasHue) ? 100 : 255,\n thirdChannelDivisor = (matchCssSyntax[7] || hasHue) ? 100 : 255;\n if (undef(color[colorSpaceName])) {\n throw new Error('color.' + colorSpaceName + ' is not installed.');\n }\n return new color[colorSpaceName](\n parseFloat(matchCssSyntax[2]) / firstChannelDivisor,\n parseFloat(matchCssSyntax[4]) / secondChannelDivisor,\n parseFloat(matchCssSyntax[6]) / thirdChannelDivisor,\n alpha\n );\n }\n // Assume hex syntax\n if (obj.length < 6) {\n // Allow CSS shorthand\n obj = obj.replace(/^#?([0-9a-f])([0-9a-f])([0-9a-f])$/i, '$1$1$2$2$3$3');\n }\n // Split obj into red, green, and blue components\n var hexMatch = obj.match(/^#?([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])$/i);\n if (hexMatch) {\n return new color.RGB(\n parseInt(hexMatch[1], 16) / 255,\n parseInt(hexMatch[2], 16) / 255,\n parseInt(hexMatch[3], 16) / 255\n );\n }\n\n // No match so far. Lets try the less likely ones\n if (color.CMYK) {\n var cmykMatch = obj.match(new RegExp(\n '^cmyk' +\n '\\\\(' +\n percentageChannelRegExp.source + ',' +\n percentageChannelRegExp.source + ',' +\n percentageChannelRegExp.source + ',' +\n percentageChannelRegExp.source +\n '\\\\)$', 'i'));\n if (cmykMatch) {\n return new color.CMYK(\n parseFloat(cmykMatch[1]) / 100,\n parseFloat(cmykMatch[2]) / 100,\n parseFloat(cmykMatch[3]) / 100,\n parseFloat(cmykMatch[4]) / 100\n );\n }\n }\n } else if (typeof obj === 'object' && obj.isColor) {\n return obj;\n }\n return false;\n}\n\ncolor.namedColors = {};\n\ncolor.installColorSpace = function (colorSpaceName, propertyNames, config) {\n color[colorSpaceName] = function (a1) { // ...\n var args = Array.isArray(a1) ? a1 : arguments;\n propertyNames.forEach(function (propertyName, i) {\n var propertyValue = args[i];\n if (propertyName === 'alpha') {\n this._alpha = (isNaN(propertyValue) || propertyValue > 1) ? 1 : (propertyValue < 0 ? 0 : propertyValue);\n } else {\n if (isNaN(propertyValue)) {\n throw new Error('[' + colorSpaceName + ']: Invalid color: (' + propertyNames.join(',') + ')');\n }\n if (propertyName === 'hue') {\n this._hue = propertyValue < 0 ? propertyValue - Math.floor(propertyValue) : propertyValue % 1;\n } else {\n this['_' + propertyName] = propertyValue < 0 ? 0 : (propertyValue > 1 ? 1 : propertyValue);\n }\n }\n }, this);\n };\n color[colorSpaceName].propertyNames = propertyNames;\n\n var prototype = color[colorSpaceName].prototype;\n\n ['valueOf', 'hex', 'hexa', 'css', 'cssa'].forEach(function (methodName) {\n prototype[methodName] = prototype[methodName] || (colorSpaceName === 'RGB' ? prototype.hex : function () {\n return this.rgb()[methodName]();\n });\n });\n\n prototype.isColor = true;\n\n prototype.equals = function (otherColor, epsilon) {\n if (undef(epsilon)) {\n epsilon = 1e-10;\n }\n\n otherColor = otherColor[colorSpaceName.toLowerCase()]();\n\n for (var i = 0; i < propertyNames.length; i = i + 1) {\n if (Math.abs(this['_' + propertyNames[i]] - otherColor['_' + propertyNames[i]]) > epsilon) {\n return false;\n }\n }\n\n return true;\n };\n\n prototype.toJSON = function () {\n return [colorSpaceName].concat(propertyNames.map(function (propertyName) {\n return this['_' + propertyName];\n }, this));\n };\n\n for (var propertyName in config) {\n if (config.hasOwnProperty(propertyName)) {\n var matchFromColorSpace = propertyName.match(/^from(.*)$/);\n if (matchFromColorSpace) {\n color[matchFromColorSpace[1].toUpperCase()].prototype[colorSpaceName.toLowerCase()] = config[propertyName];\n } else {\n prototype[propertyName] = config[propertyName];\n }\n }\n }\n\n // It is pretty easy to implement the conversion to the same color space:\n prototype[colorSpaceName.toLowerCase()] = function () {\n return this;\n };\n prototype.toString = function () {\n return '[' + colorSpaceName + ' ' + propertyNames.map(function (propertyName) {\n return this['_' + propertyName];\n }, this).join(', ') + ']';\n };\n\n // Generate getters and setters\n propertyNames.forEach(function (propertyName) {\n var shortName = propertyName === 'black' ? 'k' : propertyName.charAt(0);\n prototype[propertyName] = prototype[shortName] = function (value, isDelta) {\n // Simple getter mode: color.red()\n if (typeof value === 'undefined') {\n return this['_' + propertyName];\n } else if (isDelta) {\n // Adjuster: color.red(+.2, true)\n return new this.constructor(propertyNames.map(function (otherPropertyName) {\n return this['_' + otherPropertyName] + (propertyName === otherPropertyName ? value : 0);\n }, this));\n } else {\n // Setter: color.red(.2);\n return new this.constructor(propertyNames.map(function (otherPropertyName) {\n return (propertyName === otherPropertyName) ? value : this['_' + otherPropertyName];\n }, this));\n }\n };\n });\n\n function installForeignMethods(targetColorSpaceName, sourceColorSpaceName) {\n var obj = {};\n obj[sourceColorSpaceName.toLowerCase()] = function () {\n return this.rgb()[sourceColorSpaceName.toLowerCase()]();\n };\n color[sourceColorSpaceName].propertyNames.forEach(function (propertyName) {\n var shortName = propertyName === 'black' ? 'k' : propertyName.charAt(0);\n obj[propertyName] = obj[shortName] = function (value, isDelta) {\n return this[sourceColorSpaceName.toLowerCase()]()[propertyName](value, isDelta);\n };\n });\n for (var prop in obj) {\n if (obj.hasOwnProperty(prop) && color[targetColorSpaceName].prototype[prop] === undefined) {\n color[targetColorSpaceName].prototype[prop] = obj[prop];\n }\n }\n }\n\n installedColorSpaces.forEach(function (otherColorSpaceName) {\n installForeignMethods(colorSpaceName, otherColorSpaceName);\n installForeignMethods(otherColorSpaceName, colorSpaceName);\n });\n\n installedColorSpaces.push(colorSpaceName);\n return color;\n};\n\ncolor.pluginList = [];\n\ncolor.use = function (plugin) {\n if (color.pluginList.indexOf(plugin) === -1) {\n this.pluginList.push(plugin);\n plugin(color);\n }\n return color;\n};\n\ncolor.installMethod = function (name, fn) {\n installedColorSpaces.forEach(function (colorSpace) {\n color[colorSpace].prototype[name] = fn;\n });\n return this;\n};\n\ncolor.installColorSpace('RGB', ['red', 'green', 'blue', 'alpha'], {\n hex: function () {\n var hexString = (Math.round(255 * this._red) * 0x10000 + Math.round(255 * this._green) * 0x100 + Math.round(255 * this._blue)).toString(16);\n return '#' + ('00000'.substr(0, 6 - hexString.length)) + hexString;\n },\n\n hexa: function () {\n var alphaString = Math.round(this._alpha * 255).toString(16);\n return '#' + '00'.substr(0, 2 - alphaString.length) + alphaString + this.hex().substr(1, 6);\n },\n\n css: function () {\n return 'rgb(' + Math.round(255 * this._red) + ',' + Math.round(255 * this._green) + ',' + Math.round(255 * this._blue) + ')';\n },\n\n cssa: function () {\n return 'rgba(' + Math.round(255 * this._red) + ',' + Math.round(255 * this._green) + ',' + Math.round(255 * this._blue) + ',' + this._alpha + ')';\n }\n});\n\nmodule.exports = color;\n","module.exports = function HSV(color) {\n color.installColorSpace('HSV', ['hue', 'saturation', 'value', 'alpha'], {\n rgb: function () {\n var hue = this._hue,\n saturation = this._saturation,\n value = this._value,\n i = Math.min(5, Math.floor(hue * 6)),\n f = hue * 6 - i,\n p = value * (1 - saturation),\n q = value * (1 - f * saturation),\n t = value * (1 - (1 - f) * saturation),\n red,\n green,\n blue;\n switch (i) {\n case 0:\n red = value;\n green = t;\n blue = p;\n break;\n case 1:\n red = q;\n green = value;\n blue = p;\n break;\n case 2:\n red = p;\n green = value;\n blue = t;\n break;\n case 3:\n red = p;\n green = q;\n blue = value;\n break;\n case 4:\n red = t;\n green = p;\n blue = value;\n break;\n case 5:\n red = value;\n green = p;\n blue = q;\n break;\n }\n return new color.RGB(red, green, blue, this._alpha);\n },\n\n hsl: function () {\n var l = (2 - this._saturation) * this._value,\n sv = this._saturation * this._value,\n svDivisor = l <= 1 ? l : (2 - l),\n saturation;\n\n // Avoid division by zero when lightness approaches zero:\n if (svDivisor < 1e-9) {\n saturation = 0;\n } else {\n saturation = sv / svDivisor;\n }\n return new color.HSL(this._hue, saturation, l / 2, this._alpha);\n },\n\n fromRgb: function () { // Becomes one.color.RGB.prototype.hsv\n var red = this._red,\n green = this._green,\n blue = this._blue,\n max = Math.max(red, green, blue),\n min = Math.min(red, green, blue),\n delta = max - min,\n hue,\n saturation = (max === 0) ? 0 : (delta / max),\n value = max;\n if (delta === 0) {\n hue = 0;\n } else {\n switch (max) {\n case red:\n hue = (green - blue) / delta / 6 + (green < blue ? 1 : 0);\n break;\n case green:\n hue = (blue - red) / delta / 6 + 1 / 3;\n break;\n case blue:\n hue = (red - green) / delta / 6 + 2 / 3;\n break;\n }\n }\n return new color.HSV(hue, saturation, value, this._alpha);\n }\n });\n};\n","module.exports = function HSL(color) {\n color.use(require('./HSV'));\n\n color.installColorSpace('HSL', ['hue', 'saturation', 'lightness', 'alpha'], {\n hsv: function () {\n // Algorithm adapted from http://wiki.secondlife.com/wiki/Color_conversion_scripts\n var l = this._lightness * 2,\n s = this._saturation * ((l <= 1) ? l : 2 - l),\n saturation;\n\n // Avoid division by zero when l + s is very small (approaching black):\n if (l + s < 1e-9) {\n saturation = 0;\n } else {\n saturation = (2 * s) / (l + s);\n }\n\n return new color.HSV(this._hue, saturation, (l + s) / 2, this._alpha);\n },\n\n rgb: function () {\n return this.hsv().rgb();\n },\n\n fromRgb: function () { // Becomes one.color.RGB.prototype.hsv\n return this.hsv().hsl();\n }\n });\n};\n","module.exports = require('./lib/color')\n .use(require('./lib/HSV'))\n .use(require('./lib/HSL'));\n"]} \ No newline at end of file From b815795c22f24e7bd0a4ab63b99f4a26d07fb9e9 Mon Sep 17 00:00:00 2001 From: Alex J Burke Date: Fri, 17 Jul 2020 08:43:19 +0200 Subject: [PATCH 25/26] Rework the README to allow the examples to be validated. Add a few annotations and make use of a node accessible name within the README such that it becomes possible to evaluate snippets using evaldown. Make sure regressions will be caught by validating on CI. --- .travis.yml | 3 ++ README.md | 146 ++++++++++++++++++++++++++++----------------------- package.json | 3 ++ 3 files changed, 87 insertions(+), 65 deletions(-) diff --git a/.travis.yml b/.travis.yml index 00c2aff..04db955 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,6 +22,9 @@ matrix: - name: Lint node_js: 14 script: npm run lint + - name: Documentation + node_js: 14 + script: npm run test:documentation script: '(nvm i 14 && npm run build) && npm run ci:test' after_success: ' ``` -In node.js (after `npm install onecolor`): +In the browser, the parser is exposed as a global named `onecolor`. +In node.js, it is returned directly with a require of the module +(after `npm install onecolor`): ```javascript var color = require('onecolor'); -console.warn(color('rgba(100%, 0%, 0%, .5)').alpha(0.4).cssa()); // 'rgba(255,0,0,0.4)' +console.warn(color('rgba(100%, 0%, 0%, .5)').alpha(0.4).cssa()); ``` -`one.color` is the parser. All of the above return color instances in -the relevant color space with the channel values (0..1) as instance -variables: +```output +'rgba(255,0,0,0.4)' +``` + +All of the above return color instances in the relevant color space +with the channel values (0..1) as instance variables: ```javascript -var myColor = one.color('#a9d91d'); -myColor instanceof one.color.RGB; // true +var myColor = color('#a9d91d'); +myColor instanceof color.RGB; // true myColor.red(); // 0.6627450980392157 ``` @@ -71,15 +76,15 @@ but the requires the slightly bigger one-color-all.js build adds support for the standard suite of named CSS colors: ```javascript -one.color('maroon'); -one.color('darkolivegreen'); +color('maroon'); +color('darkolivegreen'); ``` -Existing one.color instances pass through unchanged, which is useful +Existing onecolor instances pass through unchanged, which is useful in APIs where you want to accept either a string or a color instance: ```javascript -one.color(one.color('#fff')); // Same as one.color('#fff') +color(color('#fff')); // Same as color('#fff') ``` Serialization methods: ```javascript -color.hex(); // 6-digit hex string: '#bda65b' -color.css(); // CSS rgb syntax: 'rgb(10,128,220)' -color.cssa(); // CSS rgba syntax: 'rgba(10,128,220,0.8)' -color.toString(); // For debugging: '[one.color.RGB: Red=0.3 Green=0.8 Blue=0 Alpha=1]' -color.toJSON(); // ["RGB"|"HSV"|"HSL", , , , ] +var myColor = color('#bda65b'); + +myColor.hex(); // 6-digit hex string: '#bda65b' +myColor.css(); // CSS rgb syntax: 'rgb(10,128,220)' +myColor.cssa(); // CSS rgba syntax: 'rgba(10,128,220,0.8)' +myColor.toString(); // For debugging: '[onecolor.RGB: Red=0.3 Green=0.8 Blue=0 Alpha=1]' +myColor.toJSON(); // ["RGB"|"HSV"|"HSL", , , , ] ``` Getters -- return the value of the channel (converts to other colorspaces as needed): ```javascript -color.red(); -color.green(); -color.blue(); -color.hue(); -color.saturation(); -color.value(); -color.lightness(); -color.alpha(); -color.cyan(); // one-color-all.js and node.js only -color.magenta(); // one-color-all.js and node.js only -color.yellow(); // one-color-all.js and node.js only -color.black(); // one-color-all.js and node.js only +var myColor = color('#bda65b'); + +myColor.red(); +myColor.green(); +myColor.blue(); +myColor.hue(); +myColor.saturation(); +myColor.value(); +myColor.lightness(); +myColor.alpha(); +myColor.cyan(); // one-color-all.js and node.js only +myColor.magenta(); // one-color-all.js and node.js only +myColor.yellow(); // one-color-all.js and node.js only +myColor.black(); // one-color-all.js and node.js only ``` Setters -- return new color instances with one channel changed: + + ```javascript color.red() color.green() @@ -241,6 +250,8 @@ color.black() // one-color-all.js and node.js only Adjusters -- return new color instances with the channel adjusted by the specified delta (0..1): + + ```javascript color.red(, true) color.green(, true) @@ -258,6 +269,8 @@ color.black(, true) // one-color-all.js and node.js only Comparison with other color objects, returns `true` or `false` (epsilon defaults to `1e-9`): + + ```javascript color.equals(otherColor[, ]) ``` @@ -267,15 +280,15 @@ color.equals(otherColor[, ]) "Low level" constructors, accept 3 or 4 numerical arguments (0..1): ```javascript -new one.color.RGB(, , [, ]) -new one.color.HSL(, , [, ]) -new one.color.HSV(, , [, ]) +new onecolor.RGB(, , [, ]) +new onecolor.HSL(, , [, ]) +new onecolor.HSV(, , [, ]) ``` The one-color-all.js build includes CMYK support: ```javascript -new one.color.CMYK(, , , [, ]) +new onecolor.CMYK(, , , [, ]) ``` All color instances have `rgb()`, `hsv()`, and `hsl()` methods for @@ -288,12 +301,15 @@ specific colorspace, do an explicit conversion first to cut down on the number of implicit conversions: ```javascript -var myColor = one - .color('#0620ff') +var myColor = color('#0620ff') .lightness(+0.3) .rgb(); -// Alerts '0 0.06265060240963878 0.5999999999999999': -alert(myColor.red() + ' ' + myColor.green() + ' ' + myColor.blue()); + +console.log(myColor.red() + ' ' + myColor.green() + ' ' + myColor.blue()); +``` + +```output +'0 0.06265060240963878 0.5999999999999999' ``` # Building @@ -313,4 +329,4 @@ packages in the repository as well as the npm package: # License -one.color is licensed under a standard 2-clause BSD license -- see the `LICENSE` file for details. +onecolor is licensed under a standard 2-clause BSD license -- see the `LICENSE` file for details. diff --git a/package.json b/package.json index 38fee86..e4e7916 100644 --- a/package.json +++ b/package.json @@ -34,9 +34,11 @@ "eslint-plugin-node": "^11.1.0", "eslint-plugin-promise": "^4.2.1", "eslint-plugin-standard": "^4.0.1", + "evaldown": "^1.1.2", "istanbul": "0.4.2", "mocha": "2.4.5", "mocha-lcov-reporter": "1.2.0", + "onecolor": "file:./", "prettier": "^2.0.5", "rollup": "^2.21.0", "rollup-plugin-terser": "^6.1.0", @@ -61,6 +63,7 @@ "preversion": "npm run lint && npm run build && TEST_BUNDLES=true npm test && bash -c 'git add one-color{-all,}.{js,map}'", "lint": "eslint . && prettier --check '**/*.{js,md}'", "test": "npm run lint && mocha", + "test:documentation": "evaldown --validate --capture=console ./README.md", "coverage": "istanbul cover _mocha -- --reporter dot", "ci:test": "TEST_BUNDLES=true npm run coverage" }, From b8aab0147a99863bcf8c0045e939fb9064d007a0 Mon Sep 17 00:00:00 2001 From: Alex J Burke Date: Mon, 27 Jul 2020 18:13:58 +0200 Subject: [PATCH 26/26] Fix output quoting. --- README.md | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index c4b1263..85b1d41 100644 --- a/README.md +++ b/README.md @@ -59,7 +59,7 @@ console.warn(color('rgba(100%, 0%, 0%, .5)').alpha(0.4).cssa()); ``` ```output -'rgba(255,0,0,0.4)' +rgba(255,0,0,0.4) ``` All of the above return color instances in the relevant color space @@ -309,7 +309,7 @@ console.log(myColor.red() + ' ' + myColor.green() + ' ' + myColor.blue()); ``` ```output -'0 0.06265060240963878 0.5999999999999999' +0 0.06265060240963878 0.5999999999999999 ``` # Building diff --git a/package.json b/package.json index e4e7916..3e1f2a4 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ "eslint-plugin-node": "^11.1.0", "eslint-plugin-promise": "^4.2.1", "eslint-plugin-standard": "^4.0.1", - "evaldown": "^1.1.2", + "evaldown": "^1.2.2", "istanbul": "0.4.2", "mocha": "2.4.5", "mocha-lcov-reporter": "1.2.0",