Comparing version 1.2.0 to 1.2.1
@@ -1,549 +0,549 @@ | ||
// https://d3js.org/d3-color/ Version 1.2.0. Copyright 2018 Mike Bostock. | ||
// https://d3js.org/d3-color/ Version 1.2.1 Copyright 2018 Mike Bostock. | ||
(function (global, factory) { | ||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : | ||
typeof define === 'function' && define.amd ? define(['exports'], factory) : | ||
(factory((global.d3 = global.d3 || {}))); | ||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : | ||
typeof define === 'function' && define.amd ? define(['exports'], factory) : | ||
(factory((global.d3 = global.d3 || {}))); | ||
}(this, (function (exports) { 'use strict'; | ||
var define = function(constructor, factory, prototype) { | ||
constructor.prototype = factory.prototype = prototype; | ||
prototype.constructor = constructor; | ||
}; | ||
function define(constructor, factory, prototype) { | ||
constructor.prototype = factory.prototype = prototype; | ||
prototype.constructor = constructor; | ||
} | ||
function extend(parent, definition) { | ||
var prototype = Object.create(parent.prototype); | ||
for (var key in definition) prototype[key] = definition[key]; | ||
return prototype; | ||
} | ||
function extend(parent, definition) { | ||
var prototype = Object.create(parent.prototype); | ||
for (var key in definition) prototype[key] = definition[key]; | ||
return prototype; | ||
} | ||
function Color() {} | ||
function Color() {} | ||
var darker = 0.7; | ||
var brighter = 1 / darker; | ||
var darker = 0.7; | ||
var brighter = 1 / darker; | ||
var reI = "\\s*([+-]?\\d+)\\s*"; | ||
var reN = "\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*"; | ||
var reP = "\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*"; | ||
var reHex3 = /^#([0-9a-f]{3})$/; | ||
var reHex6 = /^#([0-9a-f]{6})$/; | ||
var reRgbInteger = new RegExp("^rgb\\(" + [reI, reI, reI] + "\\)$"); | ||
var reRgbPercent = new RegExp("^rgb\\(" + [reP, reP, reP] + "\\)$"); | ||
var reRgbaInteger = new RegExp("^rgba\\(" + [reI, reI, reI, reN] + "\\)$"); | ||
var reRgbaPercent = new RegExp("^rgba\\(" + [reP, reP, reP, reN] + "\\)$"); | ||
var reHslPercent = new RegExp("^hsl\\(" + [reN, reP, reP] + "\\)$"); | ||
var reHslaPercent = new RegExp("^hsla\\(" + [reN, reP, reP, reN] + "\\)$"); | ||
var reI = "\\s*([+-]?\\d+)\\s*", | ||
reN = "\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*", | ||
reP = "\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*", | ||
reHex3 = /^#([0-9a-f]{3})$/, | ||
reHex6 = /^#([0-9a-f]{6})$/, | ||
reRgbInteger = new RegExp("^rgb\\(" + [reI, reI, reI] + "\\)$"), | ||
reRgbPercent = new RegExp("^rgb\\(" + [reP, reP, reP] + "\\)$"), | ||
reRgbaInteger = new RegExp("^rgba\\(" + [reI, reI, reI, reN] + "\\)$"), | ||
reRgbaPercent = new RegExp("^rgba\\(" + [reP, reP, reP, reN] + "\\)$"), | ||
reHslPercent = new RegExp("^hsl\\(" + [reN, reP, reP] + "\\)$"), | ||
reHslaPercent = new RegExp("^hsla\\(" + [reN, reP, reP, reN] + "\\)$"); | ||
var named = { | ||
aliceblue: 0xf0f8ff, | ||
antiquewhite: 0xfaebd7, | ||
aqua: 0x00ffff, | ||
aquamarine: 0x7fffd4, | ||
azure: 0xf0ffff, | ||
beige: 0xf5f5dc, | ||
bisque: 0xffe4c4, | ||
black: 0x000000, | ||
blanchedalmond: 0xffebcd, | ||
blue: 0x0000ff, | ||
blueviolet: 0x8a2be2, | ||
brown: 0xa52a2a, | ||
burlywood: 0xdeb887, | ||
cadetblue: 0x5f9ea0, | ||
chartreuse: 0x7fff00, | ||
chocolate: 0xd2691e, | ||
coral: 0xff7f50, | ||
cornflowerblue: 0x6495ed, | ||
cornsilk: 0xfff8dc, | ||
crimson: 0xdc143c, | ||
cyan: 0x00ffff, | ||
darkblue: 0x00008b, | ||
darkcyan: 0x008b8b, | ||
darkgoldenrod: 0xb8860b, | ||
darkgray: 0xa9a9a9, | ||
darkgreen: 0x006400, | ||
darkgrey: 0xa9a9a9, | ||
darkkhaki: 0xbdb76b, | ||
darkmagenta: 0x8b008b, | ||
darkolivegreen: 0x556b2f, | ||
darkorange: 0xff8c00, | ||
darkorchid: 0x9932cc, | ||
darkred: 0x8b0000, | ||
darksalmon: 0xe9967a, | ||
darkseagreen: 0x8fbc8f, | ||
darkslateblue: 0x483d8b, | ||
darkslategray: 0x2f4f4f, | ||
darkslategrey: 0x2f4f4f, | ||
darkturquoise: 0x00ced1, | ||
darkviolet: 0x9400d3, | ||
deeppink: 0xff1493, | ||
deepskyblue: 0x00bfff, | ||
dimgray: 0x696969, | ||
dimgrey: 0x696969, | ||
dodgerblue: 0x1e90ff, | ||
firebrick: 0xb22222, | ||
floralwhite: 0xfffaf0, | ||
forestgreen: 0x228b22, | ||
fuchsia: 0xff00ff, | ||
gainsboro: 0xdcdcdc, | ||
ghostwhite: 0xf8f8ff, | ||
gold: 0xffd700, | ||
goldenrod: 0xdaa520, | ||
gray: 0x808080, | ||
green: 0x008000, | ||
greenyellow: 0xadff2f, | ||
grey: 0x808080, | ||
honeydew: 0xf0fff0, | ||
hotpink: 0xff69b4, | ||
indianred: 0xcd5c5c, | ||
indigo: 0x4b0082, | ||
ivory: 0xfffff0, | ||
khaki: 0xf0e68c, | ||
lavender: 0xe6e6fa, | ||
lavenderblush: 0xfff0f5, | ||
lawngreen: 0x7cfc00, | ||
lemonchiffon: 0xfffacd, | ||
lightblue: 0xadd8e6, | ||
lightcoral: 0xf08080, | ||
lightcyan: 0xe0ffff, | ||
lightgoldenrodyellow: 0xfafad2, | ||
lightgray: 0xd3d3d3, | ||
lightgreen: 0x90ee90, | ||
lightgrey: 0xd3d3d3, | ||
lightpink: 0xffb6c1, | ||
lightsalmon: 0xffa07a, | ||
lightseagreen: 0x20b2aa, | ||
lightskyblue: 0x87cefa, | ||
lightslategray: 0x778899, | ||
lightslategrey: 0x778899, | ||
lightsteelblue: 0xb0c4de, | ||
lightyellow: 0xffffe0, | ||
lime: 0x00ff00, | ||
limegreen: 0x32cd32, | ||
linen: 0xfaf0e6, | ||
magenta: 0xff00ff, | ||
maroon: 0x800000, | ||
mediumaquamarine: 0x66cdaa, | ||
mediumblue: 0x0000cd, | ||
mediumorchid: 0xba55d3, | ||
mediumpurple: 0x9370db, | ||
mediumseagreen: 0x3cb371, | ||
mediumslateblue: 0x7b68ee, | ||
mediumspringgreen: 0x00fa9a, | ||
mediumturquoise: 0x48d1cc, | ||
mediumvioletred: 0xc71585, | ||
midnightblue: 0x191970, | ||
mintcream: 0xf5fffa, | ||
mistyrose: 0xffe4e1, | ||
moccasin: 0xffe4b5, | ||
navajowhite: 0xffdead, | ||
navy: 0x000080, | ||
oldlace: 0xfdf5e6, | ||
olive: 0x808000, | ||
olivedrab: 0x6b8e23, | ||
orange: 0xffa500, | ||
orangered: 0xff4500, | ||
orchid: 0xda70d6, | ||
palegoldenrod: 0xeee8aa, | ||
palegreen: 0x98fb98, | ||
paleturquoise: 0xafeeee, | ||
palevioletred: 0xdb7093, | ||
papayawhip: 0xffefd5, | ||
peachpuff: 0xffdab9, | ||
peru: 0xcd853f, | ||
pink: 0xffc0cb, | ||
plum: 0xdda0dd, | ||
powderblue: 0xb0e0e6, | ||
purple: 0x800080, | ||
rebeccapurple: 0x663399, | ||
red: 0xff0000, | ||
rosybrown: 0xbc8f8f, | ||
royalblue: 0x4169e1, | ||
saddlebrown: 0x8b4513, | ||
salmon: 0xfa8072, | ||
sandybrown: 0xf4a460, | ||
seagreen: 0x2e8b57, | ||
seashell: 0xfff5ee, | ||
sienna: 0xa0522d, | ||
silver: 0xc0c0c0, | ||
skyblue: 0x87ceeb, | ||
slateblue: 0x6a5acd, | ||
slategray: 0x708090, | ||
slategrey: 0x708090, | ||
snow: 0xfffafa, | ||
springgreen: 0x00ff7f, | ||
steelblue: 0x4682b4, | ||
tan: 0xd2b48c, | ||
teal: 0x008080, | ||
thistle: 0xd8bfd8, | ||
tomato: 0xff6347, | ||
turquoise: 0x40e0d0, | ||
violet: 0xee82ee, | ||
wheat: 0xf5deb3, | ||
white: 0xffffff, | ||
whitesmoke: 0xf5f5f5, | ||
yellow: 0xffff00, | ||
yellowgreen: 0x9acd32 | ||
}; | ||
var named = { | ||
aliceblue: 0xf0f8ff, | ||
antiquewhite: 0xfaebd7, | ||
aqua: 0x00ffff, | ||
aquamarine: 0x7fffd4, | ||
azure: 0xf0ffff, | ||
beige: 0xf5f5dc, | ||
bisque: 0xffe4c4, | ||
black: 0x000000, | ||
blanchedalmond: 0xffebcd, | ||
blue: 0x0000ff, | ||
blueviolet: 0x8a2be2, | ||
brown: 0xa52a2a, | ||
burlywood: 0xdeb887, | ||
cadetblue: 0x5f9ea0, | ||
chartreuse: 0x7fff00, | ||
chocolate: 0xd2691e, | ||
coral: 0xff7f50, | ||
cornflowerblue: 0x6495ed, | ||
cornsilk: 0xfff8dc, | ||
crimson: 0xdc143c, | ||
cyan: 0x00ffff, | ||
darkblue: 0x00008b, | ||
darkcyan: 0x008b8b, | ||
darkgoldenrod: 0xb8860b, | ||
darkgray: 0xa9a9a9, | ||
darkgreen: 0x006400, | ||
darkgrey: 0xa9a9a9, | ||
darkkhaki: 0xbdb76b, | ||
darkmagenta: 0x8b008b, | ||
darkolivegreen: 0x556b2f, | ||
darkorange: 0xff8c00, | ||
darkorchid: 0x9932cc, | ||
darkred: 0x8b0000, | ||
darksalmon: 0xe9967a, | ||
darkseagreen: 0x8fbc8f, | ||
darkslateblue: 0x483d8b, | ||
darkslategray: 0x2f4f4f, | ||
darkslategrey: 0x2f4f4f, | ||
darkturquoise: 0x00ced1, | ||
darkviolet: 0x9400d3, | ||
deeppink: 0xff1493, | ||
deepskyblue: 0x00bfff, | ||
dimgray: 0x696969, | ||
dimgrey: 0x696969, | ||
dodgerblue: 0x1e90ff, | ||
firebrick: 0xb22222, | ||
floralwhite: 0xfffaf0, | ||
forestgreen: 0x228b22, | ||
fuchsia: 0xff00ff, | ||
gainsboro: 0xdcdcdc, | ||
ghostwhite: 0xf8f8ff, | ||
gold: 0xffd700, | ||
goldenrod: 0xdaa520, | ||
gray: 0x808080, | ||
green: 0x008000, | ||
greenyellow: 0xadff2f, | ||
grey: 0x808080, | ||
honeydew: 0xf0fff0, | ||
hotpink: 0xff69b4, | ||
indianred: 0xcd5c5c, | ||
indigo: 0x4b0082, | ||
ivory: 0xfffff0, | ||
khaki: 0xf0e68c, | ||
lavender: 0xe6e6fa, | ||
lavenderblush: 0xfff0f5, | ||
lawngreen: 0x7cfc00, | ||
lemonchiffon: 0xfffacd, | ||
lightblue: 0xadd8e6, | ||
lightcoral: 0xf08080, | ||
lightcyan: 0xe0ffff, | ||
lightgoldenrodyellow: 0xfafad2, | ||
lightgray: 0xd3d3d3, | ||
lightgreen: 0x90ee90, | ||
lightgrey: 0xd3d3d3, | ||
lightpink: 0xffb6c1, | ||
lightsalmon: 0xffa07a, | ||
lightseagreen: 0x20b2aa, | ||
lightskyblue: 0x87cefa, | ||
lightslategray: 0x778899, | ||
lightslategrey: 0x778899, | ||
lightsteelblue: 0xb0c4de, | ||
lightyellow: 0xffffe0, | ||
lime: 0x00ff00, | ||
limegreen: 0x32cd32, | ||
linen: 0xfaf0e6, | ||
magenta: 0xff00ff, | ||
maroon: 0x800000, | ||
mediumaquamarine: 0x66cdaa, | ||
mediumblue: 0x0000cd, | ||
mediumorchid: 0xba55d3, | ||
mediumpurple: 0x9370db, | ||
mediumseagreen: 0x3cb371, | ||
mediumslateblue: 0x7b68ee, | ||
mediumspringgreen: 0x00fa9a, | ||
mediumturquoise: 0x48d1cc, | ||
mediumvioletred: 0xc71585, | ||
midnightblue: 0x191970, | ||
mintcream: 0xf5fffa, | ||
mistyrose: 0xffe4e1, | ||
moccasin: 0xffe4b5, | ||
navajowhite: 0xffdead, | ||
navy: 0x000080, | ||
oldlace: 0xfdf5e6, | ||
olive: 0x808000, | ||
olivedrab: 0x6b8e23, | ||
orange: 0xffa500, | ||
orangered: 0xff4500, | ||
orchid: 0xda70d6, | ||
palegoldenrod: 0xeee8aa, | ||
palegreen: 0x98fb98, | ||
paleturquoise: 0xafeeee, | ||
palevioletred: 0xdb7093, | ||
papayawhip: 0xffefd5, | ||
peachpuff: 0xffdab9, | ||
peru: 0xcd853f, | ||
pink: 0xffc0cb, | ||
plum: 0xdda0dd, | ||
powderblue: 0xb0e0e6, | ||
purple: 0x800080, | ||
rebeccapurple: 0x663399, | ||
red: 0xff0000, | ||
rosybrown: 0xbc8f8f, | ||
royalblue: 0x4169e1, | ||
saddlebrown: 0x8b4513, | ||
salmon: 0xfa8072, | ||
sandybrown: 0xf4a460, | ||
seagreen: 0x2e8b57, | ||
seashell: 0xfff5ee, | ||
sienna: 0xa0522d, | ||
silver: 0xc0c0c0, | ||
skyblue: 0x87ceeb, | ||
slateblue: 0x6a5acd, | ||
slategray: 0x708090, | ||
slategrey: 0x708090, | ||
snow: 0xfffafa, | ||
springgreen: 0x00ff7f, | ||
steelblue: 0x4682b4, | ||
tan: 0xd2b48c, | ||
teal: 0x008080, | ||
thistle: 0xd8bfd8, | ||
tomato: 0xff6347, | ||
turquoise: 0x40e0d0, | ||
violet: 0xee82ee, | ||
wheat: 0xf5deb3, | ||
white: 0xffffff, | ||
whitesmoke: 0xf5f5f5, | ||
yellow: 0xffff00, | ||
yellowgreen: 0x9acd32 | ||
}; | ||
define(Color, color, { | ||
displayable: function() { | ||
return this.rgb().displayable(); | ||
}, | ||
hex: function() { | ||
return this.rgb().hex(); | ||
}, | ||
toString: function() { | ||
return this.rgb() + ""; | ||
define(Color, color, { | ||
displayable: function() { | ||
return this.rgb().displayable(); | ||
}, | ||
hex: function() { | ||
return this.rgb().hex(); | ||
}, | ||
toString: function() { | ||
return this.rgb() + ""; | ||
} | ||
}); | ||
function color(format) { | ||
var m; | ||
format = (format + "").trim().toLowerCase(); | ||
return (m = reHex3.exec(format)) ? (m = parseInt(m[1], 16), new Rgb((m >> 8 & 0xf) | (m >> 4 & 0x0f0), (m >> 4 & 0xf) | (m & 0xf0), ((m & 0xf) << 4) | (m & 0xf), 1)) // #f00 | ||
: (m = reHex6.exec(format)) ? rgbn(parseInt(m[1], 16)) // #ff0000 | ||
: (m = reRgbInteger.exec(format)) ? new Rgb(m[1], m[2], m[3], 1) // rgb(255, 0, 0) | ||
: (m = reRgbPercent.exec(format)) ? new Rgb(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, 1) // rgb(100%, 0%, 0%) | ||
: (m = reRgbaInteger.exec(format)) ? rgba(m[1], m[2], m[3], m[4]) // rgba(255, 0, 0, 1) | ||
: (m = reRgbaPercent.exec(format)) ? rgba(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, m[4]) // rgb(100%, 0%, 0%, 1) | ||
: (m = reHslPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, 1) // hsl(120, 50%, 50%) | ||
: (m = reHslaPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, m[4]) // hsla(120, 50%, 50%, 1) | ||
: named.hasOwnProperty(format) ? rgbn(named[format]) | ||
: format === "transparent" ? new Rgb(NaN, NaN, NaN, 0) | ||
: null; | ||
} | ||
}); | ||
function color(format) { | ||
var m; | ||
format = (format + "").trim().toLowerCase(); | ||
return (m = reHex3.exec(format)) ? (m = parseInt(m[1], 16), new Rgb((m >> 8 & 0xf) | (m >> 4 & 0x0f0), (m >> 4 & 0xf) | (m & 0xf0), ((m & 0xf) << 4) | (m & 0xf), 1)) // #f00 | ||
: (m = reHex6.exec(format)) ? rgbn(parseInt(m[1], 16)) // #ff0000 | ||
: (m = reRgbInteger.exec(format)) ? new Rgb(m[1], m[2], m[3], 1) // rgb(255, 0, 0) | ||
: (m = reRgbPercent.exec(format)) ? new Rgb(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, 1) // rgb(100%, 0%, 0%) | ||
: (m = reRgbaInteger.exec(format)) ? rgba(m[1], m[2], m[3], m[4]) // rgba(255, 0, 0, 1) | ||
: (m = reRgbaPercent.exec(format)) ? rgba(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, m[4]) // rgb(100%, 0%, 0%, 1) | ||
: (m = reHslPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, 1) // hsl(120, 50%, 50%) | ||
: (m = reHslaPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, m[4]) // hsla(120, 50%, 50%, 1) | ||
: named.hasOwnProperty(format) ? rgbn(named[format]) | ||
: format === "transparent" ? new Rgb(NaN, NaN, NaN, 0) | ||
: null; | ||
} | ||
function rgbn(n) { | ||
return new Rgb(n >> 16 & 0xff, n >> 8 & 0xff, n & 0xff, 1); | ||
} | ||
function rgbn(n) { | ||
return new Rgb(n >> 16 & 0xff, n >> 8 & 0xff, n & 0xff, 1); | ||
} | ||
function rgba(r, g, b, a) { | ||
if (a <= 0) r = g = b = NaN; | ||
return new Rgb(r, g, b, a); | ||
} | ||
function rgba(r, g, b, a) { | ||
if (a <= 0) r = g = b = NaN; | ||
return new Rgb(r, g, b, a); | ||
} | ||
function rgbConvert(o) { | ||
if (!(o instanceof Color)) o = color(o); | ||
if (!o) return new Rgb; | ||
o = o.rgb(); | ||
return new Rgb(o.r, o.g, o.b, o.opacity); | ||
} | ||
function rgbConvert(o) { | ||
if (!(o instanceof Color)) o = color(o); | ||
if (!o) return new Rgb; | ||
o = o.rgb(); | ||
return new Rgb(o.r, o.g, o.b, o.opacity); | ||
} | ||
function rgb(r, g, b, opacity) { | ||
return arguments.length === 1 ? rgbConvert(r) : new Rgb(r, g, b, opacity == null ? 1 : opacity); | ||
} | ||
function rgb(r, g, b, opacity) { | ||
return arguments.length === 1 ? rgbConvert(r) : new Rgb(r, g, b, opacity == null ? 1 : opacity); | ||
} | ||
function Rgb(r, g, b, opacity) { | ||
this.r = +r; | ||
this.g = +g; | ||
this.b = +b; | ||
this.opacity = +opacity; | ||
} | ||
function Rgb(r, g, b, opacity) { | ||
this.r = +r; | ||
this.g = +g; | ||
this.b = +b; | ||
this.opacity = +opacity; | ||
} | ||
define(Rgb, rgb, extend(Color, { | ||
brighter: function(k) { | ||
k = k == null ? brighter : Math.pow(brighter, k); | ||
return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity); | ||
}, | ||
darker: function(k) { | ||
k = k == null ? darker : Math.pow(darker, k); | ||
return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity); | ||
}, | ||
rgb: function() { | ||
return this; | ||
}, | ||
displayable: function() { | ||
return (0 <= this.r && this.r <= 255) | ||
&& (0 <= this.g && this.g <= 255) | ||
&& (0 <= this.b && this.b <= 255) | ||
&& (0 <= this.opacity && this.opacity <= 1); | ||
}, | ||
hex: function() { | ||
return "#" + hex(this.r) + hex(this.g) + hex(this.b); | ||
}, | ||
toString: function() { | ||
var a = this.opacity; a = isNaN(a) ? 1 : Math.max(0, Math.min(1, a)); | ||
return (a === 1 ? "rgb(" : "rgba(") | ||
+ Math.max(0, Math.min(255, Math.round(this.r) || 0)) + ", " | ||
+ Math.max(0, Math.min(255, Math.round(this.g) || 0)) + ", " | ||
+ Math.max(0, Math.min(255, Math.round(this.b) || 0)) | ||
+ (a === 1 ? ")" : ", " + a + ")"); | ||
} | ||
})); | ||
define(Rgb, rgb, extend(Color, { | ||
brighter: function(k) { | ||
k = k == null ? brighter : Math.pow(brighter, k); | ||
return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity); | ||
}, | ||
darker: function(k) { | ||
k = k == null ? darker : Math.pow(darker, k); | ||
return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity); | ||
}, | ||
rgb: function() { | ||
return this; | ||
}, | ||
displayable: function() { | ||
return (0 <= this.r && this.r <= 255) | ||
&& (0 <= this.g && this.g <= 255) | ||
&& (0 <= this.b && this.b <= 255) | ||
&& (0 <= this.opacity && this.opacity <= 1); | ||
}, | ||
hex: function() { | ||
return "#" + hex(this.r) + hex(this.g) + hex(this.b); | ||
}, | ||
toString: function() { | ||
var a = this.opacity; a = isNaN(a) ? 1 : Math.max(0, Math.min(1, a)); | ||
return (a === 1 ? "rgb(" : "rgba(") | ||
+ Math.max(0, Math.min(255, Math.round(this.r) || 0)) + ", " | ||
+ Math.max(0, Math.min(255, Math.round(this.g) || 0)) + ", " | ||
+ Math.max(0, Math.min(255, Math.round(this.b) || 0)) | ||
+ (a === 1 ? ")" : ", " + a + ")"); | ||
function hex(value) { | ||
value = Math.max(0, Math.min(255, Math.round(value) || 0)); | ||
return (value < 16 ? "0" : "") + value.toString(16); | ||
} | ||
})); | ||
function hex(value) { | ||
value = Math.max(0, Math.min(255, Math.round(value) || 0)); | ||
return (value < 16 ? "0" : "") + value.toString(16); | ||
} | ||
function hsla(h, s, l, a) { | ||
if (a <= 0) h = s = l = NaN; | ||
else if (l <= 0 || l >= 1) h = s = NaN; | ||
else if (s <= 0) h = NaN; | ||
return new Hsl(h, s, l, a); | ||
} | ||
function hsla(h, s, l, a) { | ||
if (a <= 0) h = s = l = NaN; | ||
else if (l <= 0 || l >= 1) h = s = NaN; | ||
else if (s <= 0) h = NaN; | ||
return new Hsl(h, s, l, a); | ||
} | ||
function hslConvert(o) { | ||
if (o instanceof Hsl) return new Hsl(o.h, o.s, o.l, o.opacity); | ||
if (!(o instanceof Color)) o = color(o); | ||
if (!o) return new Hsl; | ||
if (o instanceof Hsl) return o; | ||
o = o.rgb(); | ||
var r = o.r / 255, | ||
g = o.g / 255, | ||
b = o.b / 255, | ||
min = Math.min(r, g, b), | ||
max = Math.max(r, g, b), | ||
h = NaN, | ||
s = max - min, | ||
l = (max + min) / 2; | ||
if (s) { | ||
if (r === max) h = (g - b) / s + (g < b) * 6; | ||
else if (g === max) h = (b - r) / s + 2; | ||
else h = (r - g) / s + 4; | ||
s /= l < 0.5 ? max + min : 2 - max - min; | ||
h *= 60; | ||
} else { | ||
s = l > 0 && l < 1 ? 0 : h; | ||
} | ||
return new Hsl(h, s, l, o.opacity); | ||
} | ||
function hslConvert(o) { | ||
if (o instanceof Hsl) return new Hsl(o.h, o.s, o.l, o.opacity); | ||
if (!(o instanceof Color)) o = color(o); | ||
if (!o) return new Hsl; | ||
if (o instanceof Hsl) return o; | ||
o = o.rgb(); | ||
var r = o.r / 255, | ||
g = o.g / 255, | ||
b = o.b / 255, | ||
min = Math.min(r, g, b), | ||
max = Math.max(r, g, b), | ||
h = NaN, | ||
s = max - min, | ||
l = (max + min) / 2; | ||
if (s) { | ||
if (r === max) h = (g - b) / s + (g < b) * 6; | ||
else if (g === max) h = (b - r) / s + 2; | ||
else h = (r - g) / s + 4; | ||
s /= l < 0.5 ? max + min : 2 - max - min; | ||
h *= 60; | ||
} else { | ||
s = l > 0 && l < 1 ? 0 : h; | ||
function hsl(h, s, l, opacity) { | ||
return arguments.length === 1 ? hslConvert(h) : new Hsl(h, s, l, opacity == null ? 1 : opacity); | ||
} | ||
return new Hsl(h, s, l, o.opacity); | ||
} | ||
function hsl(h, s, l, opacity) { | ||
return arguments.length === 1 ? hslConvert(h) : new Hsl(h, s, l, opacity == null ? 1 : opacity); | ||
} | ||
function Hsl(h, s, l, opacity) { | ||
this.h = +h; | ||
this.s = +s; | ||
this.l = +l; | ||
this.opacity = +opacity; | ||
} | ||
function Hsl(h, s, l, opacity) { | ||
this.h = +h; | ||
this.s = +s; | ||
this.l = +l; | ||
this.opacity = +opacity; | ||
} | ||
define(Hsl, hsl, extend(Color, { | ||
brighter: function(k) { | ||
k = k == null ? brighter : Math.pow(brighter, k); | ||
return new Hsl(this.h, this.s, this.l * k, this.opacity); | ||
}, | ||
darker: function(k) { | ||
k = k == null ? darker : Math.pow(darker, k); | ||
return new Hsl(this.h, this.s, this.l * k, this.opacity); | ||
}, | ||
rgb: function() { | ||
var h = this.h % 360 + (this.h < 0) * 360, | ||
s = isNaN(h) || isNaN(this.s) ? 0 : this.s, | ||
l = this.l, | ||
m2 = l + (l < 0.5 ? l : 1 - l) * s, | ||
m1 = 2 * l - m2; | ||
return new Rgb( | ||
hsl2rgb(h >= 240 ? h - 240 : h + 120, m1, m2), | ||
hsl2rgb(h, m1, m2), | ||
hsl2rgb(h < 120 ? h + 240 : h - 120, m1, m2), | ||
this.opacity | ||
); | ||
}, | ||
displayable: function() { | ||
return (0 <= this.s && this.s <= 1 || isNaN(this.s)) | ||
&& (0 <= this.l && this.l <= 1) | ||
&& (0 <= this.opacity && this.opacity <= 1); | ||
} | ||
})); | ||
define(Hsl, hsl, extend(Color, { | ||
brighter: function(k) { | ||
k = k == null ? brighter : Math.pow(brighter, k); | ||
return new Hsl(this.h, this.s, this.l * k, this.opacity); | ||
}, | ||
darker: function(k) { | ||
k = k == null ? darker : Math.pow(darker, k); | ||
return new Hsl(this.h, this.s, this.l * k, this.opacity); | ||
}, | ||
rgb: function() { | ||
var h = this.h % 360 + (this.h < 0) * 360, | ||
s = isNaN(h) || isNaN(this.s) ? 0 : this.s, | ||
l = this.l, | ||
m2 = l + (l < 0.5 ? l : 1 - l) * s, | ||
m1 = 2 * l - m2; | ||
return new Rgb( | ||
hsl2rgb(h >= 240 ? h - 240 : h + 120, m1, m2), | ||
hsl2rgb(h, m1, m2), | ||
hsl2rgb(h < 120 ? h + 240 : h - 120, m1, m2), | ||
this.opacity | ||
); | ||
}, | ||
displayable: function() { | ||
return (0 <= this.s && this.s <= 1 || isNaN(this.s)) | ||
&& (0 <= this.l && this.l <= 1) | ||
&& (0 <= this.opacity && this.opacity <= 1); | ||
/* From FvD 13.37, CSS Color Module Level 3 */ | ||
function hsl2rgb(h, m1, m2) { | ||
return (h < 60 ? m1 + (m2 - m1) * h / 60 | ||
: h < 180 ? m2 | ||
: h < 240 ? m1 + (m2 - m1) * (240 - h) / 60 | ||
: m1) * 255; | ||
} | ||
})); | ||
/* From FvD 13.37, CSS Color Module Level 3 */ | ||
function hsl2rgb(h, m1, m2) { | ||
return (h < 60 ? m1 + (m2 - m1) * h / 60 | ||
: h < 180 ? m2 | ||
: h < 240 ? m1 + (m2 - m1) * (240 - h) / 60 | ||
: m1) * 255; | ||
} | ||
var deg2rad = Math.PI / 180; | ||
var rad2deg = 180 / Math.PI; | ||
var deg2rad = Math.PI / 180; | ||
var rad2deg = 180 / Math.PI; | ||
// https://beta.observablehq.com/@mbostock/lab-and-rgb | ||
var K = 18, | ||
Xn = 0.96422, | ||
Yn = 1, | ||
Zn = 0.82521, | ||
t0 = 4 / 29, | ||
t1 = 6 / 29, | ||
t2 = 3 * t1 * t1, | ||
t3 = t1 * t1 * t1; | ||
// https://beta.observablehq.com/@mbostock/lab-and-rgb | ||
var K = 18; | ||
var Xn = 0.96422; | ||
var Yn = 1; | ||
var Zn = 0.82521; | ||
var t0 = 4 / 29; | ||
var t1 = 6 / 29; | ||
var t2 = 3 * t1 * t1; | ||
var t3 = t1 * t1 * t1; | ||
function labConvert(o) { | ||
if (o instanceof Lab) return new Lab(o.l, o.a, o.b, o.opacity); | ||
if (o instanceof Hcl) { | ||
if (isNaN(o.h)) return new Lab(o.l, 0, 0, o.opacity); | ||
var h = o.h * deg2rad; | ||
return new Lab(o.l, Math.cos(h) * o.c, Math.sin(h) * o.c, o.opacity); | ||
} | ||
if (!(o instanceof Rgb)) o = rgbConvert(o); | ||
var r = rgb2lrgb(o.r), | ||
g = rgb2lrgb(o.g), | ||
b = rgb2lrgb(o.b), | ||
y = xyz2lab((0.2225045 * r + 0.7168786 * g + 0.0606169 * b) / Yn), x, z; | ||
if (r === g && g === b) x = z = y; else { | ||
x = xyz2lab((0.4360747 * r + 0.3850649 * g + 0.1430804 * b) / Xn); | ||
z = xyz2lab((0.0139322 * r + 0.0971045 * g + 0.7141733 * b) / Zn); | ||
} | ||
return new Lab(116 * y - 16, 500 * (x - y), 200 * (y - z), o.opacity); | ||
} | ||
function labConvert(o) { | ||
if (o instanceof Lab) return new Lab(o.l, o.a, o.b, o.opacity); | ||
if (o instanceof Hcl) { | ||
if (isNaN(o.h)) return new Lab(o.l, 0, 0, o.opacity); | ||
var h = o.h * deg2rad; | ||
return new Lab(o.l, Math.cos(h) * o.c, Math.sin(h) * o.c, o.opacity); | ||
function gray(l, opacity) { | ||
return new Lab(l, 0, 0, opacity == null ? 1 : opacity); | ||
} | ||
if (!(o instanceof Rgb)) o = rgbConvert(o); | ||
var r = rgb2lrgb(o.r), | ||
g = rgb2lrgb(o.g), | ||
b = rgb2lrgb(o.b), | ||
y = xyz2lab((0.2225045 * r + 0.7168786 * g + 0.0606169 * b) / Yn), x, z; | ||
if (r === g && g === b) x = z = y; else { | ||
x = xyz2lab((0.4360747 * r + 0.3850649 * g + 0.1430804 * b) / Xn); | ||
z = xyz2lab((0.0139322 * r + 0.0971045 * g + 0.7141733 * b) / Zn); | ||
function lab(l, a, b, opacity) { | ||
return arguments.length === 1 ? labConvert(l) : new Lab(l, a, b, opacity == null ? 1 : opacity); | ||
} | ||
return new Lab(116 * y - 16, 500 * (x - y), 200 * (y - z), o.opacity); | ||
} | ||
function gray(l, opacity) { | ||
return new Lab(l, 0, 0, opacity == null ? 1 : opacity); | ||
} | ||
function Lab(l, a, b, opacity) { | ||
this.l = +l; | ||
this.a = +a; | ||
this.b = +b; | ||
this.opacity = +opacity; | ||
} | ||
function lab(l, a, b, opacity) { | ||
return arguments.length === 1 ? labConvert(l) : new Lab(l, a, b, opacity == null ? 1 : opacity); | ||
} | ||
define(Lab, lab, extend(Color, { | ||
brighter: function(k) { | ||
return new Lab(this.l + K * (k == null ? 1 : k), this.a, this.b, this.opacity); | ||
}, | ||
darker: function(k) { | ||
return new Lab(this.l - K * (k == null ? 1 : k), this.a, this.b, this.opacity); | ||
}, | ||
rgb: function() { | ||
var y = (this.l + 16) / 116, | ||
x = isNaN(this.a) ? y : y + this.a / 500, | ||
z = isNaN(this.b) ? y : y - this.b / 200; | ||
x = Xn * lab2xyz(x); | ||
y = Yn * lab2xyz(y); | ||
z = Zn * lab2xyz(z); | ||
return new Rgb( | ||
lrgb2rgb( 3.1338561 * x - 1.6168667 * y - 0.4906146 * z), | ||
lrgb2rgb(-0.9787684 * x + 1.9161415 * y + 0.0334540 * z), | ||
lrgb2rgb( 0.0719453 * x - 0.2289914 * y + 1.4052427 * z), | ||
this.opacity | ||
); | ||
} | ||
})); | ||
function Lab(l, a, b, opacity) { | ||
this.l = +l; | ||
this.a = +a; | ||
this.b = +b; | ||
this.opacity = +opacity; | ||
} | ||
function xyz2lab(t) { | ||
return t > t3 ? Math.pow(t, 1 / 3) : t / t2 + t0; | ||
} | ||
define(Lab, lab, extend(Color, { | ||
brighter: function(k) { | ||
return new Lab(this.l + K * (k == null ? 1 : k), this.a, this.b, this.opacity); | ||
}, | ||
darker: function(k) { | ||
return new Lab(this.l - K * (k == null ? 1 : k), this.a, this.b, this.opacity); | ||
}, | ||
rgb: function() { | ||
var y = (this.l + 16) / 116, | ||
x = isNaN(this.a) ? y : y + this.a / 500, | ||
z = isNaN(this.b) ? y : y - this.b / 200; | ||
x = Xn * lab2xyz(x); | ||
y = Yn * lab2xyz(y); | ||
z = Zn * lab2xyz(z); | ||
return new Rgb( | ||
lrgb2rgb( 3.1338561 * x - 1.6168667 * y - 0.4906146 * z), | ||
lrgb2rgb(-0.9787684 * x + 1.9161415 * y + 0.0334540 * z), | ||
lrgb2rgb( 0.0719453 * x - 0.2289914 * y + 1.4052427 * z), | ||
this.opacity | ||
); | ||
function lab2xyz(t) { | ||
return t > t1 ? t * t * t : t2 * (t - t0); | ||
} | ||
})); | ||
function xyz2lab(t) { | ||
return t > t3 ? Math.pow(t, 1 / 3) : t / t2 + t0; | ||
} | ||
function lrgb2rgb(x) { | ||
return 255 * (x <= 0.0031308 ? 12.92 * x : 1.055 * Math.pow(x, 1 / 2.4) - 0.055); | ||
} | ||
function lab2xyz(t) { | ||
return t > t1 ? t * t * t : t2 * (t - t0); | ||
} | ||
function rgb2lrgb(x) { | ||
return (x /= 255) <= 0.04045 ? x / 12.92 : Math.pow((x + 0.055) / 1.055, 2.4); | ||
} | ||
function lrgb2rgb(x) { | ||
return 255 * (x <= 0.0031308 ? 12.92 * x : 1.055 * Math.pow(x, 1 / 2.4) - 0.055); | ||
} | ||
function hclConvert(o) { | ||
if (o instanceof Hcl) return new Hcl(o.h, o.c, o.l, o.opacity); | ||
if (!(o instanceof Lab)) o = labConvert(o); | ||
if (o.a === 0 && o.b === 0) return new Hcl(NaN, 0, o.l, o.opacity); | ||
var h = Math.atan2(o.b, o.a) * rad2deg; | ||
return new Hcl(h < 0 ? h + 360 : h, Math.sqrt(o.a * o.a + o.b * o.b), o.l, o.opacity); | ||
} | ||
function rgb2lrgb(x) { | ||
return (x /= 255) <= 0.04045 ? x / 12.92 : Math.pow((x + 0.055) / 1.055, 2.4); | ||
} | ||
function lch(l, c, h, opacity) { | ||
return arguments.length === 1 ? hclConvert(l) : new Hcl(h, c, l, opacity == null ? 1 : opacity); | ||
} | ||
function hclConvert(o) { | ||
if (o instanceof Hcl) return new Hcl(o.h, o.c, o.l, o.opacity); | ||
if (!(o instanceof Lab)) o = labConvert(o); | ||
if (o.a === 0 && o.b === 0) return new Hcl(NaN, 0, o.l, o.opacity); | ||
var h = Math.atan2(o.b, o.a) * rad2deg; | ||
return new Hcl(h < 0 ? h + 360 : h, Math.sqrt(o.a * o.a + o.b * o.b), o.l, o.opacity); | ||
} | ||
function hcl(h, c, l, opacity) { | ||
return arguments.length === 1 ? hclConvert(h) : new Hcl(h, c, l, opacity == null ? 1 : opacity); | ||
} | ||
function lch(l, c, h, opacity) { | ||
return arguments.length === 1 ? hclConvert(l) : new Hcl(h, c, l, opacity == null ? 1 : opacity); | ||
} | ||
function Hcl(h, c, l, opacity) { | ||
this.h = +h; | ||
this.c = +c; | ||
this.l = +l; | ||
this.opacity = +opacity; | ||
} | ||
function hcl(h, c, l, opacity) { | ||
return arguments.length === 1 ? hclConvert(h) : new Hcl(h, c, l, opacity == null ? 1 : opacity); | ||
} | ||
define(Hcl, hcl, extend(Color, { | ||
brighter: function(k) { | ||
return new Hcl(this.h, this.c, this.l + K * (k == null ? 1 : k), this.opacity); | ||
}, | ||
darker: function(k) { | ||
return new Hcl(this.h, this.c, this.l - K * (k == null ? 1 : k), this.opacity); | ||
}, | ||
rgb: function() { | ||
return labConvert(this).rgb(); | ||
} | ||
})); | ||
function Hcl(h, c, l, opacity) { | ||
this.h = +h; | ||
this.c = +c; | ||
this.l = +l; | ||
this.opacity = +opacity; | ||
} | ||
var A = -0.14861, | ||
B = +1.78277, | ||
C = -0.29227, | ||
D = -0.90649, | ||
E = +1.97294, | ||
ED = E * D, | ||
EB = E * B, | ||
BC_DA = B * C - D * A; | ||
define(Hcl, hcl, extend(Color, { | ||
brighter: function(k) { | ||
return new Hcl(this.h, this.c, this.l + K * (k == null ? 1 : k), this.opacity); | ||
}, | ||
darker: function(k) { | ||
return new Hcl(this.h, this.c, this.l - K * (k == null ? 1 : k), this.opacity); | ||
}, | ||
rgb: function() { | ||
return labConvert(this).rgb(); | ||
function cubehelixConvert(o) { | ||
if (o instanceof Cubehelix) return new Cubehelix(o.h, o.s, o.l, o.opacity); | ||
if (!(o instanceof Rgb)) o = rgbConvert(o); | ||
var r = o.r / 255, | ||
g = o.g / 255, | ||
b = o.b / 255, | ||
l = (BC_DA * b + ED * r - EB * g) / (BC_DA + ED - EB), | ||
bl = b - l, | ||
k = (E * (g - l) - C * bl) / D, | ||
s = Math.sqrt(k * k + bl * bl) / (E * l * (1 - l)), // NaN if l=0 or l=1 | ||
h = s ? Math.atan2(k, bl) * rad2deg - 120 : NaN; | ||
return new Cubehelix(h < 0 ? h + 360 : h, s, l, o.opacity); | ||
} | ||
})); | ||
var A = -0.14861; | ||
var B = +1.78277; | ||
var C = -0.29227; | ||
var D = -0.90649; | ||
var E = +1.97294; | ||
var ED = E * D; | ||
var EB = E * B; | ||
var BC_DA = B * C - D * A; | ||
function cubehelix(h, s, l, opacity) { | ||
return arguments.length === 1 ? cubehelixConvert(h) : new Cubehelix(h, s, l, opacity == null ? 1 : opacity); | ||
} | ||
function cubehelixConvert(o) { | ||
if (o instanceof Cubehelix) return new Cubehelix(o.h, o.s, o.l, o.opacity); | ||
if (!(o instanceof Rgb)) o = rgbConvert(o); | ||
var r = o.r / 255, | ||
g = o.g / 255, | ||
b = o.b / 255, | ||
l = (BC_DA * b + ED * r - EB * g) / (BC_DA + ED - EB), | ||
bl = b - l, | ||
k = (E * (g - l) - C * bl) / D, | ||
s = Math.sqrt(k * k + bl * bl) / (E * l * (1 - l)), // NaN if l=0 or l=1 | ||
h = s ? Math.atan2(k, bl) * rad2deg - 120 : NaN; | ||
return new Cubehelix(h < 0 ? h + 360 : h, s, l, o.opacity); | ||
} | ||
function Cubehelix(h, s, l, opacity) { | ||
this.h = +h; | ||
this.s = +s; | ||
this.l = +l; | ||
this.opacity = +opacity; | ||
} | ||
function cubehelix(h, s, l, opacity) { | ||
return arguments.length === 1 ? cubehelixConvert(h) : new Cubehelix(h, s, l, opacity == null ? 1 : opacity); | ||
} | ||
define(Cubehelix, cubehelix, extend(Color, { | ||
brighter: function(k) { | ||
k = k == null ? brighter : Math.pow(brighter, k); | ||
return new Cubehelix(this.h, this.s, this.l * k, this.opacity); | ||
}, | ||
darker: function(k) { | ||
k = k == null ? darker : Math.pow(darker, k); | ||
return new Cubehelix(this.h, this.s, this.l * k, this.opacity); | ||
}, | ||
rgb: function() { | ||
var h = isNaN(this.h) ? 0 : (this.h + 120) * deg2rad, | ||
l = +this.l, | ||
a = isNaN(this.s) ? 0 : this.s * l * (1 - l), | ||
cosh = Math.cos(h), | ||
sinh = Math.sin(h); | ||
return new Rgb( | ||
255 * (l + a * (A * cosh + B * sinh)), | ||
255 * (l + a * (C * cosh + D * sinh)), | ||
255 * (l + a * (E * cosh)), | ||
this.opacity | ||
); | ||
} | ||
})); | ||
function Cubehelix(h, s, l, opacity) { | ||
this.h = +h; | ||
this.s = +s; | ||
this.l = +l; | ||
this.opacity = +opacity; | ||
} | ||
exports.color = color; | ||
exports.rgb = rgb; | ||
exports.hsl = hsl; | ||
exports.lab = lab; | ||
exports.hcl = hcl; | ||
exports.lch = lch; | ||
exports.gray = gray; | ||
exports.cubehelix = cubehelix; | ||
define(Cubehelix, cubehelix, extend(Color, { | ||
brighter: function(k) { | ||
k = k == null ? brighter : Math.pow(brighter, k); | ||
return new Cubehelix(this.h, this.s, this.l * k, this.opacity); | ||
}, | ||
darker: function(k) { | ||
k = k == null ? darker : Math.pow(darker, k); | ||
return new Cubehelix(this.h, this.s, this.l * k, this.opacity); | ||
}, | ||
rgb: function() { | ||
var h = isNaN(this.h) ? 0 : (this.h + 120) * deg2rad, | ||
l = +this.l, | ||
a = isNaN(this.s) ? 0 : this.s * l * (1 - l), | ||
cosh = Math.cos(h), | ||
sinh = Math.sin(h); | ||
return new Rgb( | ||
255 * (l + a * (A * cosh + B * sinh)), | ||
255 * (l + a * (C * cosh + D * sinh)), | ||
255 * (l + a * (E * cosh)), | ||
this.opacity | ||
); | ||
} | ||
})); | ||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
exports.color = color; | ||
exports.rgb = rgb; | ||
exports.hsl = hsl; | ||
exports.lab = lab; | ||
exports.hcl = hcl; | ||
exports.lch = lch; | ||
exports.gray = gray; | ||
exports.cubehelix = cubehelix; | ||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
}))); |
@@ -1,2 +0,2 @@ | ||
// https://d3js.org/d3-color/ Version 1.2.0. Copyright 2018 Mike Bostock. | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(t.d3=t.d3||{})}(this,function(t){"use strict";function e(t,e){var n=Object.create(t.prototype);for(var i in e)n[i]=e[i];return n}function n(){}function i(t){var e;return t=(t+"").trim().toLowerCase(),(e=_.exec(t))?(e=parseInt(e[1],16),new o(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1)):(e=z.exec(t))?r(parseInt(e[1],16)):(e=C.exec(t))?new o(e[1],e[2],e[3],1):(e=L.exec(t))?new o(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=A.exec(t))?a(e[1],e[2],e[3],e[4]):(e=B.exec(t))?a(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=D.exec(t))?u(e[1],e[2]/100,e[3]/100,1):(e=F.exec(t))?u(e[1],e[2]/100,e[3]/100,e[4]):G.hasOwnProperty(t)?r(G[t]):"transparent"===t?new o(NaN,NaN,NaN,0):null}function r(t){return new o(t>>16&255,t>>8&255,255&t,1)}function a(t,e,n,i){return i<=0&&(t=e=n=NaN),new o(t,e,n,i)}function h(t){return t instanceof n||(t=i(t)),t?(t=t.rgb(),new o(t.r,t.g,t.b,t.opacity)):new o}function s(t,e,n,i){return 1===arguments.length?h(t):new o(t,e,n,null==i?1:i)}function o(t,e,n,i){this.r=+t,this.g=+e,this.b=+n,this.opacity=+i}function l(t){return t=Math.max(0,Math.min(255,Math.round(t)||0)),(t<16?"0":"")+t.toString(16)}function u(t,e,n,i){return i<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new d(t,e,n,i)}function c(t){if(t instanceof d)return new d(t.h,t.s,t.l,t.opacity);if(t instanceof n||(t=i(t)),!t)return new d;if(t instanceof d)return t;t=t.rgb();var e=t.r/255,r=t.g/255,a=t.b/255,h=Math.min(e,r,a),s=Math.max(e,r,a),o=NaN,l=s-h,u=(s+h)/2;return l?(o=e===s?(r-a)/l+6*(r<a):r===s?(a-e)/l+2:(e-r)/l+4,l/=u<.5?s+h:2-s-h,o*=60):l=u>0&&u<1?0:o,new d(o,l,u,t.opacity)}function g(t,e,n,i){return 1===arguments.length?c(t):new d(t,e,n,null==i?1:i)}function d(t,e,n,i){this.h=+t,this.s=+e,this.l=+n,this.opacity=+i}function p(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}function f(t){if(t instanceof w)return new w(t.l,t.a,t.b,t.opacity);if(t instanceof E){if(isNaN(t.h))return new w(t.l,0,0,t.opacity);var e=t.h*H;return new w(t.l,Math.cos(e)*t.c,Math.sin(e)*t.c,t.opacity)}t instanceof o||(t=h(t));var n,i,r=M(t.r),a=M(t.g),s=M(t.b),l=m((.2225045*r+.7168786*a+.0606169*s)/Q);return r===a&&a===s?n=i=l:(n=m((.4360747*r+.3850649*a+.1430804*s)/K),i=m((.0139322*r+.0971045*a+.7141733*s)/T)),new w(116*l-16,500*(n-l),200*(l-i),t.opacity)}function b(t,e){return new w(t,0,0,null==e?1:e)}function y(t,e,n,i){return 1===arguments.length?f(t):new w(t,e,n,null==i?1:i)}function w(t,e,n,i){this.l=+t,this.a=+e,this.b=+n,this.opacity=+i}function m(t){return t>X?Math.pow(t,1/3):t/W+U}function k(t){return t>V?t*t*t:W*(t-U)}function N(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function M(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function v(t){if(t instanceof E)return new E(t.h,t.c,t.l,t.opacity);if(t instanceof w||(t=f(t)),0===t.a&&0===t.b)return new E(NaN,0,t.l,t.opacity);var e=Math.atan2(t.b,t.a)*J;return new E(e<0?e+360:e,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}function x(t,e,n,i){return 1===arguments.length?v(t):new E(n,e,t,null==i?1:i)}function q(t,e,n,i){return 1===arguments.length?v(t):new E(t,e,n,null==i?1:i)}function E(t,e,n,i){this.h=+t,this.c=+e,this.l=+n,this.opacity=+i}function $(t){if(t instanceof j)return new j(t.h,t.s,t.l,t.opacity);t instanceof o||(t=h(t));var e=t.r/255,n=t.g/255,i=t.b/255,r=(at*i+it*e-rt*n)/(at+it-rt),a=i-r,s=(nt*(n-r)-tt*a)/et,l=Math.sqrt(s*s+a*a)/(nt*r*(1-r)),u=l?Math.atan2(s,a)*J-120:NaN;return new j(u<0?u+360:u,l,r,t.opacity)}function R(t,e,n,i){return 1===arguments.length?$(t):new j(t,e,n,null==i?1:i)}function j(t,e,n,i){this.h=+t,this.s=+e,this.l=+n,this.opacity=+i}var I=function(t,e,n){t.prototype=e.prototype=n,n.constructor=t},P="\\s*([+-]?\\d+)\\s*",O="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",S="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",_=/^#([0-9a-f]{3})$/,z=/^#([0-9a-f]{6})$/,C=new RegExp("^rgb\\("+[P,P,P]+"\\)$"),L=new RegExp("^rgb\\("+[S,S,S]+"\\)$"),A=new RegExp("^rgba\\("+[P,P,P,O]+"\\)$"),B=new RegExp("^rgba\\("+[S,S,S,O]+"\\)$"),D=new RegExp("^hsl\\("+[O,S,S]+"\\)$"),F=new RegExp("^hsla\\("+[O,S,S,O]+"\\)$"),G={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};I(n,i,{displayable:function(){return this.rgb().displayable()},hex:function(){return this.rgb().hex()},toString:function(){return this.rgb()+""}}),I(o,s,e(n,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new o(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new o(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return 0<=this.r&&this.r<=255&&0<=this.g&&this.g<=255&&0<=this.b&&this.b<=255&&0<=this.opacity&&this.opacity<=1},hex:function(){return"#"+l(this.r)+l(this.g)+l(this.b)},toString:function(){var t=this.opacity;return t=isNaN(t)?1:Math.max(0,Math.min(1,t)),(1===t?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}})),I(d,g,e(n,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new d(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new d(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,i=n+(n<.5?n:1-n)*e,r=2*n-i;return new o(p(t>=240?t-240:t+120,r,i),p(t,r,i),p(t<120?t+240:t-120,r,i),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1}}));var H=Math.PI/180,J=180/Math.PI,K=.96422,Q=1,T=.82521,U=4/29,V=6/29,W=3*V*V,X=V*V*V;I(w,y,e(n,{brighter:function(t){return new w(this.l+18*(null==t?1:t),this.a,this.b,this.opacity)},darker:function(t){return new w(this.l-18*(null==t?1:t),this.a,this.b,this.opacity)},rgb:function(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,n=isNaN(this.b)?t:t-this.b/200;return e=K*k(e),t=Q*k(t),n=T*k(n),new o(N(3.1338561*e-1.6168667*t-.4906146*n),N(-.9787684*e+1.9161415*t+.033454*n),N(.0719453*e-.2289914*t+1.4052427*n),this.opacity)}})),I(E,q,e(n,{brighter:function(t){return new E(this.h,this.c,this.l+18*(null==t?1:t),this.opacity)},darker:function(t){return new E(this.h,this.c,this.l-18*(null==t?1:t),this.opacity)},rgb:function(){return f(this).rgb()}}));var Y=-.14861,Z=1.78277,tt=-.29227,et=-.90649,nt=1.97294,it=nt*et,rt=nt*Z,at=Z*tt-et*Y;I(j,R,e(n,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new j(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new j(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=isNaN(this.h)?0:(this.h+120)*H,e=+this.l,n=isNaN(this.s)?0:this.s*e*(1-e),i=Math.cos(t),r=Math.sin(t);return new o(255*(e+n*(Y*i+Z*r)),255*(e+n*(tt*i+et*r)),255*(e+n*(nt*i)),this.opacity)}})),t.color=i,t.rgb=s,t.hsl=g,t.lab=y,t.hcl=q,t.lch=x,t.gray=b,t.cubehelix=R,Object.defineProperty(t,"__esModule",{value:!0})}); | ||
// https://d3js.org/d3-color/ Version 1.2.1 Copyright 2018 Mike Bostock. | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(t.d3=t.d3||{})}(this,function(t){"use strict";function e(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function n(t,e){var n=Object.create(t.prototype);for(var i in e)n[i]=e[i];return n}function i(){}var r="\\s*([+-]?\\d+)\\s*",a="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",h="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",s=/^#([0-9a-f]{3})$/,o=/^#([0-9a-f]{6})$/,l=new RegExp("^rgb\\("+[r,r,r]+"\\)$"),u=new RegExp("^rgb\\("+[h,h,h]+"\\)$"),c=new RegExp("^rgba\\("+[r,r,r,a]+"\\)$"),g=new RegExp("^rgba\\("+[h,h,h,a]+"\\)$"),d=new RegExp("^hsl\\("+[a,h,h]+"\\)$"),p=new RegExp("^hsla\\("+[a,h,h,a]+"\\)$"),f={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function b(t){var e;return t=(t+"").trim().toLowerCase(),(e=s.exec(t))?new N((e=parseInt(e[1],16))>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):(e=o.exec(t))?y(parseInt(e[1],16)):(e=l.exec(t))?new N(e[1],e[2],e[3],1):(e=u.exec(t))?new N(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=c.exec(t))?w(e[1],e[2],e[3],e[4]):(e=g.exec(t))?w(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=d.exec(t))?v(e[1],e[2]/100,e[3]/100,1):(e=p.exec(t))?v(e[1],e[2]/100,e[3]/100,e[4]):f.hasOwnProperty(t)?y(f[t]):"transparent"===t?new N(NaN,NaN,NaN,0):null}function y(t){return new N(t>>16&255,t>>8&255,255&t,1)}function w(t,e,n,i){return i<=0&&(t=e=n=NaN),new N(t,e,n,i)}function m(t){return t instanceof i||(t=b(t)),t?new N((t=t.rgb()).r,t.g,t.b,t.opacity):new N}function k(t,e,n,i){return 1===arguments.length?m(t):new N(t,e,n,null==i?1:i)}function N(t,e,n,i){this.r=+t,this.g=+e,this.b=+n,this.opacity=+i}function M(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function v(t,e,n,i){return i<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new q(t,e,n,i)}function x(t,e,n,r){return 1===arguments.length?function(t){if(t instanceof q)return new q(t.h,t.s,t.l,t.opacity);if(t instanceof i||(t=b(t)),!t)return new q;if(t instanceof q)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,a=Math.min(e,n,r),h=Math.max(e,n,r),s=NaN,o=h-a,l=(h+a)/2;return o?(s=e===h?(n-r)/o+6*(n<r):n===h?(r-e)/o+2:(e-n)/o+4,o/=l<.5?h+a:2-h-a,s*=60):o=l>0&&l<1?0:s,new q(s,o,l,t.opacity)}(t):new q(t,e,n,null==r?1:r)}function q(t,e,n,i){this.h=+t,this.s=+e,this.l=+n,this.opacity=+i}function E(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}e(i,b,{displayable:function(){return this.rgb().displayable()},hex:function(){return this.rgb().hex()},toString:function(){return this.rgb()+""}}),e(N,k,n(i,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new N(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new N(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return 0<=this.r&&this.r<=255&&0<=this.g&&this.g<=255&&0<=this.b&&this.b<=255&&0<=this.opacity&&this.opacity<=1},hex:function(){return"#"+M(this.r)+M(this.g)+M(this.b)},toString:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}})),e(q,x,n(i,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new q(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new q(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,i=n+(n<.5?n:1-n)*e,r=2*n-i;return new N(E(t>=240?t-240:t+120,r,i),E(t,r,i),E(t<120?t+240:t-120,r,i),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1}}));var $=Math.PI/180,R=180/Math.PI,j=.96422,I=1,P=.82521,O=4/29,S=6/29,_=3*S*S,z=S*S*S;function C(t){if(t instanceof A)return new A(t.l,t.a,t.b,t.opacity);if(t instanceof K){if(isNaN(t.h))return new A(t.l,0,0,t.opacity);var e=t.h*$;return new A(t.l,Math.cos(e)*t.c,Math.sin(e)*t.c,t.opacity)}t instanceof N||(t=m(t));var n,i,r=G(t.r),a=G(t.g),h=G(t.b),s=B((.2225045*r+.7168786*a+.0606169*h)/I);return r===a&&a===h?n=i=s:(n=B((.4360747*r+.3850649*a+.1430804*h)/j),i=B((.0139322*r+.0971045*a+.7141733*h)/P)),new A(116*s-16,500*(n-s),200*(s-i),t.opacity)}function L(t,e,n,i){return 1===arguments.length?C(t):new A(t,e,n,null==i?1:i)}function A(t,e,n,i){this.l=+t,this.a=+e,this.b=+n,this.opacity=+i}function B(t){return t>z?Math.pow(t,1/3):t/_+O}function D(t){return t>S?t*t*t:_*(t-O)}function F(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function G(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function H(t){if(t instanceof K)return new K(t.h,t.c,t.l,t.opacity);if(t instanceof A||(t=C(t)),0===t.a&&0===t.b)return new K(NaN,0,t.l,t.opacity);var e=Math.atan2(t.b,t.a)*R;return new K(e<0?e+360:e,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}function J(t,e,n,i){return 1===arguments.length?H(t):new K(t,e,n,null==i?1:i)}function K(t,e,n,i){this.h=+t,this.c=+e,this.l=+n,this.opacity=+i}e(A,L,n(i,{brighter:function(t){return new A(this.l+18*(null==t?1:t),this.a,this.b,this.opacity)},darker:function(t){return new A(this.l-18*(null==t?1:t),this.a,this.b,this.opacity)},rgb:function(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,n=isNaN(this.b)?t:t-this.b/200;return new N(F(3.1338561*(e=j*D(e))-1.6168667*(t=I*D(t))-.4906146*(n=P*D(n))),F(-.9787684*e+1.9161415*t+.033454*n),F(.0719453*e-.2289914*t+1.4052427*n),this.opacity)}})),e(K,J,n(i,{brighter:function(t){return new K(this.h,this.c,this.l+18*(null==t?1:t),this.opacity)},darker:function(t){return new K(this.h,this.c,this.l-18*(null==t?1:t),this.opacity)},rgb:function(){return C(this).rgb()}}));var Q=-.14861,T=1.78277,U=-.29227,V=-.90649,W=1.97294,X=W*V,Y=W*T,Z=T*U-V*Q;function tt(t,e,n,i){return 1===arguments.length?function(t){if(t instanceof et)return new et(t.h,t.s,t.l,t.opacity);t instanceof N||(t=m(t));var e=t.r/255,n=t.g/255,i=t.b/255,r=(Z*i+X*e-Y*n)/(Z+X-Y),a=i-r,h=(W*(n-r)-U*a)/V,s=Math.sqrt(h*h+a*a)/(W*r*(1-r)),o=s?Math.atan2(h,a)*R-120:NaN;return new et(o<0?o+360:o,s,r,t.opacity)}(t):new et(t,e,n,null==i?1:i)}function et(t,e,n,i){this.h=+t,this.s=+e,this.l=+n,this.opacity=+i}e(et,tt,n(i,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new et(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new et(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=isNaN(this.h)?0:(this.h+120)*$,e=+this.l,n=isNaN(this.s)?0:this.s*e*(1-e),i=Math.cos(t),r=Math.sin(t);return new N(255*(e+n*(Q*i+T*r)),255*(e+n*(U*i+V*r)),255*(e+n*(W*i)),this.opacity)}})),t.color=b,t.rgb=k,t.hsl=x,t.lab=L,t.hcl=J,t.lch=function(t,e,n,i){return 1===arguments.length?H(t):new K(n,e,t,null==i?1:i)},t.gray=function(t,e){return new A(t,0,0,null==e?1:e)},t.cubehelix=tt,Object.defineProperty(t,"__esModule",{value:!0})}); |
{ | ||
"name": "d3-color", | ||
"version": "1.2.0", | ||
"version": "1.2.1", | ||
"description": "Color spaces! RGB, HSL, Cubehelix, Lab and HCL (Lch).", | ||
@@ -30,14 +30,13 @@ "keywords": [ | ||
"scripts": { | ||
"pretest": "rm -rf build && mkdir build && rollup --banner \"$(preamble)\" -f umd -n d3 -o build/d3-color.js -- index.js", | ||
"pretest": "rm -rf build && mkdir build && rollup -c", | ||
"test": "tape 'test/**/*-test.js' && eslint index.js src test", | ||
"prepublish": "npm run test && uglifyjs --preamble \"$(preamble)\" build/d3-color.js -c -m -o build/d3-color.min.js", | ||
"postpublish": "git push && git push --tags && cd ../d3.github.com && cp ../d3-color/build/d3-color.js d3-color.v1.js && cp ../d3-color/build/d3-color.min.js d3-color.v1.min.js && git add d3-color.v1.js d3-color.v1.min.js && git commit -m \"d3-color ${npm_package_version}\" && git push && cd - && zip -j build/d3-color.zip -- LICENSE README.md build/d3-color.js build/d3-color.min.js" | ||
"prepublish": "yarn test", | ||
"postpublish": "git push && git push --tags && cd ../d3.github.com && git pull && cp ../d3-color/build/d3-color.js d3-color.v1.js && cp ../d3-color/build/d3-color.min.js d3-color.v1.min.js && git add d3-color.v1.js d3-color.v1.min.js && git commit -m \"d3-color ${npm_package_version}\" && git push && cd - && zip -j build/d3-color.zip -- LICENSE README.md build/d3-color.js build/d3-color.min.js" | ||
}, | ||
"devDependencies": { | ||
"eslint": "3", | ||
"package-preamble": "0.0", | ||
"rollup": "0.41", | ||
"tape": "4", | ||
"uglify-js": "^2.8.11" | ||
"eslint": "5", | ||
"rollup": "0.64", | ||
"rollup-plugin-terser": "1", | ||
"tape": "4" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
89465
4
14
1089