@d3plus/color 3.0.14 → 3.0.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@d3plus/color",
3
- "version": "3.0.14",
3
+ "version": "3.0.15",
4
4
  "description": "Color functions that extent the ability of d3-color.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -1,7 +1,7 @@
1
1
  /*
2
- @d3plus/color v3.0.14
2
+ @d3plus/color v3.0.15
3
3
  Color functions that extent the ability of d3-color.
4
- Copyright (c) 2025 D3plus - https://d3plus.org
4
+ Copyright (c) 2026 D3plus - https://d3plus.org
5
5
  @license MIT
6
6
  */
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
- @d3plus/color v3.0.14
2
+ @d3plus/color v3.0.15
3
3
  Color functions that extent the ability of d3-color.
4
- Copyright (c) 2025 D3plus - https://d3plus.org
4
+ Copyright (c) 2026 D3plus - https://d3plus.org
5
5
  @license MIT
6
6
  */
7
7
  (e=>{"function"==typeof define&&define.amd?define(e):e()})(function(){if("undefined"!=typeof window){try{if("undefined"==typeof SVGElement||Boolean(SVGElement.prototype.innerHTML))return}catch(e){return}function n(e){switch(e.nodeType){case 1:var t=e,r="";return r+="<"+t.tagName,t.hasAttributes()&&[].forEach.call(t.attributes,function(e){r+=" "+e.name+'="'+e.value+'"'}),r+=">",t.hasChildNodes()&&[].forEach.call(t.childNodes,function(e){r+=n(e)}),r+="</"+t.tagName+">";case 3:return e.textContent.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");case 8:return"\x3c!--"+e.nodeValue+"--\x3e"}}Object.defineProperty(SVGElement.prototype,"innerHTML",{get:function(){var t="";return[].forEach.call(this.childNodes,function(e){t+=n(e)}),t},set:function(e){for(;this.firstChild;)this.removeChild(this.firstChild);try{var t=new DOMParser,r=(t.async=!1,"<svg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'>"+e+"</svg>"),n=t.parseFromString(r,"text/xml").documentElement;[].forEach.call(n.childNodes,function(e){this.appendChild(this.ownerDocument.importNode(e,!0))}.bind(this))}catch(e){throw new Error("Error parsing markup string")}}}),Object.defineProperty(SVGElement.prototype,"innerSVG",{get:function(){return this.innerHTML},set:function(e){this.innerHTML=e}})}}),((e,t)=>{"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define("@d3plus/color",["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).d3plus={})})(this,function(e){function t(e,t,r){(e.prototype=t.prototype=r).constructor=e}function r(e,t){var r,n=Object.create(e.prototype);for(r in t)n[r]=t[r];return n}function f(){}var n,i,a=1/.7,o="\\s*([+-]?\\d+)\\s*",s="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",l="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",c=/^#([0-9a-f]{3,8})$/,T=new RegExp(`^rgb\\(${o},${o},${o}\\)$`),P=new RegExp(`^rgb\\(${l},${l},${l}\\)$`),V=new RegExp(`^rgba\\(${o},${o},${o},${s}\\)$`),G=new RegExp(`^rgba\\(${l},${l},${l},${s}\\)$`),A=new RegExp(`^hsl\\(${s},${l},${l}\\)$`),D=new RegExp(`^hsla\\(${s},${l},${l},${s}\\)$`),h={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 u(){return this.rgb().formatHex()}function d(){return this.rgb().formatRgb()}function g(e){var t,r;return e=(e+"").trim().toLowerCase(),(t=c.exec(e))?(r=t[1].length,t=parseInt(t[1],16),6===r?b(t):3===r?new y(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===r?p(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===r?p(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=T.exec(e))?new y(t[1],t[2],t[3],1):(t=P.exec(e))?new y(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=V.exec(e))?p(t[1],t[2],t[3],t[4]):(t=G.exec(e))?p(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=A.exec(e))?N(t[1],t[2]/100,t[3]/100,1):(t=D.exec(e))?N(t[1],t[2]/100,t[3]/100,t[4]):h.hasOwnProperty(e)?b(h[e]):"transparent"===e?new y(NaN,NaN,NaN,0):null}function b(e){return new y(e>>16&255,e>>8&255,255&e,1)}function p(e,t,r,n){return new y(e=n<=0?t=r=NaN:e,t,r,n)}function m(e,t,r,n){return 1===arguments.length?(i=(i=e)instanceof f?i:g(i))?new y((i=i.rgb()).r,i.g,i.b,i.opacity):new y:new y(e,t,r,null==n?1:n);var i}function y(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}function w(){return"#"+x(this.r)+x(this.g)+x(this.b)}function k(){var e=v(this.opacity);return(1===e?"rgb(":"rgba(")+$(this.r)+`, ${$(this.g)}, `+$(this.b)+(1===e?")":`, ${e})`)}function v(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function $(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function x(e){return((e=$(e))<16?"0":"")+e.toString(16)}function N(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||1<=r?e=t=NaN:t<=0&&(e=NaN),new S(e,t,r,n)}function M(e){var t,r,n,i,a,o,s,l;return e instanceof S?new S(e.h,e.s,e.l,e.opacity):(e=e instanceof f?e:g(e))?e instanceof S?e:(t=(e=e.rgb()).r/255,r=e.g/255,n=e.b/255,i=Math.min(t,r,n),o=NaN,l=((a=Math.max(t,r,n))+i)/2,(s=a-i)?(o=t===a?(r-n)/s+6*(r<n):r===a?(n-t)/s+2:(t-r)/s+4,s/=l<.5?a+i:2-a-i,o*=60):s=0<l&&l<1?0:o,new S(o,s,l,e.opacity)):new S}function E(e,t,r,n){return 1===arguments.length?M(e):new S(e,t,r,null==n?1:n)}function S(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}function H(e){return(e=(e||0)%360)<0?e+360:e}function O(e){return Math.max(0,Math.min(1,e||0))}
@@ -1,7 +1,7 @@
1
1
  /*
2
- @d3plus/color v3.0.14
2
+ @d3plus/color v3.0.15
3
3
  Color functions that extent the ability of d3-color.
4
- Copyright (c) 2025 D3plus - https://d3plus.org
4
+ Copyright (c) 2026 D3plus - https://d3plus.org
5
5
  @license MIT
6
6
  */
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
- @d3plus/color v3.0.14
2
+ @d3plus/color v3.0.15
3
3
  Color functions that extent the ability of d3-color.
4
- Copyright (c) 2025 D3plus - https://d3plus.org
4
+ Copyright (c) 2026 D3plus - https://d3plus.org
5
5
  @license MIT
6
6
  */
7
7
  (o=>{"function"==typeof define&&define.amd?define(o):o()})(function(){if("undefined"!=typeof window){try{if("undefined"==typeof SVGElement||Boolean(SVGElement.prototype.innerHTML))return}catch(o){return}function n(o){switch(o.nodeType){case 1:var e=o,r="";return r+="<"+e.tagName,e.hasAttributes()&&[].forEach.call(e.attributes,function(o){r+=" "+o.name+'="'+o.value+'"'}),r+=">",e.hasChildNodes()&&[].forEach.call(e.childNodes,function(o){r+=n(o)}),r+="</"+e.tagName+">";case 3:return o.textContent.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");case 8:return"\x3c!--"+o.nodeValue+"--\x3e"}}Object.defineProperty(SVGElement.prototype,"innerHTML",{get:function(){var e="";return[].forEach.call(this.childNodes,function(o){e+=n(o)}),e},set:function(o){for(;this.firstChild;)this.removeChild(this.firstChild);try{var e=new DOMParser,r=(e.async=!1,"<svg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'>"+o+"</svg>"),n=e.parseFromString(r,"text/xml").documentElement;[].forEach.call(n.childNodes,function(o){this.appendChild(this.ownerDocument.importNode(o,!0))}.bind(this))}catch(o){throw new Error("Error parsing markup string")}}}),Object.defineProperty(SVGElement.prototype,"innerSVG",{get:function(){return this.innerHTML},set:function(o){this.innerHTML=o}})}}),((o,e)=>{"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("d3-color"),require("d3-scale"),require("open-color/open-color.js")):"function"==typeof define&&define.amd?define("@d3plus/color",["exports","d3-color","d3-scale","open-color/open-color.js"],e):e((o="undefined"!=typeof globalThis?globalThis:o||self).d3plus={},o.d3Color,o.d3Scale,o.pkg)})(this,function(o,i,e,r){r=r.theme;