├── .github └── workflows │ └── main.yml ├── .gitignore ├── LICENSE ├── README.md ├── dist ├── index.esm.js ├── index.html ├── index.iife.js └── index.js ├── jest.config.js ├── package-lock.json ├── package.json ├── src ├── en.js ├── index.js └── utils.js └── tests ├── colorDescriptionLib.test.js └── test.js /.github/workflows/main.yml: -------------------------------------------------------------------------------- 1 | name: Build and Deploy 2 | 3 | on: [push] 4 | 5 | jobs: 6 | build-and-deploy: 7 | runs-on: ubuntu-latest 8 | steps: 9 | - name: Checkout 🛎️ 10 | uses: actions/checkout@v2.3.1 11 | 12 | - name: Install and Build 🔧 # This example project is built using npm and outputs the result to the 'build' folder. Replace with the commands required to build your project, or remove this step entirely if your site is pre-built. 13 | run: | 14 | npm install 15 | npm run build 16 | 17 | - name: Deploy 🚀 18 | uses: JamesIves/github-pages-deploy-action@4.1.5 19 | with: 20 | branch: gh-pages # The branch the action should deploy to. 21 | folder: dist # The folder the action should deploy. 22 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .idea 3 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 words 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 📜 color-description 2 | 3 | Color-Description is a class that turns a technical color representation into a human readable description. 4 | 5 | ## Installation 6 | 7 | `npm install color-description` 8 | 9 | ## Usage 10 | 11 | ```js 12 | import ColorDescription from "color-description/dist/index.esm"; 13 | 14 | console.log(ColorDescription); 15 | 16 | const cd = new ColorDescription("#ffffff"); 17 | 18 | console.log(cd.getDescriptiveList()); 19 | /** 20 | * pale, light, faded, delicate, glistening, bleached, neutral colorless, bright, briliant and high 21 | **/ 22 | 23 | cd.color = "red"; 24 | 25 | console.log(cd.getDescriptiveList()); 26 | /** 27 | * saturated, strong, lush, ablaze, beaming, bold, brilliant, flamboyant, vibrant, vivid, loud, very saturated, warm, mellow, red and reddish 28 | **/ 29 | ``` 30 | 31 | ## Color Meaning & Translation 32 | 33 | The default dataset that is written in english so the "Emotions" and "Usage" very subjective and are written from a western perspective: 34 | https://github.com/words/color-description/blob/21ffa6b522f1751b471907aac4173acdc5c92fae/src/en.js 35 | 36 | ## Data Sources 37 | 38 | ### Color Psychology 39 | 40 | - [colorpsychology.org](https://www.colorpsychology.org/) 41 | - [Color Poster](https://graf1x.com/color-psychology-emotion-meaning-poster/) 42 | - [Wikipedia](https://en.wikipedia.org/wiki/Color_psychology#:~:text=Color%20psychology%20is%20the%20study,as%20the%20taste%20of%20food.&text=Colors%20can%20also%20enhance%20the,are%20generally%20used%20as%20stimulants.) 43 | 44 | ### Named Primary, Secondary and Tertiary Colors 45 | 46 | - [Named color wheel](https://en.wikipedia.org/wiki/Hue#24_hues_of_HSL/HSV) 47 | - [Named color wheel 2](https://www.color-meanings.com/primary-secondary-tertiary-colors/) 48 | 49 | ### Color Adjectives 50 | 51 | - [Adjective List](https://grammar.yourdictionary.com/grammar/word-lists/list-of-words-to-describe-colors.html) 52 | - [Human Colors](https://github.com/vasilisvg/human-colours/blob/master/js/human-colours-en-gb.js) 53 | 54 | ### Descriptions 55 | 56 | - [color meanings](https://www.canva.com/colors/color-meanings/) 57 | -------------------------------------------------------------------------------- /dist/index.esm.js: -------------------------------------------------------------------------------- 1 | var Zo=Object.defineProperty;var Mr=e=>{throw TypeError(e)};var Bo=(e,t,r)=>t in e?Zo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var vt=(e,t,r)=>Bo(e,typeof t!="symbol"?t+"":t,r),Fo=(e,t,r)=>t.has(e)||Mr("Cannot "+r);var wr=(e,t,r)=>t.has(e)?Mr("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r);var te=(e,t,r)=>(Fo(e,t,"access private method"),r);var{round:Ko,min:yt,max:Ae,log:$e,floor:Uo,random:Vo}=Math,Qo=e=>{let t=e/100,r,n,o;return t<66?(r=1,n=t<6?0:(-155.25485562709179-.44596950469579133*(n=t-2)+104.49216199393888*$e(n))/255,o=t<20?0:(-254.76935184120902+.8274096064007395*(o=t-10)+115.67994401066147*$e(o))/255):(r=(351.97690566805693+.114206453784165*(r=t-55)-40.25366309332127*$e(r))/255,n=(325.4494125711974+.07943456536662342*(n=t-50)-28.0852963507957*$e(n))/255,o=1),{r:Ae(0,yt(1,r)),g:Ae(0,yt(1,n)),b:Ae(0,yt(1,o)),a:1}},Tr=e=>{let{r:t,g:r,b:n}=e,o=1e3,a=4e4,i=.4,l;for(;a-o>i;){l=(a+o)*.5;let d=Qo(l);d.b/d.r>=n/t?a=l:o=l}return Ko(l)},kr=(e,t,r)=>e>=t&&e<=r,Mt=e=>{let t=[...e];for(let r=t.length-1;r>0;r--){let n=Uo(Vo()*(r+1));[t[r],t[n]]=[t[n],t[r]]}return t},zr=e=>{let{r:t,g:r,b:n}=e,o=1-Ae(t,r,n),a=1-o;return{mode:"cmyk",c:a&&(a-t)/a,m:a&&(a-r)/a,y:a&&(a-n)/a,k:o}};var en=(e,t)=>{if(typeof e=="number"){if(t===3)return{mode:"rgb",r:(e>>8&15|e>>4&240)/255,g:(e>>4&15|e&240)/255,b:(e&15|e<<4&240)/255};if(t===4)return{mode:"rgb",r:(e>>12&15|e>>8&240)/255,g:(e>>8&15|e>>4&240)/255,b:(e>>4&15|e&240)/255,alpha:(e&15|e<<4&240)/255};if(t===6)return{mode:"rgb",r:(e>>16&255)/255,g:(e>>8&255)/255,b:(e&255)/255};if(t===8)return{mode:"rgb",r:(e>>24&255)/255,g:(e>>16&255)/255,b:(e>>8&255)/255,alpha:(e&255)/255}}},De=en;var tn={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},Lr=tn;var rn=e=>De(Lr[e.toLowerCase()],6),Rr=rn;var on=/^#?([0-9a-f]{8}|[0-9a-f]{6}|[0-9a-f]{4}|[0-9a-f]{3})$/i,nn=e=>{let t;return(t=e.match(on))?De(parseInt(t[1],16),t[1].length):void 0},Xr=nn;var X="([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)",Ci=`(?:${X}|none)`,re=`${X}%`,Oi=`(?:${X}%|none)`,ze=`(?:${X}%|${X})`,an=`(?:${X}%|${X}|none)`,Hr=`(?:${X}(deg|grad|rad|turn)|${X})`,Ni=`(?:${X}(deg|grad|rad|turn)|${X}|none)`,Y="\\s*,\\s*";var qi=new RegExp("^"+an+"$");var ln=new RegExp(`^rgba?\\(\\s*${X}${Y}${X}${Y}${X}\\s*(?:,\\s*${ze}\\s*)?\\)$`),sn=new RegExp(`^rgba?\\(\\s*${re}${Y}${re}${Y}${re}\\s*(?:,\\s*${ze}\\s*)?\\)$`),fn=e=>{let t={mode:"rgb"},r;if(r=e.match(ln))r[1]!==void 0&&(t.r=r[1]/255),r[2]!==void 0&&(t.g=r[2]/255),r[3]!==void 0&&(t.b=r[3]/255);else if(r=e.match(sn))r[1]!==void 0&&(t.r=r[1]/100),r[2]!==void 0&&(t.g=r[2]/100),r[3]!==void 0&&(t.b=r[3]/100);else return;return r[4]!==void 0?t.alpha=Math.max(0,Math.min(1,r[4]/100)):r[5]!==void 0&&(t.alpha=Math.max(0,Math.min(1,+r[5]))),t},_r=fn;var dn=(e,t)=>e===void 0?void 0:typeof e!="object"?Le(e):e.mode!==void 0?e:t?{...e,mode:t}:void 0,Sr=dn;var un=(e="rgb")=>t=>(t=Sr(t,e))!==void 0?t.mode===e?t:q[t.mode][e]?q[t.mode][e](t):e==="rgb"?q[t.mode].rgb(t):q.rgb[e](q[t.mode].rgb(t)):void 0,W=un;var q={},Ir={},Re=[],wt={},pn=e=>e,g=e=>(q[e.mode]={...q[e.mode],...e.toMode},Object.keys(e.fromMode||{}).forEach(t=>{q[t]||(q[t]={}),q[t][e.mode]=e.fromMode[t]}),e.ranges||(e.ranges={}),e.difference||(e.difference={}),e.channels.forEach(t=>{if(e.ranges[t]===void 0&&(e.ranges[t]=[0,1]),!e.interpolate[t])throw new Error(`Missing interpolator for: ${t}`);typeof e.interpolate[t]=="function"&&(e.interpolate[t]={use:e.interpolate[t]}),e.interpolate[t].fixup||(e.interpolate[t].fixup=pn)}),Ir[e.mode]=e,(e.parse||[]).forEach(t=>{cn(t,e.mode)}),W(e.mode)),Pr=e=>Ir[e],cn=(e,t)=>{if(typeof e=="string"){if(!t)throw new Error("'mode' required when 'parser' is a string");wt[e]=t}else typeof e=="function"&&Re.indexOf(e)<0&&Re.push(e)};var Tt=/[^\x00-\x7F]|[a-zA-Z_]/,mn=/[^\x00-\x7F]|[-\w]/,s={Function:"function",Ident:"ident",Number:"number",Percentage:"percentage",ParenClose:")",None:"none",Hue:"hue",Alpha:"alpha"},u=0;function je(e){let t=e[u],r=e[u+1];return t==="-"||t==="+"?/\d/.test(r)||r==="."&&/\d/.test(e[u+2]):t==="."?/\d/.test(r):/\d/.test(t)}function kt(e){if(u>=e.length)return!1;let t=e[u];if(Tt.test(t))return!0;if(t==="-"){if(e.length-u<2)return!1;let r=e[u+1];return!!(r==="-"||Tt.test(r))}return!1}var hn={deg:1,rad:180/Math.PI,grad:9/10,turn:360};function Xe(e){let t="";if((e[u]==="-"||e[u]==="+")&&(t+=e[u++]),t+=Je(e),e[u]==="."&&/\d/.test(e[u+1])&&(t+=e[u++]+Je(e)),(e[u]==="e"||e[u]==="E")&&((e[u+1]==="-"||e[u+1]==="+")&&/\d/.test(e[u+2])?t+=e[u++]+e[u++]+Je(e):/\d/.test(e[u+1])&&(t+=e[u++]+Je(e))),kt(e)){let r=Ee(e);return r==="deg"||r==="rad"||r==="turn"||r==="grad"?{type:s.Hue,value:t*hn[r]}:void 0}return e[u]==="%"?(u++,{type:s.Percentage,value:+t}):{type:s.Number,value:+t}}function Je(e){let t="";for(;/\d/.test(e[u]);)t+=e[u++];return t}function Ee(e){let t="";for(;u4)){if(r.length===4){if(r[3].type!==s.Alpha)return;r[3]=r[3].value}return r.length===3&&r.push({type:s.None,value:void 0}),r.every(o=>o.type!==s.Alpha)?r:void 0}}function vn(e,t){e._i=0;let r=e[e._i++];if(!r||r.type!==s.Function)return;let n=Cr(e,t);if(n)return n.unshift(r.value),n}var yn=e=>{if(typeof e!="string")return;let t=gn(e),r=t?vn(t,!0):void 0,n,o=0,a=Re.length;for(;oe==="transparent"?{mode:"rgb",r:0,g:0,b:0,alpha:0}:void 0,Nr=wn;var qr=(e,t,r)=>e+r*(t-e);var Tn=e=>{let t=[];for(let r=0;rt=>{let r=Tn(t);return n=>{let o=n*r.length,a=n>=1?r.length-1:Math.max(Math.floor(o),0),i=r[a];return i===void 0?void 0:e(i[0],i[1],o-a)}};var f=$r(qr);var m=e=>{let t=!1,r=e.map(n=>n!==void 0?(t=!0,n):1);return t?r:e};var kn={mode:"rgb",channels:["r","g","b","alpha"],parse:[Or,Xr,_r,Rr,Nr,"srgb"],serialize:"srgb",interpolate:{r:f,g:f,b:f,alpha:{use:f,fixup:m}},gamut:!0,white:{r:1,g:1,b:1},black:{r:0,g:0,b:0}},C=kn;var zt=(e=0)=>Math.pow(Math.abs(e),2.19921875)*Math.sign(e),zn=e=>{let t=zt(e.r),r=zt(e.g),n=zt(e.b),o={mode:"xyz65",x:.5766690429101305*t+.1855582379065463*r+.1882286462349947*n,y:.297344975250536*t+.6273635662554661*r+.0752914584939979*n,z:.0270313613864123*t+.0706888525358272*r+.9913375368376386*n};return e.alpha!==void 0&&(o.alpha=e.alpha),o},Lt=zn;var Rt=e=>Math.pow(Math.abs(e),.4547069271758437)*Math.sign(e),Ln=({x:e,y:t,z:r,alpha:n})=>{e===void 0&&(e=0),t===void 0&&(t=0),r===void 0&&(r=0);let o={mode:"a98",r:Rt(e*2.0415879038107465-t*.5650069742788597-.3447313507783297*r),g:Rt(e*-.9692436362808798+t*1.8759675015077206+.0415550574071756*r),b:Rt(e*.0134442806320312-t*.1183623922310184+1.0151749943912058*r)};return n!==void 0&&(o.alpha=n),o},Xt=Ln;var Ht=(e=0)=>{let t=Math.abs(e);return t<=.04045?e/12.92:(Math.sign(e)||1)*Math.pow((t+.055)/1.055,2.4)},Rn=({r:e,g:t,b:r,alpha:n})=>{let o={mode:"lrgb",r:Ht(e),g:Ht(t),b:Ht(r)};return n!==void 0&&(o.alpha=n),o},O=Rn;var Xn=e=>{let{r:t,g:r,b:n,alpha:o}=O(e),a={mode:"xyz65",x:.4123907992659593*t+.357584339383878*r+.1804807884018343*n,y:.2126390058715102*t+.715168678767756*r+.0721923153607337*n,z:.0193308187155918*t+.119194779794626*r+.9505321522496607*n};return o!==void 0&&(a.alpha=o),a},_=Xn;var _t=(e=0)=>{let t=Math.abs(e);return t>.0031308?(Math.sign(e)||1)*(1.055*Math.pow(t,.4166666666666667)-.055):e*12.92},Hn=({r:e,g:t,b:r,alpha:n},o="rgb")=>{let a={mode:o,r:_t(e),g:_t(t),b:_t(r)};return n!==void 0&&(a.alpha=n),a},N=Hn;var _n=({x:e,y:t,z:r,alpha:n})=>{e===void 0&&(e=0),t===void 0&&(t=0),r===void 0&&(r=0);let o=N({r:e*3.2409699419045226-t*1.537383177570094-.4986107602930034*r,g:e*-.9692436362808796+t*1.8759675015077204+.0415550574071756*r,b:e*.0556300796969936-t*.2039769588889765+1.0569715142428784*r});return n!==void 0&&(o.alpha=n),o},S=_n;var Sn={...C,mode:"a98",parse:["a98-rgb"],serialize:"a98-rgb",fromMode:{rgb:e=>Xt(_(e)),xyz65:Xt},toMode:{rgb:e=>S(Lt(e)),xyz65:Lt}},Ar=Sn;var In=e=>(e=e%360)<0?e+360:e,v=In;var Pn=(e,t)=>e.map((r,n,o)=>{if(r===void 0)return r;let a=v(r);return n===0||e[n-1]===void 0?a:t(a-v(o[n-1]))}).reduce((r,n)=>!r.length||n===void 0||r[r.length-1]===void 0?(r.push(n),r):(r.push(n+r[r.length-1]),r),[]),k=e=>Pn(e,t=>Math.abs(t)<=180?t:t-360*Math.sign(t));var M=[-.14861,1.78277,-.29227,-.90649,1.97294,0],Dr=Math.PI/180,jr=180/Math.PI;var Jr=M[3]*M[4],Er=M[1]*M[4],Yr=M[1]*M[2]-M[0]*M[3],Cn=({r:e,g:t,b:r,alpha:n})=>{e===void 0&&(e=0),t===void 0&&(t=0),r===void 0&&(r=0);let o=(Yr*r+e*Jr-t*Er)/(Yr+Jr-Er),a=r-o,i=(M[4]*(t-o)-M[2]*a)/M[3],l={mode:"cubehelix",l:o,s:o===0||o===1?void 0:Math.sqrt(a*a+i*i)/(M[4]*o*(1-o))};return l.s&&(l.h=Math.atan2(i,a)*jr-120),n!==void 0&&(l.alpha=n),l},Wr=Cn;var On=({h:e,s:t,l:r,alpha:n})=>{let o={mode:"rgb"};e=(e===void 0?0:e+120)*Dr,r===void 0&&(r=0);let a=t===void 0?0:t*r*(1-r),i=Math.cos(e),l=Math.sin(e);return o.r=r+a*(M[0]*i+M[1]*l),o.g=r+a*(M[2]*i+M[3]*l),o.b=r+a*(M[4]*i+M[5]*l),n!==void 0&&(o.alpha=n),o},Gr=On;var G=(e,t)=>{if(e.h===void 0||t.h===void 0||!e.s||!t.s)return 0;let r=v(e.h),n=v(t.h),o=Math.sin((n-r+360)/2*Math.PI/180);return 2*Math.sqrt(e.s*t.s)*o},Zr=(e,t)=>{if(e.h===void 0||t.h===void 0)return 0;let r=v(e.h),n=v(t.h);return Math.abs(n-r)>180?r-(n-360*Math.sign(n-r)):n-r},Z=(e,t)=>{if(e.h===void 0||t.h===void 0||!e.c||!t.c)return 0;let r=v(e.h),n=v(t.h),o=Math.sin((n-r+360)/2*Math.PI/180);return 2*Math.sqrt(e.c*t.c)*o};var z=e=>{let t=e.reduce((n,o)=>{if(o!==void 0){let a=o*Math.PI/180;n.sin+=Math.sin(a),n.cos+=Math.cos(a)}return n},{sin:0,cos:0}),r=Math.atan2(t.sin,t.cos)*180/Math.PI;return r<0?360+r:r};var Nn={mode:"cubehelix",channels:["h","s","l","alpha"],parse:["--cubehelix"],serialize:"--cubehelix",ranges:{h:[0,360],s:[0,4.614],l:[0,1]},fromMode:{rgb:Wr},toMode:{rgb:Gr},interpolate:{h:{use:f,fixup:k},s:f,l:f,alpha:{use:f,fixup:m}},difference:{h:G},average:{h:z}},Br=Nn;var qn=({l:e,a:t,b:r,alpha:n},o="lch")=>{t===void 0&&(t=0),r===void 0&&(r=0);let a=Math.sqrt(t*t+r*r),i={mode:o,l:e,c:a};return a&&(i.h=v(Math.atan2(r,t)*180/Math.PI)),n!==void 0&&(i.alpha=n),i},I=qn;var $n=({l:e,c:t,h:r,alpha:n},o="lab")=>{r===void 0&&(r=0);let a={mode:o,l:e,a:t?t*Math.cos(r/180*Math.PI):0,b:t?t*Math.sin(r/180*Math.PI):0};return n!==void 0&&(a.alpha=n),a},P=$n;var Ye=Math.pow(29,3)/Math.pow(3,3),We=Math.pow(6,3)/Math.pow(29,3);var y={X:.9642956764295677,Y:1,Z:.8251046025104602},B={X:.3127/.329,Y:1,Z:(1-.3127-.329)/.329},Kl=Math.pow(29,3)/Math.pow(3,3),Ul=Math.pow(6,3)/Math.pow(29,3);var St=e=>Math.pow(e,3)>We?Math.pow(e,3):(116*e-16)/Ye,An=({l:e,a:t,b:r,alpha:n})=>{e===void 0&&(e=0),t===void 0&&(t=0),r===void 0&&(r=0);let o=(e+16)/116,a=t/500+o,i=o-r/200,l={mode:"xyz65",x:St(a)*B.X,y:St(o)*B.Y,z:St(i)*B.Z};return n!==void 0&&(l.alpha=n),l},Ge=An;var Dn=e=>S(Ge(e)),F=Dn;var It=e=>e>We?Math.cbrt(e):(Ye*e+16)/116,jn=({x:e,y:t,z:r,alpha:n})=>{e===void 0&&(e=0),t===void 0&&(t=0),r===void 0&&(r=0);let o=It(e/B.X),a=It(t/B.Y),i=It(r/B.Z),l={mode:"lab65",l:116*a-16,a:500*(o-a),b:200*(a-i)};return n!==void 0&&(l.alpha=n),l},Ze=jn;var Jn=e=>{let t=Ze(_(e));return e.r===e.b&&e.b===e.g&&(t.a=t.b=0),t},K=Jn;var oe=.14444444444444443*Math.PI,ie=Math.cos(oe),le=Math.sin(oe),Be=100/Math.log(139/100);var En=({l:e,c:t,h:r,alpha:n})=>{e===void 0&&(e=0),t===void 0&&(t=0),r===void 0&&(r=0);let o={mode:"lab65",l:(Math.exp(e*1/Be)-1)/.0039},a=(Math.exp(.0435*t*1*1)-1)/.075,i=a*Math.cos(r/180*Math.PI-oe),l=a*Math.sin(r/180*Math.PI-oe);return o.a=i*ie-l/.83*le,o.b=i*le+l/.83*ie,n!==void 0&&(o.alpha=n),o},_e=En;var Yn=({l:e,a:t,b:r,alpha:n})=>{e===void 0&&(e=0),t===void 0&&(t=0),r===void 0&&(r=0);let o=t*ie+r*le,a=.83*(r*ie-t*le),i=Math.sqrt(o*o+a*a),l={mode:"dlch",l:Be/1*Math.log(1+.0039*e),c:Math.log(1+.075*i)/(.0435*1*1)};return l.c&&(l.h=v((Math.atan2(a,o)+oe)/Math.PI*180)),n!==void 0&&(l.alpha=n),l},Se=Yn;var Fr=e=>_e(I(e,"dlch")),Kr=e=>P(Se(e),"dlab"),Wn={mode:"dlab",parse:["--din99o-lab"],serialize:"--din99o-lab",toMode:{lab65:Fr,rgb:e=>F(Fr(e))},fromMode:{lab65:Kr,rgb:e=>Kr(K(e))},channels:["l","a","b","alpha"],ranges:{l:[0,100],a:[-40.09,45.501],b:[-40.469,44.344]},interpolate:{l:f,a:f,b:f,alpha:{use:f,fixup:m}}},Ur=Wn;var Gn={mode:"dlch",parse:["--din99o-lch"],serialize:"--din99o-lch",toMode:{lab65:_e,dlab:e=>P(e,"dlab"),rgb:e=>F(_e(e))},fromMode:{lab65:Se,dlab:e=>I(e,"dlch"),rgb:e=>Se(K(e))},channels:["l","c","h","alpha"],ranges:{l:[0,100],c:[0,51.484],h:[0,360]},interpolate:{l:f,c:f,h:{use:f,fixup:k},alpha:{use:f,fixup:m}},difference:{h:Z},average:{h:z}},Vr=Gn;function Ct({h:e,s:t,i:r,alpha:n}){e=v(e!==void 0?e:0),t===void 0&&(t=0),r===void 0&&(r=0);let o=Math.abs(e/60%2-1),a;switch(Math.floor(e/60)){case 0:a={r:r*(1+t*(3/(2-o)-1)),g:r*(1+t*(3*(1-o)/(2-o)-1)),b:r*(1-t)};break;case 1:a={r:r*(1+t*(3*(1-o)/(2-o)-1)),g:r*(1+t*(3/(2-o)-1)),b:r*(1-t)};break;case 2:a={r:r*(1-t),g:r*(1+t*(3/(2-o)-1)),b:r*(1+t*(3*(1-o)/(2-o)-1))};break;case 3:a={r:r*(1-t),g:r*(1+t*(3*(1-o)/(2-o)-1)),b:r*(1+t*(3/(2-o)-1))};break;case 4:a={r:r*(1+t*(3*(1-o)/(2-o)-1)),g:r*(1-t),b:r*(1+t*(3/(2-o)-1))};break;case 5:a={r:r*(1+t*(3/(2-o)-1)),g:r*(1-t),b:r*(1+t*(3*(1-o)/(2-o)-1))};break;default:a={r:r*(1-t),g:r*(1-t),b:r*(1-t)}}return a.mode="rgb",n!==void 0&&(a.alpha=n),a}function Ot({r:e,g:t,b:r,alpha:n}){e===void 0&&(e=0),t===void 0&&(t=0),r===void 0&&(r=0);let o=Math.max(e,t,r),a=Math.min(e,t,r),i={mode:"hsi",s:e+t+r===0?0:1-3*a/(e+t+r),i:(e+t+r)/3};return o-a!==0&&(i.h=(o===e?(t-r)/(o-a)+(t{switch(t){case"deg":return+e;case"rad":return e/Math.PI*180;case"grad":return e/10*9;case"turn":return e*360}},eo=Bn;var Fn=new RegExp(`^hsla?\\(\\s*${Hr}${Y}${re}${Y}${re}\\s*(?:,\\s*${ze}\\s*)?\\)$`),Kn=e=>{let t=e.match(Fn);if(!t)return;let r={mode:"hsl"};return t[3]!==void 0?r.h=+t[3]:t[1]!==void 0&&t[2]!==void 0&&(r.h=eo(t[1],t[2])),t[4]!==void 0&&(r.s=Math.min(Math.max(0,t[4]/100),1)),t[5]!==void 0&&(r.l=Math.min(Math.max(0,t[5]/100),1)),t[6]!==void 0?r.alpha=Math.max(0,Math.min(1,t[6]/100)):t[7]!==void 0&&(r.alpha=Math.max(0,Math.min(1,+t[7]))),r},to=Kn;function Un(e,t){if(!t||t[0]!=="hsl"&&t[0]!=="hsla")return;let r={mode:"hsl"},[,n,o,a,i]=t;if(n.type!==s.None){if(n.type===s.Percentage)return;r.h=n.value}if(o.type!==s.None){if(o.type===s.Hue)return;r.s=o.value/100}if(a.type!==s.None){if(a.type===s.Hue)return;r.l=a.value/100}return i.type!==s.None&&(r.alpha=Math.min(1,Math.max(0,i.type===s.Number?i.value:i.value/100))),r}var ro=Un;var Vn={mode:"hsl",toMode:{rgb:Nt},fromMode:{rgb:qt},channels:["h","s","l","alpha"],ranges:{h:[0,360]},gamut:"rgb",parse:[ro,to],serialize:e=>`hsl(${e.h!==void 0?e.h:"none"} ${e.s!==void 0?e.s*100+"%":"none"} ${e.l!==void 0?e.l*100+"%":"none"}${e.alpha<1?` / ${e.alpha}`:""})`,interpolate:{h:{use:f,fixup:k},s:f,l:f,alpha:{use:f,fixup:m}},difference:{h:G},average:{h:z}},Fe=Vn;function Ie({h:e,s:t,v:r,alpha:n}){e=v(e!==void 0?e:0),t===void 0&&(t=0),r===void 0&&(r=0);let o=Math.abs(e/60%2-1),a;switch(Math.floor(e/60)){case 0:a={r,g:r*(1-t*o),b:r*(1-t)};break;case 1:a={r:r*(1-t*o),g:r,b:r*(1-t)};break;case 2:a={r:r*(1-t),g:r,b:r*(1-t*o)};break;case 3:a={r:r*(1-t),g:r*(1-t*o),b:r};break;case 4:a={r:r*(1-t*o),g:r*(1-t),b:r};break;case 5:a={r,g:r*(1-t),b:r*(1-t*o)};break;default:a={r:r*(1-t),g:r*(1-t),b:r*(1-t)}}return a.mode="rgb",n!==void 0&&(a.alpha=n),a}function Pe({r:e,g:t,b:r,alpha:n}){e===void 0&&(e=0),t===void 0&&(t=0),r===void 0&&(r=0);let o=Math.max(e,t,r),a=Math.min(e,t,r),i={mode:"hsv",s:o===0?0:1-a/o,v:o};return o-a!==0&&(i.h=(o===e?(t-r)/(o-a)+(t1){let o=t+r;t/=o,r/=o}return Ie({h:e,s:r===1?1:1-t/(1-r),v:1-r,alpha:n})}function At(e){let t=Pe(e);if(t===void 0)return;let r=t.s!==void 0?t.s:0,n=t.v!==void 0?t.v:0,o={mode:"hwb",w:(1-r)*n,b:1-n};return t.h!==void 0&&(o.h=t.h),t.alpha!==void 0&&(o.alpha=t.alpha),o}function ea(e,t){if(!t||t[0]!=="hwb")return;let r={mode:"hwb"},[,n,o,a,i]=t;if(n.type!==s.None){if(n.type===s.Percentage)return;r.h=n.value}if(o.type!==s.None){if(o.type===s.Hue)return;r.w=o.value/100}if(a.type!==s.None){if(a.type===s.Hue)return;r.b=a.value/100}return i.type!==s.None&&(r.alpha=Math.min(1,Math.max(0,i.type===s.Number?i.value:i.value/100))),r}var oo=ea;var ta={mode:"hwb",toMode:{rgb:$t},fromMode:{rgb:At},channels:["h","w","b","alpha"],ranges:{h:[0,360]},gamut:"rgb",parse:[oo],serialize:e=>`hwb(${e.h!==void 0?e.h:"none"} ${e.w!==void 0?e.w*100+"%":"none"} ${e.b!==void 0?e.b*100+"%":"none"}${e.alpha<1?` / ${e.alpha}`:""})`,interpolate:{h:{use:f,fixup:k},w:f,b:f,alpha:{use:f,fixup:m}},difference:{h:Zr},average:{h:z}},no=ta;var se=.1593017578125,ao=78.84375,fe=.8359375,de=18.8515625,ue=18.6875;function Ue(e){if(e<0)return 0;let t=Math.pow(e,1/ao);return 1e4*Math.pow(Math.max(0,t-fe)/(de-ue*t),1/se)}function Ve(e){if(e<0)return 0;let t=Math.pow(e/1e4,se);return Math.pow((fe+de*t)/(1+ue*t),ao)}var Dt=e=>Math.max(e/203,0),oa=({i:e,t,p:r,alpha:n})=>{e===void 0&&(e=0),t===void 0&&(t=0),r===void 0&&(r=0);let o=Ue(e+.008609037037932761*t+.11102962500302593*r),a=Ue(e-.00860903703793275*t-.11102962500302599*r),i=Ue(e+.5600313357106791*t-.32062717498731885*r),l={mode:"xyz65",x:Dt(2.070152218389422*o-1.3263473389671556*a+.2066510476294051*i),y:Dt(.3647385209748074*o+.680566024947227*a-.0453045459220346*i),z:Dt(-.049747207535812*o-.0492609666966138*a+1.1880659249923042*i)};return n!==void 0&&(l.alpha=n),l},jt=oa;var Jt=(e=0)=>Math.max(e*203,0),na=({x:e,y:t,z:r,alpha:n})=>{let o=Jt(e),a=Jt(t),i=Jt(r),l=Ve(.3592832590121217*o+.6976051147779502*a-.0358915932320289*i),d=Ve(-.1920808463704995*o+1.1004767970374323*a+.0753748658519118*i),p=Ve(.0070797844607477*o+.0748396662186366*a+.8433265453898765*i),c=.5*l+.5*d,h=1.61376953125*l-3.323486328125*d+1.709716796875*p,b=4.378173828125*l-4.24560546875*d-.132568359375*p,x={mode:"itp",i:c,t:h,p:b};return n!==void 0&&(x.alpha=n),x},Et=na;var aa={mode:"itp",channels:["i","t","p","alpha"],parse:["--ictcp"],serialize:"--ictcp",toMode:{xyz65:jt,rgb:e=>S(jt(e))},fromMode:{xyz65:Et,rgb:e=>Et(_(e))},ranges:{i:[0,.581],t:[-.369,.272],p:[-.164,.331]},interpolate:{i:f,t:f,p:f,alpha:{use:f,fixup:m}}},io=aa;var ia=134.03437499999998,la=16295499532821565e-27,Yt=e=>{if(e<0)return 0;let t=Math.pow(e/1e4,se);return Math.pow((fe+de*t)/(1+ue*t),ia)},Wt=(e=0)=>Math.max(e*203,0),sa=({x:e,y:t,z:r,alpha:n})=>{e=Wt(e),t=Wt(t),r=Wt(r);let o=1.15*e-.15*r,a=.66*t+.34*e,i=Yt(.41478972*o+.579999*a+.014648*r),l=Yt(-.20151*o+1.120649*a+.0531008*r),d=Yt(-.0166008*o+.2648*a+.6684799*r),p=(i+l)/2,c={mode:"jab",j:.44*p/(1-.56*p)-la,a:3.524*i-4.066708*l+.542708*d,b:.199076*i+1.096799*l-1.295875*d};return n!==void 0&&(c.alpha=n),c},Qe=sa;var fa=134.03437499999998,lo=16295499532821565e-27,Gt=e=>{if(e<0)return 0;let t=Math.pow(e,1/fa);return 1e4*Math.pow((fe-t)/(ue*t-de),1/se)},Zt=e=>e/203,da=({j:e,a:t,b:r,alpha:n})=>{e===void 0&&(e=0),t===void 0&&(t=0),r===void 0&&(r=0);let o=(e+lo)/(.44+.56*(e+lo)),a=Gt(o+.13860504*t+.058047316*r),i=Gt(o-.13860504*t-.058047316*r),l=Gt(o-.096019242*t-.8118919*r),d={mode:"xyz65",x:Zt(1.661373024652174*a-.914523081304348*i+.23136208173913045*l),y:Zt(-.3250758611844533*a+1.571847026732543*i-.21825383453227928*l),z:Zt(-.090982811*a-.31272829*i+1.5227666*l)};return n!==void 0&&(d.alpha=n),d},et=da;var ua=e=>{let t=Qe(_(e));return e.r===e.b&&e.b===e.g&&(t.a=t.b=0),t},tt=ua;var pa=e=>S(et(e)),rt=pa;var ca={mode:"jab",channels:["j","a","b","alpha"],parse:["--jzazbz"],serialize:"--jzazbz",fromMode:{rgb:tt,xyz65:Qe},toMode:{rgb:rt,xyz65:et},ranges:{j:[0,.222],a:[-.109,.129],b:[-.185,.134]},interpolate:{j:f,a:f,b:f,alpha:{use:f,fixup:m}}},so=ca;var ma=({j:e,a:t,b:r,alpha:n})=>{t===void 0&&(t=0),r===void 0&&(r=0);let o=Math.sqrt(t*t+r*r),a={mode:"jch",j:e,c:o};return o&&(a.h=v(Math.atan2(r,t)*180/Math.PI)),n!==void 0&&(a.alpha=n),a},Bt=ma;var ha=({j:e,c:t,h:r,alpha:n})=>{r===void 0&&(r=0);let o={mode:"jab",j:e,a:t?t*Math.cos(r/180*Math.PI):0,b:t?t*Math.sin(r/180*Math.PI):0};return n!==void 0&&(o.alpha=n),o},Ft=ha;var ba={mode:"jch",parse:["--jzczhz"],serialize:"--jzczhz",toMode:{jab:Ft,rgb:e=>rt(Ft(e))},fromMode:{rgb:e=>Bt(tt(e)),jab:Bt},channels:["j","c","h","alpha"],ranges:{j:[0,.221],c:[0,.19],h:[0,360]},interpolate:{h:{use:f,fixup:k},c:f,j:f,alpha:{use:f,fixup:m}},difference:{h:Z},average:{h:z}},fo=ba;var U=Math.pow(29,3)/Math.pow(3,3),pe=Math.pow(6,3)/Math.pow(29,3);var Kt=e=>Math.pow(e,3)>pe?Math.pow(e,3):(116*e-16)/U,ga=({l:e,a:t,b:r,alpha:n})=>{e===void 0&&(e=0),t===void 0&&(t=0),r===void 0&&(r=0);let o=(e+16)/116,a=t/500+o,i=o-r/200,l={mode:"xyz50",x:Kt(a)*y.X,y:Kt(o)*y.Y,z:Kt(i)*y.Z};return n!==void 0&&(l.alpha=n),l},ce=ga;var xa=({x:e,y:t,z:r,alpha:n})=>{e===void 0&&(e=0),t===void 0&&(t=0),r===void 0&&(r=0);let o=N({r:e*3.1341359569958707-t*1.6173863321612538-.4906619460083532*r,g:e*-.978795502912089+t*1.916254567259524+.03344273116131949*r,b:e*.07195537988411677-t*.2289768264158322+1.405386058324125*r});return n!==void 0&&(o.alpha=n),o},$=xa;var va=e=>$(ce(e)),ot=va;var ya=e=>{let{r:t,g:r,b:n,alpha:o}=O(e),a={mode:"xyz50",x:.436065742824811*t+.3851514688337912*r+.14307845442264197*n,y:.22249319175623702*t+.7168870538238823*r+.06061979053616537*n,z:.013923904500943465*t+.09708128566574634*r+.7140993584005155*n};return o!==void 0&&(a.alpha=o),a},A=ya;var Ut=e=>e>pe?Math.cbrt(e):(U*e+16)/116,Ma=({x:e,y:t,z:r,alpha:n})=>{e===void 0&&(e=0),t===void 0&&(t=0),r===void 0&&(r=0);let o=Ut(e/y.X),a=Ut(t/y.Y),i=Ut(r/y.Z),l={mode:"lab",l:116*a-16,a:500*(o-a),b:200*(a-i)};return n!==void 0&&(l.alpha=n),l},me=Ma;var wa=e=>{let t=me(A(e));return e.r===e.b&&e.b===e.g&&(t.a=t.b=0),t},nt=wa;function Ta(e,t){if(!t||t[0]!=="lab")return;let r={mode:"lab"},[,n,o,a,i]=t;if(!(n.type===s.Hue||o.type===s.Hue||a.type===s.Hue))return n.type!==s.None&&(r.l=Math.min(Math.max(0,n.value),100)),o.type!==s.None&&(r.a=o.type===s.Number?o.value:o.value*125/100),a.type!==s.None&&(r.b=a.type===s.Number?a.value:a.value*125/100),i.type!==s.None&&(r.alpha=Math.min(1,Math.max(0,i.type===s.Number?i.value:i.value/100))),r}var uo=Ta;var ka={mode:"lab",toMode:{xyz50:ce,rgb:ot},fromMode:{xyz50:me,rgb:nt},channels:["l","a","b","alpha"],ranges:{l:[0,100],a:[-100,100],b:[-100,100]},parse:[uo],serialize:e=>`lab(${e.l!==void 0?e.l:"none"} ${e.a!==void 0?e.a:"none"} ${e.b!==void 0?e.b:"none"}${e.alpha<1?` / ${e.alpha}`:""})`,interpolate:{l:f,a:f,b:f,alpha:{use:f,fixup:m}}},he=ka;var za={...he,mode:"lab65",parse:["--lab-d65"],serialize:"--lab-d65",toMode:{xyz65:Ge,rgb:F},fromMode:{xyz65:Ze,rgb:K},ranges:{l:[0,100],a:[-86.182,98.234],b:[-107.86,94.477]}},po=za;function La(e,t){if(!t||t[0]!=="lch")return;let r={mode:"lch"},[,n,o,a,i]=t;if(n.type!==s.None){if(n.type===s.Hue)return;r.l=Math.min(Math.max(0,n.value),100)}if(o.type!==s.None&&(r.c=Math.max(0,o.type===s.Number?o.value:o.value*150/100)),a.type!==s.None){if(a.type===s.Percentage)return;r.h=a.value}return i.type!==s.None&&(r.alpha=Math.min(1,Math.max(0,i.type===s.Number?i.value:i.value/100))),r}var co=La;var Ra={mode:"lch",toMode:{lab:P,rgb:e=>ot(P(e))},fromMode:{rgb:e=>I(nt(e)),lab:I},channels:["l","c","h","alpha"],ranges:{l:[0,100],c:[0,150],h:[0,360]},parse:[co],serialize:e=>`lch(${e.l!==void 0?e.l:"none"} ${e.c!==void 0?e.c:"none"} ${e.h!==void 0?e.h:"none"}${e.alpha<1?` / ${e.alpha}`:""})`,interpolate:{h:{use:f,fixup:k},c:f,l:f,alpha:{use:f,fixup:m}},difference:{h:Z},average:{h:z}},be=Ra;var Xa={...be,mode:"lch65",parse:["--lch-d65"],serialize:"--lch-d65",toMode:{lab65:e=>P(e,"lab65"),rgb:e=>F(P(e,"lab65"))},fromMode:{rgb:e=>I(K(e),"lch65"),lab65:e=>I(e,"lch65")},ranges:{l:[0,100],c:[0,133.807],h:[0,360]}},mo=Xa;var Ha=({l:e,u:t,v:r,alpha:n})=>{t===void 0&&(t=0),r===void 0&&(r=0);let o=Math.sqrt(t*t+r*r),a={mode:"lchuv",l:e,c:o};return o&&(a.h=v(Math.atan2(r,t)*180/Math.PI)),n!==void 0&&(a.alpha=n),a},Vt=Ha;var _a=({l:e,c:t,h:r,alpha:n})=>{r===void 0&&(r=0);let o={mode:"luv",l:e,u:t?t*Math.cos(r/180*Math.PI):0,v:t?t*Math.sin(r/180*Math.PI):0};return n!==void 0&&(o.alpha=n),o},Qt=_a;var ho=(e,t,r)=>4*e/(e+15*t+3*r),bo=(e,t,r)=>9*t/(e+15*t+3*r),Sa=ho(y.X,y.Y,y.Z),Ia=bo(y.X,y.Y,y.Z),Pa=e=>e<=pe?U*e:116*Math.cbrt(e)-16,Ca=({x:e,y:t,z:r,alpha:n})=>{e===void 0&&(e=0),t===void 0&&(t=0),r===void 0&&(r=0);let o=Pa(t/y.Y),a=ho(e,t,r),i=bo(e,t,r);!isFinite(a)||!isFinite(i)?o=a=i=0:(a=13*o*(a-Sa),i=13*o*(i-Ia));let l={mode:"luv",l:o,u:a,v:i};return n!==void 0&&(l.alpha=n),l},Ce=Ca;var Oa=(e,t,r)=>4*e/(e+15*t+3*r),Na=(e,t,r)=>9*t/(e+15*t+3*r),qa=Oa(y.X,y.Y,y.Z),$a=Na(y.X,y.Y,y.Z),Aa=({l:e,u:t,v:r,alpha:n})=>{if(e===void 0&&(e=0),e===0)return{mode:"xyz50",x:0,y:0,z:0};t===void 0&&(t=0),r===void 0&&(r=0);let o=t/(13*e)+qa,a=r/(13*e)+$a,i=y.Y*(e<=8?e/U:Math.pow((e+16)/116,3)),l=i*(9*o)/(4*a),d=i*(12-3*o-20*a)/(4*a),p={mode:"xyz50",x:l,y:i,z:d};return n!==void 0&&(p.alpha=n),p},Oe=Aa;var Da=e=>Vt(Ce(A(e))),ja=e=>$(Oe(Qt(e))),Ja={mode:"lchuv",toMode:{luv:Qt,rgb:ja},fromMode:{rgb:Da,luv:Vt},channels:["l","c","h","alpha"],parse:["--lchuv"],serialize:"--lchuv",ranges:{l:[0,100],c:[0,176.956],h:[0,360]},interpolate:{h:{use:f,fixup:k},c:f,l:f,alpha:{use:f,fixup:m}},difference:{h:Z},average:{h:z}},go=Ja;var Ea={...C,mode:"lrgb",toMode:{rgb:N},fromMode:{rgb:O},parse:["srgb-linear"],serialize:"srgb-linear"},xo=Ea;var Ya={mode:"luv",toMode:{xyz50:Oe,rgb:e=>$(Oe(e))},fromMode:{xyz50:Ce,rgb:e=>Ce(A(e))},channels:["l","u","v","alpha"],parse:["--luv"],serialize:"--luv",ranges:{l:[0,100],u:[-84.936,175.042],v:[-125.882,87.243]},interpolate:{l:f,u:f,v:f,alpha:{use:f,fixup:m}}},vo=Ya;var Wa=({r:e,g:t,b:r,alpha:n})=>{e===void 0&&(e=0),t===void 0&&(t=0),r===void 0&&(r=0);let o=Math.cbrt(.41222147079999993*e+.5363325363*t+.0514459929*r),a=Math.cbrt(.2119034981999999*e+.6806995450999999*t+.1073969566*r),i=Math.cbrt(.08830246189999998*e+.2817188376*t+.6299787005000002*r),l={mode:"oklab",l:.2104542553*o+.793617785*a-.0040720468*i,a:1.9779984951*o-2.428592205*a+.4505937099*i,b:.0259040371*o+.7827717662*a-.808675766*i};return n!==void 0&&(l.alpha=n),l},at=Wa;var Ga=e=>{let t=at(O(e));return e.r===e.b&&e.b===e.g&&(t.a=t.b=0),t},V=Ga;var Za=({l:e,a:t,b:r,alpha:n})=>{e===void 0&&(e=0),t===void 0&&(t=0),r===void 0&&(r=0);let o=Math.pow(e*.9999999984505198+.39633779217376786*t+.2158037580607588*r,3),a=Math.pow(e*1.0000000088817609-.10556134232365635*t-.06385417477170591*r,3),i=Math.pow(e*1.0000000546724108-.08948418209496575*t-1.2914855378640917*r,3),l={mode:"lrgb",r:4.076741661347994*o-3.307711590408193*a+.230969928729428*i,g:-1.2684380040921763*o+2.6097574006633715*a-.3413193963102197*i,b:-.004196086541837188*o-.7034186144594493*a+1.7076147009309444*i};return n!==void 0&&(l.alpha=n),l},D=Za;var Ba=e=>N(D(e)),Q=Ba;function Ne(e){let n=1.170873786407767;return .5*(n*e-.206+Math.sqrt((n*e-.206)*(n*e-.206)+4*.03*n*e))}function ne(e){return(e*e+.206*e)/(1.170873786407767*(e+.03))}function Fa(e,t){let r,n,o,a,i,l,d,p;-1.88170328*e-.80936493*t>1?(r=1.19086277,n=1.76576728,o=.59662641,a=.75515197,i=.56771245,l=4.0767416621,d=-3.3077115913,p=.2309699292):1.81444104*e-1.19445276*t>1?(r=.73956515,n=-.45954404,o=.08285427,a=.1254107,i=.14503204,l=-1.2684380046,d=2.6097574011,p=-.3413193965):(r=1.35733652,n=-.00915799,o=-1.1513021,a=-.50559606,i=.00692167,l=-.0041960863,d=-.7034186147,p=1.707614701);let c=r+n*e+o*t+a*e*e+i*e*t,h=.3963377774*e+.2158037573*t,b=-.1055613458*e-.0638541728*t,x=-.0894841775*e-1.291485548*t;{let w=1+c*h,L=1+c*b,T=1+c*x,H=w*w*w,R=L*L*L,E=T*T*T,xe=3*h*w*w,ve=3*b*L*L,ye=3*x*T*T,Me=6*h*h*w,we=6*b*b*L,Te=6*x*x*T,ae=l*H+d*R+p*E,ee=l*xe+d*ve+p*ye,ke=l*Me+d*we+p*Te;c=c-ae*ee/(ee*ee-.5*ae*ke)}return c}function er(e,t){let r=Fa(e,t),n=D({l:1,a:r*e,b:r*t}),o=Math.cbrt(1/Math.max(n.r,n.g,n.b)),a=o*r;return[o,a]}function Ka(e,t,r,n,o,a=null){a||(a=er(e,t));let i;if((r-o)*a[1]-(a[0]-o)*n<=0)i=a[1]*o/(n*a[0]+a[1]*(o-r));else{i=a[1]*(o-1)/(n*(a[0]-1)+a[1]*(o-r));{let l=r-o,d=n,p=.3963377774*e+.2158037573*t,c=-.1055613458*e-.0638541728*t,h=-.0894841775*e-1.291485548*t,b=l+d*p,x=l+d*c,w=l+d*h;{let L=o*(1-i)+i*r,T=i*n,H=L+T*p,R=L+T*c,E=L+T*h,xe=H*H*H,ve=R*R*R,ye=E*E*E,Me=3*b*H*H,we=3*x*R*R,Te=3*w*E*E,ae=6*b*b*H,ee=6*x*x*R,ke=6*w*w*E,hr=4.0767416621*xe-3.3077115913*ve+.2309699292*ye-1,ct=4.0767416621*Me-3.3077115913*we+.2309699292*Te,Yo=4.0767416621*ae-3.3077115913*ee+.2309699292*ke,br=ct/(ct*ct-.5*hr*Yo),mt=-hr*br,gr=-1.2684380046*xe+2.6097574011*ve-.3413193965*ye-1,ht=-1.2684380046*Me+2.6097574011*we-.3413193965*Te,Wo=-1.2684380046*ae+2.6097574011*ee-.3413193965*ke,xr=ht/(ht*ht-.5*gr*Wo),bt=-gr*xr,vr=-.0041960863*xe-.7034186147*ve+1.707614701*ye-1,gt=-.0041960863*Me-.7034186147*we+1.707614701*Te,Go=-.0041960863*ae-.7034186147*ee+1.707614701*ke,yr=gt/(gt*gt-.5*vr*Go),xt=-vr*yr;mt=br>=0?mt:1e6,bt=xr>=0?bt:1e6,xt=yr>=0?xt:1e6,i+=Math.min(mt,Math.min(bt,xt))}}}return i}function qe(e,t,r=null){r||(r=er(e,t));let n=r[0],o=r[1];return[o/n,o/(1-n)]}function it(e,t,r){let n=er(t,r),o=Ka(t,r,e,1,e,n),a=qe(t,r,n),i=.11516993+1/(7.4477897+4.1590124*r+t*(-2.19557347+1.75198401*r+t*(-2.13704948-10.02301043*r+t*(-4.24894561+5.38770819*r+4.69891013*t)))),l=.11239642+1/(1.6132032-.68124379*r+t*(.40370612+.90148123*r+t*(-.27087943+.6122399*r+t*(.00299215-.45399568*r-.14661872*t)))),d=o/Math.min(e*a[0],(1-e)*a[1]),p=e*i,c=(1-e)*l,h=.9*d*Math.sqrt(Math.sqrt(1/(1/(p*p*p*p)+1/(c*c*c*c))));return p=e*.4,c=(1-e)*.8,[Math.sqrt(1/(1/(p*p)+1/(c*c))),h,o]}function lt(e){let t=e.l!==void 0?e.l:0,r=e.a!==void 0?e.a:0,n=e.b!==void 0?e.b:0,o={mode:"okhsl",l:Ne(t)};e.alpha!==void 0&&(o.alpha=e.alpha);let a=Math.sqrt(r*r+n*n);if(!a)return o.s=0,o;let[i,l,d]=it(t,r/a,n/a),p;if(alt(V(e))},toMode:{oklab:st,rgb:e=>Q(st(e))}},yo=Ua;function ft(e){let t=e.l!==void 0?e.l:0,r=e.a!==void 0?e.a:0,n=e.b!==void 0?e.b:0,o=Math.sqrt(r*r+n*n),a=o?r/o:1,i=o?n/o:1,[l,d]=qe(a,i),p=.5,c=1-p/l,h=d/(o+t*d),b=h*t,x=h*o,w=ne(b),L=x*w/b,T=D({l:w,a:a*L,b:i*L}),H=Math.cbrt(1/Math.max(T.r,T.g,T.b,0));t=t/H,o=o/H*Ne(t)/t,t=Ne(t);let R={mode:"okhsv",s:o?(p+d)*x/(d*p+d*c*x):0,v:t?t/b:0};return R.s&&(R.h=v(Math.atan2(n,r)*180/Math.PI)),e.alpha!==void 0&&(R.alpha=e.alpha),R}function dt(e){let t={mode:"oklab"};e.alpha!==void 0&&(t.alpha=e.alpha);let r=e.h!==void 0?e.h:0,n=e.s!==void 0?e.s:0,o=e.v!==void 0?e.v:0,a=Math.cos(r/180*Math.PI),i=Math.sin(r/180*Math.PI),[l,d]=qe(a,i),p=.5,c=1-p/l,h=1-n*p/(p+d-d*c*n),b=n*d*p/(p+d-d*c*n),x=ne(h),w=b*x/h,L=D({l:x,a:a*w,b:i*w}),T=Math.cbrt(1/Math.max(L.r,L.g,L.b,0)),H=ne(o*h),R=b*H/h;return t.l=H*T,t.a=R*a*T,t.b=R*i*T,t}var Va={...Ke,mode:"okhsv",channels:["h","s","v","alpha"],parse:["--okhsv"],serialize:"--okhsv",fromMode:{oklab:ft,rgb:e=>ft(V(e))},toMode:{oklab:dt,rgb:e=>Q(dt(e))}},Mo=Va;function Qa(e,t){if(!t||t[0]!=="oklab")return;let r={mode:"oklab"},[,n,o,a,i]=t;if(!(n.type===s.Hue||o.type===s.Hue||a.type===s.Hue))return n.type!==s.None&&(r.l=Math.min(Math.max(0,n.type===s.Number?n.value:n.value/100),1)),o.type!==s.None&&(r.a=o.type===s.Number?o.value:o.value*.4/100),a.type!==s.None&&(r.b=a.type===s.Number?a.value:a.value*.4/100),i.type!==s.None&&(r.alpha=Math.min(1,Math.max(0,i.type===s.Number?i.value:i.value/100))),r}var wo=Qa;var ei={...he,mode:"oklab",toMode:{lrgb:D,rgb:Q},fromMode:{lrgb:at,rgb:V},ranges:{l:[0,1],a:[-.4,.4],b:[-.4,.4]},parse:[wo],serialize:e=>`oklab(${e.l!==void 0?e.l:"none"} ${e.a!==void 0?e.a:"none"} ${e.b!==void 0?e.b:"none"}${e.alpha<1?` / ${e.alpha}`:""})`},To=ei;function ti(e,t){if(!t||t[0]!=="oklch")return;let r={mode:"oklch"},[,n,o,a,i]=t;if(n.type!==s.None){if(n.type===s.Hue)return;r.l=Math.min(Math.max(0,n.type===s.Number?n.value:n.value/100),1)}if(o.type!==s.None&&(r.c=Math.max(0,o.type===s.Number?o.value:o.value*.4/100)),a.type!==s.None){if(a.type===s.Percentage)return;r.h=a.value}return i.type!==s.None&&(r.alpha=Math.min(1,Math.max(0,i.type===s.Number?i.value:i.value/100))),r}var ko=ti;var ri={...be,mode:"oklch",toMode:{oklab:e=>P(e,"oklab"),rgb:e=>Q(P(e,"oklab"))},fromMode:{rgb:e=>I(V(e),"oklch"),oklab:e=>I(e,"oklch")},parse:[ko],serialize:e=>`oklch(${e.l!==void 0?e.l:"none"} ${e.c!==void 0?e.c:"none"} ${e.h!==void 0?e.h:"none"}${e.alpha<1?` / ${e.alpha}`:""})`,ranges:{l:[0,1],c:[0,.4],h:[0,360]}},zo=ri;var oi=e=>{let{r:t,g:r,b:n,alpha:o}=O(e),a={mode:"xyz65",x:.486570948648216*t+.265667693169093*r+.1982172852343625*n,y:.2289745640697487*t+.6917385218365062*r+.079286914093745*n,z:0*t+.0451133818589026*r+1.043944368900976*n};return o!==void 0&&(a.alpha=o),a},tr=oi;var ni=({x:e,y:t,z:r,alpha:n})=>{e===void 0&&(e=0),t===void 0&&(t=0),r===void 0&&(r=0);let o=N({r:e*2.4934969119414263-t*.9313836179191242-.402710784450717*r,g:e*-.8294889695615749+t*1.7626640603183465+.0236246858419436*r,b:e*.0358458302437845-t*.0761723892680418+.9568845240076871*r},"p3");return n!==void 0&&(o.alpha=n),o},rr=ni;var ai={...C,mode:"p3",parse:["display-p3"],serialize:"display-p3",fromMode:{rgb:e=>rr(_(e)),xyz65:rr},toMode:{rgb:e=>S(tr(e)),xyz65:tr}},Lo=ai;var or=e=>{let t=Math.abs(e);return t>=.001953125?Math.sign(e)*Math.pow(t,.5555555555555556):16*e},ii=({x:e,y:t,z:r,alpha:n})=>{e===void 0&&(e=0),t===void 0&&(t=0),r===void 0&&(r=0);let o={mode:"prophoto",r:or(e*1.3457868816471585-t*.2555720873797946-.0511018649755453*r),g:or(e*-.5446307051249019+t*1.5082477428451466+.0205274474364214*r),b:or(e*0+t*0+1.2119675456389452*r)};return n!==void 0&&(o.alpha=n),o},nr=ii;var ar=(e=0)=>{let t=Math.abs(e);return t>=.03125?Math.sign(e)*Math.pow(t,1.8):e/16},li=e=>{let t=ar(e.r),r=ar(e.g),n=ar(e.b),o={mode:"xyz50",x:.7977666449006423*t+.1351812974005331*r+.0313477341283922*n,y:.2880748288194013*t+.7118352342418731*r+899369387256e-16*n,z:0*t+0*r+.8251046025104602*n};return e.alpha!==void 0&&(o.alpha=e.alpha),o},ir=li;var si={...C,mode:"prophoto",parse:["prophoto-rgb"],serialize:"prophoto-rgb",fromMode:{xyz50:nr,rgb:e=>nr(A(e))},toMode:{xyz50:ir,rgb:e=>$(ir(e))}},Ro=si;var Xo=1.09929682680944,fi=.018053968510807,lr=e=>{let t=Math.abs(e);return t>fi?(Math.sign(e)||1)*(Xo*Math.pow(t,.45)-(Xo-1)):4.5*e},di=({x:e,y:t,z:r,alpha:n})=>{e===void 0&&(e=0),t===void 0&&(t=0),r===void 0&&(r=0);let o={mode:"rec2020",r:lr(e*1.7166511879712683-t*.3556707837763925-.2533662813736599*r),g:lr(e*-.6666843518324893+t*1.6164812366349395+.0157685458139111*r),b:lr(e*.0176398574453108-t*.0427706132578085+.9421031212354739*r)};return n!==void 0&&(o.alpha=n),o},sr=di;var Ho=1.09929682680944,ui=.018053968510807,fr=(e=0)=>{let t=Math.abs(e);return t{let t=fr(e.r),r=fr(e.g),n=fr(e.b),o={mode:"xyz65",x:.6369580483012911*t+.1446169035862083*r+.1688809751641721*n,y:.262700212011267*t+.6779980715188708*r+.059301716469862*n,z:0*t+.0280726930490874*r+1.0609850577107909*n};return e.alpha!==void 0&&(o.alpha=e.alpha),o},dr=pi;var ci={...C,mode:"rec2020",fromMode:{xyz65:sr,rgb:e=>sr(_(e))},toMode:{xyz65:dr,rgb:e=>S(dr(e))},parse:["rec2020"],serialize:"rec2020"},_o=ci;var J=.0037930732552754493,ut=Math.cbrt(J);var ur=e=>Math.cbrt(e)-ut,mi=e=>{let{r:t,g:r,b:n,alpha:o}=O(e),a=ur(.3*t+.622*r+.078*n+J),i=ur(.23*t+.692*r+.078*n+J),l=ur(.2434226892454782*t+.2047674442449682*r+.5518098665095535*n+J),d={mode:"xyb",x:(a-i)/2,y:(a+i)/2,b:l-(a+i)/2};return o!==void 0&&(d.alpha=o),d},So=mi;var pr=e=>Math.pow(e+ut,3),hi=({x:e,y:t,b:r,alpha:n})=>{e===void 0&&(e=0),t===void 0&&(t=0),r===void 0&&(r=0);let o=pr(e+t)-J,a=pr(t-e)-J,i=pr(r+t)-J,l=N({r:11.031566904639861*o-9.866943908131562*a-.16462299650829934*i,g:-3.2541473810744237*o+4.418770377582723*a-.16462299650829934*i,b:-3.6588512867136815*o+2.7129230459360922*a+1.9459282407775895*i});return n!==void 0&&(l.alpha=n),l},Io=hi;var bi={mode:"xyb",channels:["x","y","b","alpha"],parse:["--xyb"],serialize:"--xyb",toMode:{rgb:Io},fromMode:{rgb:So},ranges:{x:[-.0154,.0281],y:[0,.8453],b:[-.2778,.388]},interpolate:{x:f,y:f,b:f,alpha:{use:f,fixup:m}}},Po=bi;var gi={mode:"xyz50",parse:["xyz-d50"],serialize:"xyz-d50",toMode:{rgb:$,lab:me},fromMode:{rgb:A,lab:ce},channels:["x","y","z","alpha"],ranges:{x:[0,.964],y:[0,.999],z:[0,.825]},interpolate:{x:f,y:f,z:f,alpha:{use:f,fixup:m}}},Co=gi;var xi=e=>{let{x:t,y:r,z:n,alpha:o}=e;t===void 0&&(t=0),r===void 0&&(r=0),n===void 0&&(n=0);let a={mode:"xyz50",x:1.0479298208405488*t+.0229467933410191*r-.0501922295431356*n,y:.0296278156881593*t+.990434484573249*r-.0170738250293851*n,z:-.0092430581525912*t+.0150551448965779*r+.7518742899580008*n};return o!==void 0&&(a.alpha=o),a},Oo=xi;var vi=e=>{let{x:t,y:r,z:n,alpha:o}=e;t===void 0&&(t=0),r===void 0&&(r=0),n===void 0&&(n=0);let a={mode:"xyz65",x:.9554734527042182*t-.0230985368742614*r+.0632593086610217*n,y:-.0283697069632081*t+1.0099954580058226*r+.021041398966943*n,z:.0123140016883199*t-.0205076964334779*r+1.3303659366080753*n};return o!==void 0&&(a.alpha=o),a},No=vi;var yi={mode:"xyz65",toMode:{rgb:S,xyz50:Oo},fromMode:{rgb:_,xyz50:No},ranges:{x:[0,.95],y:[0,1],z:[0,1.088]},channels:["x","y","z","alpha"],parse:["xyz","xyz-d65"],serialize:"xyz-d65",interpolate:{x:f,y:f,z:f,alpha:{use:f,fixup:m}}},qo=yi;var Mi=({r:e,g:t,b:r,alpha:n})=>{e===void 0&&(e=0),t===void 0&&(t=0),r===void 0&&(r=0);let o={mode:"yiq",y:.29889531*e+.58662247*t+.11448223*r,i:.59597799*e-.2741761*t-.32180189*r,q:.21147017*e-.52261711*t+.31114694*r};return n!==void 0&&(o.alpha=n),o},$o=Mi;var wi=({y:e,i:t,q:r,alpha:n})=>{e===void 0&&(e=0),t===void 0&&(t=0),r===void 0&&(r=0);let o={mode:"rgb",r:e+.95608445*t+.6208885*r,g:e-.27137664*t-.6486059*r,b:e-1.10561724*t+1.70250126*r};return n!==void 0&&(o.alpha=n),o},Ao=wi;var Ti={mode:"yiq",toMode:{rgb:Ao},fromMode:{rgb:$o},channels:["y","i","q","alpha"],parse:["--yiq"],serialize:"--yiq",ranges:{i:[-.595,.595],q:[-.522,.522]},interpolate:{y:f,i:f,q:f,alpha:{use:f,fixup:m}}},Do=Ti;function cr(e){let t=W("lrgb")(e);return .2126*t.r+.7152*t.g+.0722*t.b}function pt(e,t){let r=cr(e),n=cr(t);return(Math.max(r,n)+.05)/(Math.min(r,n)+.05)}var Ec=g(Ar),Yc=g(Br),Wc=g(Ur),Gc=g(Vr),Zc=g(Qr),Bc=g(Fe),Fc=g(Ke),Kc=g(no),Uc=g(io),Vc=g(so),Qc=g(fo),em=g(he),tm=g(po),rm=g(be),om=g(mo),nm=g(go),am=g(xo),im=g(vo),lm=g(yo),sm=g(Mo),fm=g(To),dm=g(zo),um=g(Lo),pm=g(Ro),cm=g(_o),mm=g(C),hm=g(Po),bm=g(Co),gm=g(qo),xm=g(Do);var jo={descriptions:[{criteria:{hsl:{h:null,s:[.75,1],l:[.4,.55]}},descriptive:["saturated","strong","lush","ablaze","beaming","bold","brilliant","flamboyant","vibrant","vivid","loud"]},{criteria:{hsl:{h:null,s:null,l:[0,.07]}},descriptive:["dark","ashy","somber","bleak","muddy","sooty"]},{criteria:{hsl:{h:null,s:null,l:[0,.3]}},descriptive:["dark","dim","gloomy","dull"]},{criteria:{hsl:{h:null,s:[.1,.7],l:[.15,.5]}},descriptive:["bleak","muted","matte","dusty"]},{criteria:{hsl:{h:null,s:[.12,1],l:[.7,1]}},descriptive:["tinted"]},{criteria:{hsl:{h:null,s:[.2,1],l:[.75,.95]}},descriptive:["pastel"]},{criteria:{hsl:{h:null,s:null,l:[.88,1]}},descriptive:["pale","light","faded","delicate","glistening","bleached"]},{criteria:{hsl:{h:null,s:[.5,1],l:[.7,.9]}},descriptive:["fresh","sparkling","glittering","glowing","jazzy","opalescent"]},{criteria:{hsl:{h:null,s:null,l:[.9,1]}},descriptive:["neutral"]},{criteria:{hsl:{h:null,s:[.74,1],l:[.9,1]}},descriptive:["muted"]},{criteria:{hsl:{h:null,s:null,l:1}},descriptive:["colorless","bright","brilliant","high"]},{criteria:{hsl:{h:null,s:null,l:0}},descriptive:["colorless","low","dark"]},{criteria:{hsl:{h:null,s:[0,.01],l:null}},descriptive:["colorless","neutral"]},{criteria:{hsl:{h:null,s:null,l:[.01,.3]}},descriptive:["shady"]},{criteria:{hsl:{h:null,s:[0,.4],l:null}},descriptive:["ashy","dusty"]},{criteria:{hsl:{h:null,s:null,l:[.01,.08]}},descriptive:["almost black"]},{criteria:{hsl:{h:null,s:null,l:[0,.02]}},descriptive:["black"]},{criteria:{hsl:{h:null,s:null,l:[0,.09]}},descriptive:["very dark"]},{criteria:{hsl:{h:null,s:[0,.4],l:[0,.22]}},descriptive:["dark"]},{criteria:{hsl:{h:null,s:[.1,.4],l:[0,.6]}},descriptive:["dark","inky","dim","gloomy"]},{criteria:{hsl:{h:null,s:[0,.04],l:[.1,.99]}},descriptive:["grey"],nouns:["grey"],description:["Grey is a color often linked with neutrality, balance, and calm. It sits between black and white on the color spectrum, giving it a muted, understated quality. When you think of grey, you might picture misty mornings, smooth stone, or the quiet stillness of a cloudy day. It's a versatile color, fitting equally well in minimalist designs or more somber settings. Grey can evoke feelings of tranquility, contemplation, and sophistication. Close your eyes and imagine grey\u2014it might appear as a soft shadow or a subtle haze that wraps the world in a calm, muted tone."]},{criteria:{hsl:{h:null,s:[.04,.1],l:[.17,.99]}},descriptive:["almost grey"]},{criteria:{hsl:{h:null,s:[.1,.3],l:[.17,.99]}},descriptive:["very unsaturated"]},{criteria:{hsl:{h:null,s:[.3,.46],l:null}},descriptive:["unsaturated"]},{criteria:{hsl:{h:null,s:[.46,.6],l:[.4,.55]}},descriptive:["rather unsaturated"]},{criteria:{hsl:{h:null,s:[.601,.8],l:[.45,.6]}},descriptive:["saturated"]},{criteria:{hsl:{h:null,s:[.801,.94],l:[.45,.6]}},descriptive:["rather saturated"]},{criteria:{hsl:{h:null,s:[.941,1],l:[.45,.6]}},descriptive:["very saturated"]},{criteria:{hsl:{h:[0,90],s:[.3,1],l:[.1,1]}},descriptive:["warm","mellow"]},{criteria:{hsl:{h:[270,360],s:[.3,1],l:[.1,1]}},descriptive:["warm","mellow"]},{criteria:{hsl:{h:[90.01,269.99],s:null,l:[.1,1]}},descriptive:["cold","cool"]},{criteria:{hsl:{h:null,s:null,l:[.98,1]}},nouns:["white"],description:["White is a color that is often associated with purity, innocence, and cleanliness. It is the lightest color on the visible spectrum and is often described as having a bright, luminous quality. When you think of white, you might imagine a freshly fallen snow, a blank canvas, or a cloudless sky. It is a versatile color that can be used in a wide range of settings and contexts, from formal to casual. If you close your eyes and picture white, you might imagine a bright, radiant light that illuminates everything around it."],meanings:["purity","cleanliness","simplicity","innocence","freshness","light","goodness","virtue","safety","peace","tranquility","wholeness","perfection","honesty","truth","sincerity"],usage:["health","hospital","sanitary"]},{criteria:{hsl:{h:null,s:null,l:[0,.08]}},nouns:["black"],description:["Black is a color that is often associated with power, elegance, and sophistication. It is a color that is often used to create a sense of mystery, depth, and contrast, and it is often described as a color that can be both bold and elegant. In art and design, black is often used to create a sense of sophistication and drama, and it is often used in fashion to create a sense of sophistication and refinement."],meanings:["power","control","authority","discipline","discretion","secrecy","elegance","mystery"],usage:["intimidate","create fear","authority","luxury"]},{criteria:{hsl:{h:[0,15],s:[.1,1],l:[.07,.99]}},descriptive:["red","reddish"],nouns:["red"],description:["Red is a warm, vibrant color that is often associated with passion and excitement. It is the color of fire, and it is often used to grab attention and convey a sense of urgency or danger. In terms of wavelength, red is the color that is associated with the longest wavelengths of visible light, and it is one of the primary colors of light, along with blue and green. Some people may associate the color red with feelings of love and warmth, while others may associate it with anger or danger. Overall, red is a bold and striking color that can be used to convey a wide range of emotions and messages."],meanings:["excitement","energy","passion","courage","attention","lust","power","love","speed","anger","lust","excitement","danger","ferocity","violence","fury","anger","vigor","urgency"],usage:["stimulate","create urgency","draw attention","caution","encourage","excite"]},{criteria:{hsl:{h:[15,45],s:[.1,1],l:[.4,.99]}},descriptive:["orange"],nouns:["orange"],description:["Orange is a vibrant and playful color that is often associated with creativity, energy, and warmth. It is a secondary color that is made by combining red and yellow, and it is often described as a warm and friendly color that can be both invigorating and calming. It is often associated with joy, enthusiasm, and warmth, and it is often used in art and design to create a sense of excitement and playfulness."],meanings:["optimism","independence","adventure","creativity","fun"],usage:["stimulate","draw attention","express freedom","fascinate"]},{criteria:{hsl:{h:[15,45],s:[.1,1],l:[.07,.4]}},descriptive:["brown"],nouns:["brown"],description:["Brown is a warm and earthy color that is often associated with nature, stability, and reliability. It is a secondary color that is made by combining red, blue, and yellow in different proportions, and it is often described as a rich and luxurious color that can be both comforting and grounding. It is often associated with wood, soil, and the natural world, and it is often used in art and design to create a sense of warmth and permanence."],meanings:["strength","reliability","resilience","loneliness","sadness","isolation","warmth","comfort","security"],usage:["agriculture","legal","food","tobacco","alcohol"]},{criteria:{hsl:{h:[45,70],s:[.1,1],l:[.07,.99]}},descriptive:["yellow"],nouns:["yellow"],description:["Yellow is a bright and cheerful color that is often associated with sunshine, happiness, and warmth. It is a primary color that is made by combining red and green light, and it is usually described as a warm and vibrant color that can be both calming and energizing. It is often associated with joy, happiness, and friendship, and it is often used in art and design to create a sense of cheerfulness and playfulness."],meanings:["enthusiasm","opportunity","spontaneity","happiness","positivity"],usage:["stimulate","relax","awake awareness","energize","affect mood","sale","cheap","budget","construction","convey competence"]},{criteria:{hsl:{h:[70,79],s:[.1,1],l:[.07,.99]}},descriptive:["lime"],nouns:["lime"],description:["Lime is a bright, vibrant color that is often associated with freshness, energy, and youth. It is a pale shade of green that is similar to chartreuse, but it is slightly lighter and more vibrant. Some people may associate the color lime with feelings of playfulness and excitement, while others may associate it with feelings of rejuvenation and renewal. In terms of wavelength, lime is a mixture of green and yellow light, and it is often used in art and design to create a sense of energy and vitality. Overall, lime is a lively and refreshing color that can be used to create a wide range of moods and atmospheres."],meanings:["growth","harmony","fertility","kindness","dependability"],usage:["restore energy","promote growth","awake awareness","rejuvenate","nature"]},{criteria:{hsl:{h:[79,163],s:[.1,1],l:[.07,.99]}},descriptive:["green","greenish"],nouns:["green"],description:["Green is a cool, refreshing color that is often associated with nature, growth, and freshness. It is the color of grass, leaves, and trees, and it is often used to create a sense of harmony and balance. Some people may associate the color green with feelings of jealousy or envy, while others may associate it with feelings of peace and tranquility. In terms of wavelength, green is a primary color of light, and it is located between blue and yellow on the visible light spectrum. It is often used in art and design to create a sense of growth and renewal. Overall, green is a versatile and popular color that can be used to create a wide range of moods and atmospheres."],meanings:["safety","harmony","stability","reliability","balance"],usage:["relax","ballance","revitalize","encourage","posses"]},{criteria:{hsl:{h:[163,193],s:[.1,1],l:[.07,.99]}},descriptive:["cyan"],nouns:["cyan","sky blue"],description:["Cyan is a bright, fresh color that is often associated with the ocean, the sky, and the natural world. It is a pale shade of blue that is similar to teal, but it is slightly lighter and more muted. Some people may associate the color cyan with feelings of peace and serenity, while others may associate it with feelings of youth and playfulness. In terms of wavelength, cyan is a mixture of blue and green light, and it is often used in art and design to create a sense of freshness and vitality. Overall, cyan is a versatile and refreshing color that can be used to create a wide range of moods and atmospheres."],meanings:["freedom","trust","wisdom","joy","refreshing","consciousness","stimulating"],usage:["self expression","communication","children products","technology","aerospace","entertainment","productivity"]},{criteria:{hsl:{h:[193,240],s:[.1,1],l:[.07,.99]}},descriptive:["blue","blueish"],nouns:["blue"],description:["Blue is a cool, calming color that is often associated with trust, reliability, and intelligence. It is the color of the sky and the ocean, and it is often used to create a sense of peace and tranquility. Some people may associate the color blue with feelings of sadness or melancholy, while others may associate it with feelings of calm and relaxation. In terms of wavelength, blue is a primary color of light, and it is located between green and violet on the visible light spectrum. It is often used in art and design to create a sense of balance and harmony. Overall, blue is a versatile and popular color that can be used to create a wide range of moods and atmospheres."],meanings:["trust","responsibility","honesty","loyalty","security","relying","calmness","control"],usage:["security","finance","technology","health care","accounting"]},{criteria:{hsl:{h:[240,260],s:[.1,1],l:[.07,.99]}},descriptive:["indigo"],nouns:["indigo"],description:["Indigo is a deep, rich color that is often associated with spirituality, intuition, and wisdom. It is a dark shade of blue that is similar to navy, but it is slightly lighter and more muted. Some people may associate the color indigo with feelings of calm and relaxation, while others may associate it with feelings of mystery and intrigue. In terms of wavelength, indigo is a deep blue color that is located between blue and violet on the visible light spectrum. It is often used in art and design to add a touch of depth and complexity. Overall, indigo is a beautiful and versatile color that can be used to create a wide range of moods and atmospheres."],meanings:["spirituality","structure","compassion","sensitivity","mystery","tolerance","integrity","order","wisdom","inspiration"],usage:["luxury","religion","psychic"]},{criteria:{hsl:{h:[260,270],s:[.1,1],l:[.07,.99]}},descriptive:["violet"],nouns:["violet"],description:["Violet is a rich, regal color that is often associated with luxury, royalty, and sophistication. It is a deep shade of purple that is similar to lavender, but it is slightly darker and more intense. Some people may associate the color violet with feelings of mystery and spirituality, while others may associate it with feelings of calm and tranquility. In terms of wavelength, violet is a mixture of blue and red light, and it is often used in art and design to add a touch of elegance and refinement. Overall, violet is a beautiful and sophisticated color that can be used to create a calm and peaceful atmosphere."],meanings:["spirituality","structure","compassion","sensitivity","mystery","tolerance","integrity","order","wisdom","inspiration"],usage:["luxury","religion","psychic"]},{criteria:{hsl:{h:[270,291],s:[.1,1],l:[.07,.99]}},descriptive:["purple","purplish"],nouns:["purple"],description:["Purple is a rich and vibrant color that is often associated with royalty, luxury, and creativity. It is a combination of blue and red, with more red than blue, giving it a warm and passionate quality. The shade of purple can vary from a deep, dark hue to a light, almost lavender color, and each shade can evoke different emotions and meanings. Some people may associate purple with spirituality and mysticism, while others may see it as a symbol of extravagance and decadence. In terms of wavelength, purple is located between blue and violet on the visible light spectrum and has a shorter wavelength than most other colors. Because of its striking and eye-catching nature, purple is frequently used in fashion, art, and design to add a pop of color and flair. Overall, purple is a captivating and dynamic color that can express a wide range of moods and emotions, making it a favorite among many people."],meanings:["spirituality","structure","compassion","sensitivity","mystery","tolerance","integrity","order","wisdom","inspiration"],usage:["luxury","religion","psychic","royalty"]},{criteria:{hsl:{h:[291,327],s:[.1,1],l:[.07,.99]}},descriptive:["magenta"],nouns:["magenta"],description:["Magenta is a deep, rich color that is often associated with creativity, passion, and intensity. It is a vibrant shade of pink that is similar to fuchsia, but it is slightly darker and more muted. Some people may associate the color magenta with feelings of excitement and energy, while others may associate it with feelings of love and romance. In terms of wavelength, magenta is a mixture of red and blue light, and it is often used in art and design to add a bold and striking touch. Overall, magenta is a vibrant and lively color that can be used to add drama and excitement to any setting."],meanings:["support","kind","change","harmony","kink","charm","politeness","sensitivity","tenderness","sweetness","femininity","romance","seductiveness","sexiness"],usage:["children products",,"erotica"]},{criteria:{hsl:{h:[327,344],s:[.1,1],l:[.07,.99]}},descriptive:["pink"],nouns:["pink"],description:["Pink is a light, delicate color that is often associated with femininity, romance, and sweetness. It is a pale shade of red, and it is often described as a softer, more gentle version of the color. Some people may associate the color pink with feelings of happiness and playfulness, while others may associate it with feelings of warmth and comfort. In terms of wavelength, pink is a mixture of red and white light, and it is often used in decorations and clothing to add a touch of whimsy and fun. Overall, pink is a cheerful and playful color that can be used to create a warm and inviting atmosphere."],meanings:["support","kindness","change","harmony","kink","charm","politeness","sensitivity","tenderness","sweetness","femininity","romance","seductiveness","sexiness"],usage:["children products","erotica"]},{criteria:{hsl:{h:[344,360],s:[.1,1],l:[.07,.99]}},descriptive:["red","reddish"],nouns:["red"],description:["Red is a warm, vibrant color that is often associated with passion and excitement. It is the color of fire, and it is often used to grab attention and convey a sense of urgency or danger. In terms of wavelength, red is the color that is associated with the longest wavelengths of visible light, and it is one of the primary colors of light, along with blue and green. Some people may associate the color red with feelings of love and warmth, while others may associate it with anger or danger. Overall, red is a bold and striking color that can be used to convey a wide range of emotions and messages."],meanings:["excitement","energy","passion","courage","attention","lust","power","love","speed","anger","lust","excitement","danger","ferocity","violence","fury","anger","vigor","urgency"],usage:["stimulate","create urgency","draw attention","caution","encourage"]}],temperatures:[{value:1800,descriptive:["ultra warm"]},{value:2400,descriptive:["very warm"]},{value:2700,descriptive:["warm"]},{value:3e3,descriptive:["warm white"]},{value:4e3,descriptive:["cool or cold"]},{value:6500,descriptive:["cool"]}],percentWords:[{maxPercentile:.06,word:"a dash of"},{maxPercentile:.16,word:"a little bit of"},{maxPercentile:.31,word:"some"},{maxPercentile:.56,word:"a good bit of"},{maxPercentile:.71,word:"a lot of"},{maxPercentile:.86,word:"a whole lot of"},{maxPercentile:.99,word:"neatly entirely"},{maxPercentile:1,word:"entirely"}]};var Jo={rgb:W("rgb"),hsl:W("hsl")},ki={rgb:["r","g","b"],cmyk:["c","m","y","k"],hsl:["h","s","l"]},j,Eo,ge,mr=class{constructor(t,r=jo){wr(this,j);vt(this,"formats",{});vt(this,"currentColor",null);this.color=t,this.descriptions=r.descriptions,this.temperatures=r.temperatures,this.percentWords=r.percentWords}set color(t){this.currentColor=te(this,j,Eo).call(this,t);let r=Jo.rgb(this.currentColor);this.formats.rgb=r,this.formats.hsl=Jo.hsl(this.currentColor),this.formats.cmyk=zr(r)}get color(){return this.currentColor}get temperatureWords(){let t=Tr(this.formats.rgb);return this.temperatures.reduce((r,n)=>Math.abs(n.value-t)r[a]),o=n.reduce((a,i)=>a+i,0);return n.map(a=>o?a/o:0)}percentageWords(t="rgb"){return this.percentages(t).map(r=>this.percentWords.find(n=>n.maxPercentile>=r).word)}get descriptiveWords(){return te(this,j,ge).call(this,"descriptive")}get nouns(){return te(this,j,ge).call(this,"nouns")}get meanings(){return te(this,j,ge).call(this,"meanings")}get usage(){return te(this,j,ge).call(this,"usage")}get description(){return te(this,j,ge).call(this,"description")}get bestContrast(){return pt(this.color,"black")>pt(this.color,"white")?"black":"white"}getDescriptiveList(t,r){let n=[...this.descriptiveWords];if(t&&(n=Mt(n)),r&&(n=n.slice(0,r)),n.length>1){let o=n.pop();return`${n.join(", ")} and ${o}`}else return n[0]}};j=new WeakSet,Eo=function(t){try{return Le(t)}catch{throw new TypeError("Invalid color. Check the chroma-js documentation.")}},ge=function(t="descriptive",r=!1,n){let o=this.descriptions.reduce((a,i)=>i.hasOwnProperty(t)&&Object.keys(i.criteria).every(p=>{let c=this.formats[p];return Object.entries(i.criteria[p]).every(([h,b])=>{if(!(h in c)||c[h]===void 0||c[h]===null||b===null)return!0;let x=c[h];return h==="h"&&(x=Math.round(x)),Array.isArray(b)?kr(x,b[0],b[1]):isNaN(b)?!1:x===b})})?[...new Set([...a,...i[t]])]:a,[]);return r?Mt(o).slice(0,n):o.slice(0,n)};var Xm=mr;export{Xm as default}; 5 | -------------------------------------------------------------------------------- /dist/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Color-Description Demo 7 | 8 | 9 | 13 | 17 | 18 | 254 | 255 | 256 | 257 |

Color-Description

258 |

259 | Color-Description turns a technical color representation into a human 260 | readable description. 261 |

262 |
263 | 278 | 282 |
283 | 284 | Github Project 290 | 291 |
292 | const cd = new ColorDescription('#b40404');
293 |     
295 |
296 |
297 |
298 |
299 |

300 |
301 | 307 |
308 |
309 | 318 | 319 | 320 | 321 | 322 | 479 | 480 | 481 | -------------------------------------------------------------------------------- /dist/index.iife.js: -------------------------------------------------------------------------------- 1 | var ColorDescription=(()=>{var De=Object.defineProperty,Qo=Object.defineProperties,en=Object.getOwnPropertyDescriptor,tn=Object.getOwnPropertyDescriptors,rn=Object.getOwnPropertyNames,zr=Object.getOwnPropertySymbols;var Lr=Object.prototype.hasOwnProperty,on=Object.prototype.propertyIsEnumerable;var Rr=e=>{throw TypeError(e)};var wt=(e,t,r)=>t in e?De(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,y=(e,t)=>{for(var r in t||(t={}))Lr.call(t,r)&&wt(e,r,t[r]);if(zr)for(var r of zr(t))on.call(t,r)&&wt(e,r,t[r]);return e},M=(e,t)=>Qo(e,tn(t));var nn=(e,t)=>{for(var r in t)De(e,r,{get:t[r],enumerable:!0})},an=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of rn(t))!Lr.call(e,o)&&o!==r&&De(e,o,{get:()=>t[o],enumerable:!(n=en(t,o))||n.enumerable});return e};var ln=e=>an(De({},"__esModule",{value:!0}),e);var Tt=(e,t,r)=>wt(e,typeof t!="symbol"?t+"":t,r),sn=(e,t,r)=>t.has(e)||Rr("Cannot "+r);var Xr=(e,t,r)=>t.has(e)?Rr("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r);var oe=(e,t,r)=>(sn(e,t,"access private method"),r);var $i={};nn($i,{default:()=>qi});var{round:fn,min:kt,max:Je,log:je,floor:dn,random:un}=Math,pn=e=>{let t=e/100,r,n,o;return t<66?(r=1,n=t<6?0:(-155.25485562709179-.44596950469579133*(n=t-2)+104.49216199393888*je(n))/255,o=t<20?0:(-254.76935184120902+.8274096064007395*(o=t-10)+115.67994401066147*je(o))/255):(r=(351.97690566805693+.114206453784165*(r=t-55)-40.25366309332127*je(r))/255,n=(325.4494125711974+.07943456536662342*(n=t-50)-28.0852963507957*je(n))/255,o=1),{r:Je(0,kt(1,r)),g:Je(0,kt(1,n)),b:Je(0,kt(1,o)),a:1}},Hr=e=>{let{r:t,g:r,b:n}=e,o=1e3,a=4e4,i=.4,l;for(;a-o>i;){l=(a+o)*.5;let d=pn(l);d.b/d.r>=n/t?a=l:o=l}return fn(l)},_r=(e,t,r)=>e>=t&&e<=r,zt=e=>{let t=[...e];for(let r=t.length-1;r>0;r--){let n=dn(un()*(r+1));[t[r],t[n]]=[t[n],t[r]]}return t},Sr=e=>{let{r:t,g:r,b:n}=e,o=1-Je(t,r,n),a=1-o;return{mode:"cmyk",c:a&&(a-t)/a,m:a&&(a-r)/a,y:a&&(a-n)/a,k:o}};var cn=(e,t)=>{if(typeof e=="number"){if(t===3)return{mode:"rgb",r:(e>>8&15|e>>4&240)/255,g:(e>>4&15|e&240)/255,b:(e&15|e<<4&240)/255};if(t===4)return{mode:"rgb",r:(e>>12&15|e>>8&240)/255,g:(e>>8&15|e>>4&240)/255,b:(e>>4&15|e&240)/255,alpha:(e&15|e<<4&240)/255};if(t===6)return{mode:"rgb",r:(e>>16&255)/255,g:(e>>8&255)/255,b:(e&255)/255};if(t===8)return{mode:"rgb",r:(e>>24&255)/255,g:(e>>16&255)/255,b:(e>>8&255)/255,alpha:(e&255)/255}}},Ee=cn;var mn={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},Ir=mn;var hn=e=>Ee(Ir[e.toLowerCase()],6),Pr=hn;var bn=/^#?([0-9a-f]{8}|[0-9a-f]{6}|[0-9a-f]{4}|[0-9a-f]{3})$/i,gn=e=>{let t;return(t=e.match(bn))?Ee(parseInt(t[1],16),t[1].length):void 0},Cr=gn;var _="([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)",Bi=`(?:${_}|none)`,ne=`${_}%`,Fi=`(?:${_}%|none)`,Re=`(?:${_}%|${_})`,xn=`(?:${_}%|${_}|none)`,Or=`(?:${_}(deg|grad|rad|turn)|${_})`,Ki=`(?:${_}(deg|grad|rad|turn)|${_}|none)`,G="\\s*,\\s*";var Ui=new RegExp("^"+xn+"$");var vn=new RegExp(`^rgba?\\(\\s*${_}${G}${_}${G}${_}\\s*(?:,\\s*${Re}\\s*)?\\)$`),yn=new RegExp(`^rgba?\\(\\s*${ne}${G}${ne}${G}${ne}\\s*(?:,\\s*${Re}\\s*)?\\)$`),Mn=e=>{let t={mode:"rgb"},r;if(r=e.match(vn))r[1]!==void 0&&(t.r=r[1]/255),r[2]!==void 0&&(t.g=r[2]/255),r[3]!==void 0&&(t.b=r[3]/255);else if(r=e.match(yn))r[1]!==void 0&&(t.r=r[1]/100),r[2]!==void 0&&(t.g=r[2]/100),r[3]!==void 0&&(t.b=r[3]/100);else return;return r[4]!==void 0?t.alpha=Math.max(0,Math.min(1,r[4]/100)):r[5]!==void 0&&(t.alpha=Math.max(0,Math.min(1,+r[5]))),t},Nr=Mn;var wn=(e,t)=>e===void 0?void 0:typeof e!="object"?Xe(e):e.mode!==void 0?e:t?M(y({},e),{mode:t}):void 0,qr=wn;var Tn=(e="rgb")=>t=>(t=qr(t,e))!==void 0?t.mode===e?t:A[t.mode][e]?A[t.mode][e](t):e==="rgb"?A[t.mode].rgb(t):A.rgb[e](A[t.mode].rgb(t)):void 0,Z=Tn;var A={},$r={},He=[],Lt={},kn=e=>e,g=e=>(A[e.mode]=y(y({},A[e.mode]),e.toMode),Object.keys(e.fromMode||{}).forEach(t=>{A[t]||(A[t]={}),A[t][e.mode]=e.fromMode[t]}),e.ranges||(e.ranges={}),e.difference||(e.difference={}),e.channels.forEach(t=>{if(e.ranges[t]===void 0&&(e.ranges[t]=[0,1]),!e.interpolate[t])throw new Error(`Missing interpolator for: ${t}`);typeof e.interpolate[t]=="function"&&(e.interpolate[t]={use:e.interpolate[t]}),e.interpolate[t].fixup||(e.interpolate[t].fixup=kn)}),$r[e.mode]=e,(e.parse||[]).forEach(t=>{zn(t,e.mode)}),Z(e.mode)),Ar=e=>$r[e],zn=(e,t)=>{if(typeof e=="string"){if(!t)throw new Error("'mode' required when 'parser' is a string");Lt[e]=t}else typeof e=="function"&&He.indexOf(e)<0&&He.push(e)};var Rt=/[^\x00-\x7F]|[a-zA-Z_]/,Ln=/[^\x00-\x7F]|[-\w]/,s={Function:"function",Ident:"ident",Number:"number",Percentage:"percentage",ParenClose:")",None:"none",Hue:"hue",Alpha:"alpha"},u=0;function Ye(e){let t=e[u],r=e[u+1];return t==="-"||t==="+"?/\d/.test(r)||r==="."&&/\d/.test(e[u+2]):t==="."?/\d/.test(r):/\d/.test(t)}function Xt(e){if(u>=e.length)return!1;let t=e[u];if(Rt.test(t))return!0;if(t==="-"){if(e.length-u<2)return!1;let r=e[u+1];return!!(r==="-"||Rt.test(r))}return!1}var Rn={deg:1,rad:180/Math.PI,grad:9/10,turn:360};function _e(e){let t="";if((e[u]==="-"||e[u]==="+")&&(t+=e[u++]),t+=We(e),e[u]==="."&&/\d/.test(e[u+1])&&(t+=e[u++]+We(e)),(e[u]==="e"||e[u]==="E")&&((e[u+1]==="-"||e[u+1]==="+")&&/\d/.test(e[u+2])?t+=e[u++]+e[u++]+We(e):/\d/.test(e[u+1])&&(t+=e[u++]+We(e))),Xt(e)){let r=Ge(e);return r==="deg"||r==="rad"||r==="turn"||r==="grad"?{type:s.Hue,value:t*Rn[r]}:void 0}return e[u]==="%"?(u++,{type:s.Percentage,value:+t}):{type:s.Number,value:+t}}function We(e){let t="";for(;/\d/.test(e[u]);)t+=e[u++];return t}function Ge(e){let t="";for(;u4)){if(r.length===4){if(r[3].type!==s.Alpha)return;r[3]=r[3].value}return r.length===3&&r.push({type:s.None,value:void 0}),r.every(o=>o.type!==s.Alpha)?r:void 0}}function Sn(e,t){e._i=0;let r=e[e._i++];if(!r||r.type!==s.Function)return;let n=Dr(e,t);if(n)return n.unshift(r.value),n}var In=e=>{if(typeof e!="string")return;let t=Hn(e),r=t?Sn(t,!0):void 0,n,o=0,a=He.length;for(;oe==="transparent"?{mode:"rgb",r:0,g:0,b:0,alpha:0}:void 0,Jr=Cn;var Er=(e,t,r)=>e+r*(t-e);var On=e=>{let t=[];for(let r=0;rt=>{let r=On(t);return n=>{let o=n*r.length,a=n>=1?r.length-1:Math.max(Math.floor(o),0),i=r[a];return i===void 0?void 0:e(i[0],i[1],o-a)}};var f=Yr(Er);var m=e=>{let t=!1,r=e.map(n=>n!==void 0?(t=!0,n):1);return t?r:e};var Nn={mode:"rgb",channels:["r","g","b","alpha"],parse:[jr,Cr,Nr,Pr,Jr,"srgb"],serialize:"srgb",interpolate:{r:f,g:f,b:f,alpha:{use:f,fixup:m}},gamut:!0,white:{r:1,g:1,b:1},black:{r:0,g:0,b:0}},N=Nn;var Ht=(e=0)=>Math.pow(Math.abs(e),2.19921875)*Math.sign(e),qn=e=>{let t=Ht(e.r),r=Ht(e.g),n=Ht(e.b),o={mode:"xyz65",x:.5766690429101305*t+.1855582379065463*r+.1882286462349947*n,y:.297344975250536*t+.6273635662554661*r+.0752914584939979*n,z:.0270313613864123*t+.0706888525358272*r+.9913375368376386*n};return e.alpha!==void 0&&(o.alpha=e.alpha),o},_t=qn;var St=e=>Math.pow(Math.abs(e),.4547069271758437)*Math.sign(e),$n=({x:e,y:t,z:r,alpha:n})=>{e===void 0&&(e=0),t===void 0&&(t=0),r===void 0&&(r=0);let o={mode:"a98",r:St(e*2.0415879038107465-t*.5650069742788597-.3447313507783297*r),g:St(e*-.9692436362808798+t*1.8759675015077206+.0415550574071756*r),b:St(e*.0134442806320312-t*.1183623922310184+1.0151749943912058*r)};return n!==void 0&&(o.alpha=n),o},It=$n;var Pt=(e=0)=>{let t=Math.abs(e);return t<=.04045?e/12.92:(Math.sign(e)||1)*Math.pow((t+.055)/1.055,2.4)},An=({r:e,g:t,b:r,alpha:n})=>{let o={mode:"lrgb",r:Pt(e),g:Pt(t),b:Pt(r)};return n!==void 0&&(o.alpha=n),o},q=An;var Dn=e=>{let{r:t,g:r,b:n,alpha:o}=q(e),a={mode:"xyz65",x:.4123907992659593*t+.357584339383878*r+.1804807884018343*n,y:.2126390058715102*t+.715168678767756*r+.0721923153607337*n,z:.0193308187155918*t+.119194779794626*r+.9505321522496607*n};return o!==void 0&&(a.alpha=o),a},I=Dn;var Ct=(e=0)=>{let t=Math.abs(e);return t>.0031308?(Math.sign(e)||1)*(1.055*Math.pow(t,.4166666666666667)-.055):e*12.92},jn=({r:e,g:t,b:r,alpha:n},o="rgb")=>{let a={mode:o,r:Ct(e),g:Ct(t),b:Ct(r)};return n!==void 0&&(a.alpha=n),a},$=jn;var Jn=({x:e,y:t,z:r,alpha:n})=>{e===void 0&&(e=0),t===void 0&&(t=0),r===void 0&&(r=0);let o=$({r:e*3.2409699419045226-t*1.537383177570094-.4986107602930034*r,g:e*-.9692436362808796+t*1.8759675015077204+.0415550574071756*r,b:e*.0556300796969936-t*.2039769588889765+1.0569715142428784*r});return n!==void 0&&(o.alpha=n),o},P=Jn;var En=M(y({},N),{mode:"a98",parse:["a98-rgb"],serialize:"a98-rgb",fromMode:{rgb:e=>It(I(e)),xyz65:It},toMode:{rgb:e=>P(_t(e)),xyz65:_t}}),Wr=En;var Yn=e=>(e=e%360)<0?e+360:e,v=Yn;var Wn=(e,t)=>e.map((r,n,o)=>{if(r===void 0)return r;let a=v(r);return n===0||e[n-1]===void 0?a:t(a-v(o[n-1]))}).reduce((r,n)=>!r.length||n===void 0||r[r.length-1]===void 0?(r.push(n),r):(r.push(n+r[r.length-1]),r),[]),L=e=>Wn(e,t=>Math.abs(t)<=180?t:t-360*Math.sign(t));var T=[-.14861,1.78277,-.29227,-.90649,1.97294,0],Gr=Math.PI/180,Zr=180/Math.PI;var Br=T[3]*T[4],Fr=T[1]*T[4],Kr=T[1]*T[2]-T[0]*T[3],Gn=({r:e,g:t,b:r,alpha:n})=>{e===void 0&&(e=0),t===void 0&&(t=0),r===void 0&&(r=0);let o=(Kr*r+e*Br-t*Fr)/(Kr+Br-Fr),a=r-o,i=(T[4]*(t-o)-T[2]*a)/T[3],l={mode:"cubehelix",l:o,s:o===0||o===1?void 0:Math.sqrt(a*a+i*i)/(T[4]*o*(1-o))};return l.s&&(l.h=Math.atan2(i,a)*Zr-120),n!==void 0&&(l.alpha=n),l},Ur=Gn;var Zn=({h:e,s:t,l:r,alpha:n})=>{let o={mode:"rgb"};e=(e===void 0?0:e+120)*Gr,r===void 0&&(r=0);let a=t===void 0?0:t*r*(1-r),i=Math.cos(e),l=Math.sin(e);return o.r=r+a*(T[0]*i+T[1]*l),o.g=r+a*(T[2]*i+T[3]*l),o.b=r+a*(T[4]*i+T[5]*l),n!==void 0&&(o.alpha=n),o},Vr=Zn;var B=(e,t)=>{if(e.h===void 0||t.h===void 0||!e.s||!t.s)return 0;let r=v(e.h),n=v(t.h),o=Math.sin((n-r+360)/2*Math.PI/180);return 2*Math.sqrt(e.s*t.s)*o},Qr=(e,t)=>{if(e.h===void 0||t.h===void 0)return 0;let r=v(e.h),n=v(t.h);return Math.abs(n-r)>180?r-(n-360*Math.sign(n-r)):n-r},F=(e,t)=>{if(e.h===void 0||t.h===void 0||!e.c||!t.c)return 0;let r=v(e.h),n=v(t.h),o=Math.sin((n-r+360)/2*Math.PI/180);return 2*Math.sqrt(e.c*t.c)*o};var R=e=>{let t=e.reduce((n,o)=>{if(o!==void 0){let a=o*Math.PI/180;n.sin+=Math.sin(a),n.cos+=Math.cos(a)}return n},{sin:0,cos:0}),r=Math.atan2(t.sin,t.cos)*180/Math.PI;return r<0?360+r:r};var Bn={mode:"cubehelix",channels:["h","s","l","alpha"],parse:["--cubehelix"],serialize:"--cubehelix",ranges:{h:[0,360],s:[0,4.614],l:[0,1]},fromMode:{rgb:Ur},toMode:{rgb:Vr},interpolate:{h:{use:f,fixup:L},s:f,l:f,alpha:{use:f,fixup:m}},difference:{h:B},average:{h:R}},eo=Bn;var Fn=({l:e,a:t,b:r,alpha:n},o="lch")=>{t===void 0&&(t=0),r===void 0&&(r=0);let a=Math.sqrt(t*t+r*r),i={mode:o,l:e,c:a};return a&&(i.h=v(Math.atan2(r,t)*180/Math.PI)),n!==void 0&&(i.alpha=n),i},C=Fn;var Kn=({l:e,c:t,h:r,alpha:n},o="lab")=>{r===void 0&&(r=0);let a={mode:o,l:e,a:t?t*Math.cos(r/180*Math.PI):0,b:t?t*Math.sin(r/180*Math.PI):0};return n!==void 0&&(a.alpha=n),a},O=Kn;var Ze=Math.pow(29,3)/Math.pow(3,3),Be=Math.pow(6,3)/Math.pow(29,3);var w={X:.9642956764295677,Y:1,Z:.8251046025104602},K={X:.3127/.329,Y:1,Z:(1-.3127-.329)/.329},cs=Math.pow(29,3)/Math.pow(3,3),ms=Math.pow(6,3)/Math.pow(29,3);var Ot=e=>Math.pow(e,3)>Be?Math.pow(e,3):(116*e-16)/Ze,Un=({l:e,a:t,b:r,alpha:n})=>{e===void 0&&(e=0),t===void 0&&(t=0),r===void 0&&(r=0);let o=(e+16)/116,a=t/500+o,i=o-r/200,l={mode:"xyz65",x:Ot(a)*K.X,y:Ot(o)*K.Y,z:Ot(i)*K.Z};return n!==void 0&&(l.alpha=n),l},Fe=Un;var Vn=e=>P(Fe(e)),U=Vn;var Nt=e=>e>Be?Math.cbrt(e):(Ze*e+16)/116,Qn=({x:e,y:t,z:r,alpha:n})=>{e===void 0&&(e=0),t===void 0&&(t=0),r===void 0&&(r=0);let o=Nt(e/K.X),a=Nt(t/K.Y),i=Nt(r/K.Z),l={mode:"lab65",l:116*a-16,a:500*(o-a),b:200*(a-i)};return n!==void 0&&(l.alpha=n),l},Ke=Qn;var ea=e=>{let t=Ke(I(e));return e.r===e.b&&e.b===e.g&&(t.a=t.b=0),t},V=ea;var ae=.14444444444444443*Math.PI,se=Math.cos(ae),fe=Math.sin(ae),Ue=100/Math.log(139/100);var ta=({l:e,c:t,h:r,alpha:n})=>{e===void 0&&(e=0),t===void 0&&(t=0),r===void 0&&(r=0);let o={mode:"lab65",l:(Math.exp(e*1/Ue)-1)/.0039},a=(Math.exp(.0435*t*1*1)-1)/.075,i=a*Math.cos(r/180*Math.PI-ae),l=a*Math.sin(r/180*Math.PI-ae);return o.a=i*se-l/.83*fe,o.b=i*fe+l/.83*se,n!==void 0&&(o.alpha=n),o},Ie=ta;var ra=({l:e,a:t,b:r,alpha:n})=>{e===void 0&&(e=0),t===void 0&&(t=0),r===void 0&&(r=0);let o=t*se+r*fe,a=.83*(r*se-t*fe),i=Math.sqrt(o*o+a*a),l={mode:"dlch",l:Ue/1*Math.log(1+.0039*e),c:Math.log(1+.075*i)/(.0435*1*1)};return l.c&&(l.h=v((Math.atan2(a,o)+ae)/Math.PI*180)),n!==void 0&&(l.alpha=n),l},Pe=ra;var to=e=>Ie(C(e,"dlch")),ro=e=>O(Pe(e),"dlab"),oa={mode:"dlab",parse:["--din99o-lab"],serialize:"--din99o-lab",toMode:{lab65:to,rgb:e=>U(to(e))},fromMode:{lab65:ro,rgb:e=>ro(V(e))},channels:["l","a","b","alpha"],ranges:{l:[0,100],a:[-40.09,45.501],b:[-40.469,44.344]},interpolate:{l:f,a:f,b:f,alpha:{use:f,fixup:m}}},oo=oa;var na={mode:"dlch",parse:["--din99o-lch"],serialize:"--din99o-lch",toMode:{lab65:Ie,dlab:e=>O(e,"dlab"),rgb:e=>U(Ie(e))},fromMode:{lab65:Pe,dlab:e=>C(e,"dlch"),rgb:e=>Pe(V(e))},channels:["l","c","h","alpha"],ranges:{l:[0,100],c:[0,51.484],h:[0,360]},interpolate:{l:f,c:f,h:{use:f,fixup:L},alpha:{use:f,fixup:m}},difference:{h:F},average:{h:R}},no=na;function $t({h:e,s:t,i:r,alpha:n}){e=v(e!==void 0?e:0),t===void 0&&(t=0),r===void 0&&(r=0);let o=Math.abs(e/60%2-1),a;switch(Math.floor(e/60)){case 0:a={r:r*(1+t*(3/(2-o)-1)),g:r*(1+t*(3*(1-o)/(2-o)-1)),b:r*(1-t)};break;case 1:a={r:r*(1+t*(3*(1-o)/(2-o)-1)),g:r*(1+t*(3/(2-o)-1)),b:r*(1-t)};break;case 2:a={r:r*(1-t),g:r*(1+t*(3/(2-o)-1)),b:r*(1+t*(3*(1-o)/(2-o)-1))};break;case 3:a={r:r*(1-t),g:r*(1+t*(3*(1-o)/(2-o)-1)),b:r*(1+t*(3/(2-o)-1))};break;case 4:a={r:r*(1+t*(3*(1-o)/(2-o)-1)),g:r*(1-t),b:r*(1+t*(3/(2-o)-1))};break;case 5:a={r:r*(1+t*(3/(2-o)-1)),g:r*(1-t),b:r*(1+t*(3*(1-o)/(2-o)-1))};break;default:a={r:r*(1-t),g:r*(1-t),b:r*(1-t)}}return a.mode="rgb",n!==void 0&&(a.alpha=n),a}function At({r:e,g:t,b:r,alpha:n}){e===void 0&&(e=0),t===void 0&&(t=0),r===void 0&&(r=0);let o=Math.max(e,t,r),a=Math.min(e,t,r),i={mode:"hsi",s:e+t+r===0?0:1-3*a/(e+t+r),i:(e+t+r)/3};return o-a!==0&&(i.h=(o===e?(t-r)/(o-a)+(t{switch(t){case"deg":return+e;case"rad":return e/Math.PI*180;case"grad":return e/10*9;case"turn":return e*360}},io=ia;var la=new RegExp(`^hsla?\\(\\s*${Or}${G}${ne}${G}${ne}\\s*(?:,\\s*${Re}\\s*)?\\)$`),sa=e=>{let t=e.match(la);if(!t)return;let r={mode:"hsl"};return t[3]!==void 0?r.h=+t[3]:t[1]!==void 0&&t[2]!==void 0&&(r.h=io(t[1],t[2])),t[4]!==void 0&&(r.s=Math.min(Math.max(0,t[4]/100),1)),t[5]!==void 0&&(r.l=Math.min(Math.max(0,t[5]/100),1)),t[6]!==void 0?r.alpha=Math.max(0,Math.min(1,t[6]/100)):t[7]!==void 0&&(r.alpha=Math.max(0,Math.min(1,+t[7]))),r},lo=sa;function fa(e,t){if(!t||t[0]!=="hsl"&&t[0]!=="hsla")return;let r={mode:"hsl"},[,n,o,a,i]=t;if(n.type!==s.None){if(n.type===s.Percentage)return;r.h=n.value}if(o.type!==s.None){if(o.type===s.Hue)return;r.s=o.value/100}if(a.type!==s.None){if(a.type===s.Hue)return;r.l=a.value/100}return i.type!==s.None&&(r.alpha=Math.min(1,Math.max(0,i.type===s.Number?i.value:i.value/100))),r}var so=fa;var da={mode:"hsl",toMode:{rgb:Dt},fromMode:{rgb:jt},channels:["h","s","l","alpha"],ranges:{h:[0,360]},gamut:"rgb",parse:[so,lo],serialize:e=>`hsl(${e.h!==void 0?e.h:"none"} ${e.s!==void 0?e.s*100+"%":"none"} ${e.l!==void 0?e.l*100+"%":"none"}${e.alpha<1?` / ${e.alpha}`:""})`,interpolate:{h:{use:f,fixup:L},s:f,l:f,alpha:{use:f,fixup:m}},difference:{h:B},average:{h:R}},Ve=da;function Ce({h:e,s:t,v:r,alpha:n}){e=v(e!==void 0?e:0),t===void 0&&(t=0),r===void 0&&(r=0);let o=Math.abs(e/60%2-1),a;switch(Math.floor(e/60)){case 0:a={r,g:r*(1-t*o),b:r*(1-t)};break;case 1:a={r:r*(1-t*o),g:r,b:r*(1-t)};break;case 2:a={r:r*(1-t),g:r,b:r*(1-t*o)};break;case 3:a={r:r*(1-t),g:r*(1-t*o),b:r};break;case 4:a={r:r*(1-t*o),g:r*(1-t),b:r};break;case 5:a={r,g:r*(1-t),b:r*(1-t*o)};break;default:a={r:r*(1-t),g:r*(1-t),b:r*(1-t)}}return a.mode="rgb",n!==void 0&&(a.alpha=n),a}function Oe({r:e,g:t,b:r,alpha:n}){e===void 0&&(e=0),t===void 0&&(t=0),r===void 0&&(r=0);let o=Math.max(e,t,r),a=Math.min(e,t,r),i={mode:"hsv",s:o===0?0:1-a/o,v:o};return o-a!==0&&(i.h=(o===e?(t-r)/(o-a)+(t1){let o=t+r;t/=o,r/=o}return Ce({h:e,s:r===1?1:1-t/(1-r),v:1-r,alpha:n})}function Et(e){let t=Oe(e);if(t===void 0)return;let r=t.s!==void 0?t.s:0,n=t.v!==void 0?t.v:0,o={mode:"hwb",w:(1-r)*n,b:1-n};return t.h!==void 0&&(o.h=t.h),t.alpha!==void 0&&(o.alpha=t.alpha),o}function pa(e,t){if(!t||t[0]!=="hwb")return;let r={mode:"hwb"},[,n,o,a,i]=t;if(n.type!==s.None){if(n.type===s.Percentage)return;r.h=n.value}if(o.type!==s.None){if(o.type===s.Hue)return;r.w=o.value/100}if(a.type!==s.None){if(a.type===s.Hue)return;r.b=a.value/100}return i.type!==s.None&&(r.alpha=Math.min(1,Math.max(0,i.type===s.Number?i.value:i.value/100))),r}var fo=pa;var ca={mode:"hwb",toMode:{rgb:Jt},fromMode:{rgb:Et},channels:["h","w","b","alpha"],ranges:{h:[0,360]},gamut:"rgb",parse:[fo],serialize:e=>`hwb(${e.h!==void 0?e.h:"none"} ${e.w!==void 0?e.w*100+"%":"none"} ${e.b!==void 0?e.b*100+"%":"none"}${e.alpha<1?` / ${e.alpha}`:""})`,interpolate:{h:{use:f,fixup:L},w:f,b:f,alpha:{use:f,fixup:m}},difference:{h:Qr},average:{h:R}},uo=ca;var de=.1593017578125,po=78.84375,ue=.8359375,pe=18.8515625,ce=18.6875;function et(e){if(e<0)return 0;let t=Math.pow(e,1/po);return 1e4*Math.pow(Math.max(0,t-ue)/(pe-ce*t),1/de)}function tt(e){if(e<0)return 0;let t=Math.pow(e/1e4,de);return Math.pow((ue+pe*t)/(1+ce*t),po)}var Yt=e=>Math.max(e/203,0),ha=({i:e,t,p:r,alpha:n})=>{e===void 0&&(e=0),t===void 0&&(t=0),r===void 0&&(r=0);let o=et(e+.008609037037932761*t+.11102962500302593*r),a=et(e-.00860903703793275*t-.11102962500302599*r),i=et(e+.5600313357106791*t-.32062717498731885*r),l={mode:"xyz65",x:Yt(2.070152218389422*o-1.3263473389671556*a+.2066510476294051*i),y:Yt(.3647385209748074*o+.680566024947227*a-.0453045459220346*i),z:Yt(-.049747207535812*o-.0492609666966138*a+1.1880659249923042*i)};return n!==void 0&&(l.alpha=n),l},Wt=ha;var Gt=(e=0)=>Math.max(e*203,0),ba=({x:e,y:t,z:r,alpha:n})=>{let o=Gt(e),a=Gt(t),i=Gt(r),l=tt(.3592832590121217*o+.6976051147779502*a-.0358915932320289*i),d=tt(-.1920808463704995*o+1.1004767970374323*a+.0753748658519118*i),p=tt(.0070797844607477*o+.0748396662186366*a+.8433265453898765*i),c=.5*l+.5*d,h=1.61376953125*l-3.323486328125*d+1.709716796875*p,b=4.378173828125*l-4.24560546875*d-.132568359375*p,x={mode:"itp",i:c,t:h,p:b};return n!==void 0&&(x.alpha=n),x},Zt=ba;var ga={mode:"itp",channels:["i","t","p","alpha"],parse:["--ictcp"],serialize:"--ictcp",toMode:{xyz65:Wt,rgb:e=>P(Wt(e))},fromMode:{xyz65:Zt,rgb:e=>Zt(I(e))},ranges:{i:[0,.581],t:[-.369,.272],p:[-.164,.331]},interpolate:{i:f,t:f,p:f,alpha:{use:f,fixup:m}}},co=ga;var xa=134.03437499999998,va=16295499532821565e-27,Bt=e=>{if(e<0)return 0;let t=Math.pow(e/1e4,de);return Math.pow((ue+pe*t)/(1+ce*t),xa)},Ft=(e=0)=>Math.max(e*203,0),ya=({x:e,y:t,z:r,alpha:n})=>{e=Ft(e),t=Ft(t),r=Ft(r);let o=1.15*e-.15*r,a=.66*t+.34*e,i=Bt(.41478972*o+.579999*a+.014648*r),l=Bt(-.20151*o+1.120649*a+.0531008*r),d=Bt(-.0166008*o+.2648*a+.6684799*r),p=(i+l)/2,c={mode:"jab",j:.44*p/(1-.56*p)-va,a:3.524*i-4.066708*l+.542708*d,b:.199076*i+1.096799*l-1.295875*d};return n!==void 0&&(c.alpha=n),c},rt=ya;var Ma=134.03437499999998,mo=16295499532821565e-27,Kt=e=>{if(e<0)return 0;let t=Math.pow(e,1/Ma);return 1e4*Math.pow((ue-t)/(ce*t-pe),1/de)},Ut=e=>e/203,wa=({j:e,a:t,b:r,alpha:n})=>{e===void 0&&(e=0),t===void 0&&(t=0),r===void 0&&(r=0);let o=(e+mo)/(.44+.56*(e+mo)),a=Kt(o+.13860504*t+.058047316*r),i=Kt(o-.13860504*t-.058047316*r),l=Kt(o-.096019242*t-.8118919*r),d={mode:"xyz65",x:Ut(1.661373024652174*a-.914523081304348*i+.23136208173913045*l),y:Ut(-.3250758611844533*a+1.571847026732543*i-.21825383453227928*l),z:Ut(-.090982811*a-.31272829*i+1.5227666*l)};return n!==void 0&&(d.alpha=n),d},ot=wa;var Ta=e=>{let t=rt(I(e));return e.r===e.b&&e.b===e.g&&(t.a=t.b=0),t},nt=Ta;var ka=e=>P(ot(e)),at=ka;var za={mode:"jab",channels:["j","a","b","alpha"],parse:["--jzazbz"],serialize:"--jzazbz",fromMode:{rgb:nt,xyz65:rt},toMode:{rgb:at,xyz65:ot},ranges:{j:[0,.222],a:[-.109,.129],b:[-.185,.134]},interpolate:{j:f,a:f,b:f,alpha:{use:f,fixup:m}}},ho=za;var La=({j:e,a:t,b:r,alpha:n})=>{t===void 0&&(t=0),r===void 0&&(r=0);let o=Math.sqrt(t*t+r*r),a={mode:"jch",j:e,c:o};return o&&(a.h=v(Math.atan2(r,t)*180/Math.PI)),n!==void 0&&(a.alpha=n),a},Vt=La;var Ra=({j:e,c:t,h:r,alpha:n})=>{r===void 0&&(r=0);let o={mode:"jab",j:e,a:t?t*Math.cos(r/180*Math.PI):0,b:t?t*Math.sin(r/180*Math.PI):0};return n!==void 0&&(o.alpha=n),o},Qt=Ra;var Xa={mode:"jch",parse:["--jzczhz"],serialize:"--jzczhz",toMode:{jab:Qt,rgb:e=>at(Qt(e))},fromMode:{rgb:e=>Vt(nt(e)),jab:Vt},channels:["j","c","h","alpha"],ranges:{j:[0,.221],c:[0,.19],h:[0,360]},interpolate:{h:{use:f,fixup:L},c:f,j:f,alpha:{use:f,fixup:m}},difference:{h:F},average:{h:R}},bo=Xa;var Q=Math.pow(29,3)/Math.pow(3,3),me=Math.pow(6,3)/Math.pow(29,3);var er=e=>Math.pow(e,3)>me?Math.pow(e,3):(116*e-16)/Q,Ha=({l:e,a:t,b:r,alpha:n})=>{e===void 0&&(e=0),t===void 0&&(t=0),r===void 0&&(r=0);let o=(e+16)/116,a=t/500+o,i=o-r/200,l={mode:"xyz50",x:er(a)*w.X,y:er(o)*w.Y,z:er(i)*w.Z};return n!==void 0&&(l.alpha=n),l},he=Ha;var _a=({x:e,y:t,z:r,alpha:n})=>{e===void 0&&(e=0),t===void 0&&(t=0),r===void 0&&(r=0);let o=$({r:e*3.1341359569958707-t*1.6173863321612538-.4906619460083532*r,g:e*-.978795502912089+t*1.916254567259524+.03344273116131949*r,b:e*.07195537988411677-t*.2289768264158322+1.405386058324125*r});return n!==void 0&&(o.alpha=n),o},D=_a;var Sa=e=>D(he(e)),it=Sa;var Ia=e=>{let{r:t,g:r,b:n,alpha:o}=q(e),a={mode:"xyz50",x:.436065742824811*t+.3851514688337912*r+.14307845442264197*n,y:.22249319175623702*t+.7168870538238823*r+.06061979053616537*n,z:.013923904500943465*t+.09708128566574634*r+.7140993584005155*n};return o!==void 0&&(a.alpha=o),a},j=Ia;var tr=e=>e>me?Math.cbrt(e):(Q*e+16)/116,Pa=({x:e,y:t,z:r,alpha:n})=>{e===void 0&&(e=0),t===void 0&&(t=0),r===void 0&&(r=0);let o=tr(e/w.X),a=tr(t/w.Y),i=tr(r/w.Z),l={mode:"lab",l:116*a-16,a:500*(o-a),b:200*(a-i)};return n!==void 0&&(l.alpha=n),l},be=Pa;var Ca=e=>{let t=be(j(e));return e.r===e.b&&e.b===e.g&&(t.a=t.b=0),t},lt=Ca;function Oa(e,t){if(!t||t[0]!=="lab")return;let r={mode:"lab"},[,n,o,a,i]=t;if(!(n.type===s.Hue||o.type===s.Hue||a.type===s.Hue))return n.type!==s.None&&(r.l=Math.min(Math.max(0,n.value),100)),o.type!==s.None&&(r.a=o.type===s.Number?o.value:o.value*125/100),a.type!==s.None&&(r.b=a.type===s.Number?a.value:a.value*125/100),i.type!==s.None&&(r.alpha=Math.min(1,Math.max(0,i.type===s.Number?i.value:i.value/100))),r}var go=Oa;var Na={mode:"lab",toMode:{xyz50:he,rgb:it},fromMode:{xyz50:be,rgb:lt},channels:["l","a","b","alpha"],ranges:{l:[0,100],a:[-100,100],b:[-100,100]},parse:[go],serialize:e=>`lab(${e.l!==void 0?e.l:"none"} ${e.a!==void 0?e.a:"none"} ${e.b!==void 0?e.b:"none"}${e.alpha<1?` / ${e.alpha}`:""})`,interpolate:{l:f,a:f,b:f,alpha:{use:f,fixup:m}}},ge=Na;var qa=M(y({},ge),{mode:"lab65",parse:["--lab-d65"],serialize:"--lab-d65",toMode:{xyz65:Fe,rgb:U},fromMode:{xyz65:Ke,rgb:V},ranges:{l:[0,100],a:[-86.182,98.234],b:[-107.86,94.477]}}),xo=qa;function $a(e,t){if(!t||t[0]!=="lch")return;let r={mode:"lch"},[,n,o,a,i]=t;if(n.type!==s.None){if(n.type===s.Hue)return;r.l=Math.min(Math.max(0,n.value),100)}if(o.type!==s.None&&(r.c=Math.max(0,o.type===s.Number?o.value:o.value*150/100)),a.type!==s.None){if(a.type===s.Percentage)return;r.h=a.value}return i.type!==s.None&&(r.alpha=Math.min(1,Math.max(0,i.type===s.Number?i.value:i.value/100))),r}var vo=$a;var Aa={mode:"lch",toMode:{lab:O,rgb:e=>it(O(e))},fromMode:{rgb:e=>C(lt(e)),lab:C},channels:["l","c","h","alpha"],ranges:{l:[0,100],c:[0,150],h:[0,360]},parse:[vo],serialize:e=>`lch(${e.l!==void 0?e.l:"none"} ${e.c!==void 0?e.c:"none"} ${e.h!==void 0?e.h:"none"}${e.alpha<1?` / ${e.alpha}`:""})`,interpolate:{h:{use:f,fixup:L},c:f,l:f,alpha:{use:f,fixup:m}},difference:{h:F},average:{h:R}},xe=Aa;var Da=M(y({},xe),{mode:"lch65",parse:["--lch-d65"],serialize:"--lch-d65",toMode:{lab65:e=>O(e,"lab65"),rgb:e=>U(O(e,"lab65"))},fromMode:{rgb:e=>C(V(e),"lch65"),lab65:e=>C(e,"lch65")},ranges:{l:[0,100],c:[0,133.807],h:[0,360]}}),yo=Da;var ja=({l:e,u:t,v:r,alpha:n})=>{t===void 0&&(t=0),r===void 0&&(r=0);let o=Math.sqrt(t*t+r*r),a={mode:"lchuv",l:e,c:o};return o&&(a.h=v(Math.atan2(r,t)*180/Math.PI)),n!==void 0&&(a.alpha=n),a},rr=ja;var Ja=({l:e,c:t,h:r,alpha:n})=>{r===void 0&&(r=0);let o={mode:"luv",l:e,u:t?t*Math.cos(r/180*Math.PI):0,v:t?t*Math.sin(r/180*Math.PI):0};return n!==void 0&&(o.alpha=n),o},or=Ja;var Mo=(e,t,r)=>4*e/(e+15*t+3*r),wo=(e,t,r)=>9*t/(e+15*t+3*r),Ea=Mo(w.X,w.Y,w.Z),Ya=wo(w.X,w.Y,w.Z),Wa=e=>e<=me?Q*e:116*Math.cbrt(e)-16,Ga=({x:e,y:t,z:r,alpha:n})=>{e===void 0&&(e=0),t===void 0&&(t=0),r===void 0&&(r=0);let o=Wa(t/w.Y),a=Mo(e,t,r),i=wo(e,t,r);!isFinite(a)||!isFinite(i)?o=a=i=0:(a=13*o*(a-Ea),i=13*o*(i-Ya));let l={mode:"luv",l:o,u:a,v:i};return n!==void 0&&(l.alpha=n),l},Ne=Ga;var Za=(e,t,r)=>4*e/(e+15*t+3*r),Ba=(e,t,r)=>9*t/(e+15*t+3*r),Fa=Za(w.X,w.Y,w.Z),Ka=Ba(w.X,w.Y,w.Z),Ua=({l:e,u:t,v:r,alpha:n})=>{if(e===void 0&&(e=0),e===0)return{mode:"xyz50",x:0,y:0,z:0};t===void 0&&(t=0),r===void 0&&(r=0);let o=t/(13*e)+Fa,a=r/(13*e)+Ka,i=w.Y*(e<=8?e/Q:Math.pow((e+16)/116,3)),l=i*(9*o)/(4*a),d=i*(12-3*o-20*a)/(4*a),p={mode:"xyz50",x:l,y:i,z:d};return n!==void 0&&(p.alpha=n),p},qe=Ua;var Va=e=>rr(Ne(j(e))),Qa=e=>D(qe(or(e))),ei={mode:"lchuv",toMode:{luv:or,rgb:Qa},fromMode:{rgb:Va,luv:rr},channels:["l","c","h","alpha"],parse:["--lchuv"],serialize:"--lchuv",ranges:{l:[0,100],c:[0,176.956],h:[0,360]},interpolate:{h:{use:f,fixup:L},c:f,l:f,alpha:{use:f,fixup:m}},difference:{h:F},average:{h:R}},To=ei;var ti=M(y({},N),{mode:"lrgb",toMode:{rgb:$},fromMode:{rgb:q},parse:["srgb-linear"],serialize:"srgb-linear"}),ko=ti;var ri={mode:"luv",toMode:{xyz50:qe,rgb:e=>D(qe(e))},fromMode:{xyz50:Ne,rgb:e=>Ne(j(e))},channels:["l","u","v","alpha"],parse:["--luv"],serialize:"--luv",ranges:{l:[0,100],u:[-84.936,175.042],v:[-125.882,87.243]},interpolate:{l:f,u:f,v:f,alpha:{use:f,fixup:m}}},zo=ri;var oi=({r:e,g:t,b:r,alpha:n})=>{e===void 0&&(e=0),t===void 0&&(t=0),r===void 0&&(r=0);let o=Math.cbrt(.41222147079999993*e+.5363325363*t+.0514459929*r),a=Math.cbrt(.2119034981999999*e+.6806995450999999*t+.1073969566*r),i=Math.cbrt(.08830246189999998*e+.2817188376*t+.6299787005000002*r),l={mode:"oklab",l:.2104542553*o+.793617785*a-.0040720468*i,a:1.9779984951*o-2.428592205*a+.4505937099*i,b:.0259040371*o+.7827717662*a-.808675766*i};return n!==void 0&&(l.alpha=n),l},st=oi;var ni=e=>{let t=st(q(e));return e.r===e.b&&e.b===e.g&&(t.a=t.b=0),t},ee=ni;var ai=({l:e,a:t,b:r,alpha:n})=>{e===void 0&&(e=0),t===void 0&&(t=0),r===void 0&&(r=0);let o=Math.pow(e*.9999999984505198+.39633779217376786*t+.2158037580607588*r,3),a=Math.pow(e*1.0000000088817609-.10556134232365635*t-.06385417477170591*r,3),i=Math.pow(e*1.0000000546724108-.08948418209496575*t-1.2914855378640917*r,3),l={mode:"lrgb",r:4.076741661347994*o-3.307711590408193*a+.230969928729428*i,g:-1.2684380040921763*o+2.6097574006633715*a-.3413193963102197*i,b:-.004196086541837188*o-.7034186144594493*a+1.7076147009309444*i};return n!==void 0&&(l.alpha=n),l},J=ai;var ii=e=>$(J(e)),te=ii;function $e(e){let n=1.170873786407767;return .5*(n*e-.206+Math.sqrt((n*e-.206)*(n*e-.206)+4*.03*n*e))}function ie(e){return(e*e+.206*e)/(1.170873786407767*(e+.03))}function li(e,t){let r,n,o,a,i,l,d,p;-1.88170328*e-.80936493*t>1?(r=1.19086277,n=1.76576728,o=.59662641,a=.75515197,i=.56771245,l=4.0767416621,d=-3.3077115913,p=.2309699292):1.81444104*e-1.19445276*t>1?(r=.73956515,n=-.45954404,o=.08285427,a=.1254107,i=.14503204,l=-1.2684380046,d=2.6097574011,p=-.3413193965):(r=1.35733652,n=-.00915799,o=-1.1513021,a=-.50559606,i=.00692167,l=-.0041960863,d=-.7034186147,p=1.707614701);let c=r+n*e+o*t+a*e*e+i*e*t,h=.3963377774*e+.2158037573*t,b=-.1055613458*e-.0638541728*t,x=-.0894841775*e-1.291485548*t;{let k=1+c*h,X=1+c*b,z=1+c*x,S=k*k*k,H=X*X*X,W=z*z*z,ye=3*h*k*k,Me=3*b*X*X,we=3*x*z*z,Te=6*h*h*k,ke=6*b*b*X,ze=6*x*x*z,le=l*S+d*H+p*W,re=l*ye+d*Me+p*we,Le=l*Te+d*ke+p*ze;c=c-le*re/(re*re-.5*le*Le)}return c}function nr(e,t){let r=li(e,t),n=J({l:1,a:r*e,b:r*t}),o=Math.cbrt(1/Math.max(n.r,n.g,n.b)),a=o*r;return[o,a]}function si(e,t,r,n,o,a=null){a||(a=nr(e,t));let i;if((r-o)*a[1]-(a[0]-o)*n<=0)i=a[1]*o/(n*a[0]+a[1]*(o-r));else{i=a[1]*(o-1)/(n*(a[0]-1)+a[1]*(o-r));{let l=r-o,d=n,p=.3963377774*e+.2158037573*t,c=-.1055613458*e-.0638541728*t,h=-.0894841775*e-1.291485548*t,b=l+d*p,x=l+d*c,k=l+d*h;{let X=o*(1-i)+i*r,z=i*n,S=X+z*p,H=X+z*c,W=X+z*h,ye=S*S*S,Me=H*H*H,we=W*W*W,Te=3*b*S*S,ke=3*x*H*H,ze=3*k*W*W,le=6*b*b*S,re=6*x*x*H,Le=6*k*k*W,vr=4.0767416621*ye-3.3077115913*Me+.2309699292*we-1,bt=4.0767416621*Te-3.3077115913*ke+.2309699292*ze,Ko=4.0767416621*le-3.3077115913*re+.2309699292*Le,yr=bt/(bt*bt-.5*vr*Ko),gt=-vr*yr,Mr=-1.2684380046*ye+2.6097574011*Me-.3413193965*we-1,xt=-1.2684380046*Te+2.6097574011*ke-.3413193965*ze,Uo=-1.2684380046*le+2.6097574011*re-.3413193965*Le,wr=xt/(xt*xt-.5*Mr*Uo),vt=-Mr*wr,Tr=-.0041960863*ye-.7034186147*Me+1.707614701*we-1,yt=-.0041960863*Te-.7034186147*ke+1.707614701*ze,Vo=-.0041960863*le-.7034186147*re+1.707614701*Le,kr=yt/(yt*yt-.5*Tr*Vo),Mt=-Tr*kr;gt=yr>=0?gt:1e6,vt=wr>=0?vt:1e6,Mt=kr>=0?Mt:1e6,i+=Math.min(gt,Math.min(vt,Mt))}}}return i}function Ae(e,t,r=null){r||(r=nr(e,t));let n=r[0],o=r[1];return[o/n,o/(1-n)]}function ft(e,t,r){let n=nr(t,r),o=si(t,r,e,1,e,n),a=Ae(t,r,n),i=.11516993+1/(7.4477897+4.1590124*r+t*(-2.19557347+1.75198401*r+t*(-2.13704948-10.02301043*r+t*(-4.24894561+5.38770819*r+4.69891013*t)))),l=.11239642+1/(1.6132032-.68124379*r+t*(.40370612+.90148123*r+t*(-.27087943+.6122399*r+t*(.00299215-.45399568*r-.14661872*t)))),d=o/Math.min(e*a[0],(1-e)*a[1]),p=e*i,c=(1-e)*l,h=.9*d*Math.sqrt(Math.sqrt(1/(1/(p*p*p*p)+1/(c*c*c*c))));return p=e*.4,c=(1-e)*.8,[Math.sqrt(1/(1/(p*p)+1/(c*c))),h,o]}function dt(e){let t=e.l!==void 0?e.l:0,r=e.a!==void 0?e.a:0,n=e.b!==void 0?e.b:0,o={mode:"okhsl",l:$e(t)};e.alpha!==void 0&&(o.alpha=e.alpha);let a=Math.sqrt(r*r+n*n);if(!a)return o.s=0,o;let[i,l,d]=ft(t,r/a,n/a),p;if(adt(ee(e))},toMode:{oklab:ut,rgb:e=>te(ut(e))}}),Lo=fi;function pt(e){let t=e.l!==void 0?e.l:0,r=e.a!==void 0?e.a:0,n=e.b!==void 0?e.b:0,o=Math.sqrt(r*r+n*n),a=o?r/o:1,i=o?n/o:1,[l,d]=Ae(a,i),p=.5,c=1-p/l,h=d/(o+t*d),b=h*t,x=h*o,k=ie(b),X=x*k/b,z=J({l:k,a:a*X,b:i*X}),S=Math.cbrt(1/Math.max(z.r,z.g,z.b,0));t=t/S,o=o/S*$e(t)/t,t=$e(t);let H={mode:"okhsv",s:o?(p+d)*x/(d*p+d*c*x):0,v:t?t/b:0};return H.s&&(H.h=v(Math.atan2(n,r)*180/Math.PI)),e.alpha!==void 0&&(H.alpha=e.alpha),H}function ct(e){let t={mode:"oklab"};e.alpha!==void 0&&(t.alpha=e.alpha);let r=e.h!==void 0?e.h:0,n=e.s!==void 0?e.s:0,o=e.v!==void 0?e.v:0,a=Math.cos(r/180*Math.PI),i=Math.sin(r/180*Math.PI),[l,d]=Ae(a,i),p=.5,c=1-p/l,h=1-n*p/(p+d-d*c*n),b=n*d*p/(p+d-d*c*n),x=ie(h),k=b*x/h,X=J({l:x,a:a*k,b:i*k}),z=Math.cbrt(1/Math.max(X.r,X.g,X.b,0)),S=ie(o*h),H=b*S/h;return t.l=S*z,t.a=H*a*z,t.b=H*i*z,t}var di=M(y({},Qe),{mode:"okhsv",channels:["h","s","v","alpha"],parse:["--okhsv"],serialize:"--okhsv",fromMode:{oklab:pt,rgb:e=>pt(ee(e))},toMode:{oklab:ct,rgb:e=>te(ct(e))}}),Ro=di;function ui(e,t){if(!t||t[0]!=="oklab")return;let r={mode:"oklab"},[,n,o,a,i]=t;if(!(n.type===s.Hue||o.type===s.Hue||a.type===s.Hue))return n.type!==s.None&&(r.l=Math.min(Math.max(0,n.type===s.Number?n.value:n.value/100),1)),o.type!==s.None&&(r.a=o.type===s.Number?o.value:o.value*.4/100),a.type!==s.None&&(r.b=a.type===s.Number?a.value:a.value*.4/100),i.type!==s.None&&(r.alpha=Math.min(1,Math.max(0,i.type===s.Number?i.value:i.value/100))),r}var Xo=ui;var pi=M(y({},ge),{mode:"oklab",toMode:{lrgb:J,rgb:te},fromMode:{lrgb:st,rgb:ee},ranges:{l:[0,1],a:[-.4,.4],b:[-.4,.4]},parse:[Xo],serialize:e=>`oklab(${e.l!==void 0?e.l:"none"} ${e.a!==void 0?e.a:"none"} ${e.b!==void 0?e.b:"none"}${e.alpha<1?` / ${e.alpha}`:""})`}),Ho=pi;function ci(e,t){if(!t||t[0]!=="oklch")return;let r={mode:"oklch"},[,n,o,a,i]=t;if(n.type!==s.None){if(n.type===s.Hue)return;r.l=Math.min(Math.max(0,n.type===s.Number?n.value:n.value/100),1)}if(o.type!==s.None&&(r.c=Math.max(0,o.type===s.Number?o.value:o.value*.4/100)),a.type!==s.None){if(a.type===s.Percentage)return;r.h=a.value}return i.type!==s.None&&(r.alpha=Math.min(1,Math.max(0,i.type===s.Number?i.value:i.value/100))),r}var _o=ci;var mi=M(y({},xe),{mode:"oklch",toMode:{oklab:e=>O(e,"oklab"),rgb:e=>te(O(e,"oklab"))},fromMode:{rgb:e=>C(ee(e),"oklch"),oklab:e=>C(e,"oklch")},parse:[_o],serialize:e=>`oklch(${e.l!==void 0?e.l:"none"} ${e.c!==void 0?e.c:"none"} ${e.h!==void 0?e.h:"none"}${e.alpha<1?` / ${e.alpha}`:""})`,ranges:{l:[0,1],c:[0,.4],h:[0,360]}}),So=mi;var hi=e=>{let{r:t,g:r,b:n,alpha:o}=q(e),a={mode:"xyz65",x:.486570948648216*t+.265667693169093*r+.1982172852343625*n,y:.2289745640697487*t+.6917385218365062*r+.079286914093745*n,z:0*t+.0451133818589026*r+1.043944368900976*n};return o!==void 0&&(a.alpha=o),a},ar=hi;var bi=({x:e,y:t,z:r,alpha:n})=>{e===void 0&&(e=0),t===void 0&&(t=0),r===void 0&&(r=0);let o=$({r:e*2.4934969119414263-t*.9313836179191242-.402710784450717*r,g:e*-.8294889695615749+t*1.7626640603183465+.0236246858419436*r,b:e*.0358458302437845-t*.0761723892680418+.9568845240076871*r},"p3");return n!==void 0&&(o.alpha=n),o},ir=bi;var gi=M(y({},N),{mode:"p3",parse:["display-p3"],serialize:"display-p3",fromMode:{rgb:e=>ir(I(e)),xyz65:ir},toMode:{rgb:e=>P(ar(e)),xyz65:ar}}),Io=gi;var lr=e=>{let t=Math.abs(e);return t>=.001953125?Math.sign(e)*Math.pow(t,.5555555555555556):16*e},xi=({x:e,y:t,z:r,alpha:n})=>{e===void 0&&(e=0),t===void 0&&(t=0),r===void 0&&(r=0);let o={mode:"prophoto",r:lr(e*1.3457868816471585-t*.2555720873797946-.0511018649755453*r),g:lr(e*-.5446307051249019+t*1.5082477428451466+.0205274474364214*r),b:lr(e*0+t*0+1.2119675456389452*r)};return n!==void 0&&(o.alpha=n),o},sr=xi;var fr=(e=0)=>{let t=Math.abs(e);return t>=.03125?Math.sign(e)*Math.pow(t,1.8):e/16},vi=e=>{let t=fr(e.r),r=fr(e.g),n=fr(e.b),o={mode:"xyz50",x:.7977666449006423*t+.1351812974005331*r+.0313477341283922*n,y:.2880748288194013*t+.7118352342418731*r+899369387256e-16*n,z:0*t+0*r+.8251046025104602*n};return e.alpha!==void 0&&(o.alpha=e.alpha),o},dr=vi;var yi=M(y({},N),{mode:"prophoto",parse:["prophoto-rgb"],serialize:"prophoto-rgb",fromMode:{xyz50:sr,rgb:e=>sr(j(e))},toMode:{xyz50:dr,rgb:e=>D(dr(e))}}),Po=yi;var Co=1.09929682680944,Mi=.018053968510807,ur=e=>{let t=Math.abs(e);return t>Mi?(Math.sign(e)||1)*(Co*Math.pow(t,.45)-(Co-1)):4.5*e},wi=({x:e,y:t,z:r,alpha:n})=>{e===void 0&&(e=0),t===void 0&&(t=0),r===void 0&&(r=0);let o={mode:"rec2020",r:ur(e*1.7166511879712683-t*.3556707837763925-.2533662813736599*r),g:ur(e*-.6666843518324893+t*1.6164812366349395+.0157685458139111*r),b:ur(e*.0176398574453108-t*.0427706132578085+.9421031212354739*r)};return n!==void 0&&(o.alpha=n),o},pr=wi;var Oo=1.09929682680944,Ti=.018053968510807,cr=(e=0)=>{let t=Math.abs(e);return t{let t=cr(e.r),r=cr(e.g),n=cr(e.b),o={mode:"xyz65",x:.6369580483012911*t+.1446169035862083*r+.1688809751641721*n,y:.262700212011267*t+.6779980715188708*r+.059301716469862*n,z:0*t+.0280726930490874*r+1.0609850577107909*n};return e.alpha!==void 0&&(o.alpha=e.alpha),o},mr=ki;var zi=M(y({},N),{mode:"rec2020",fromMode:{xyz65:pr,rgb:e=>pr(I(e))},toMode:{xyz65:mr,rgb:e=>P(mr(e))},parse:["rec2020"],serialize:"rec2020"}),No=zi;var Y=.0037930732552754493,mt=Math.cbrt(Y);var hr=e=>Math.cbrt(e)-mt,Li=e=>{let{r:t,g:r,b:n,alpha:o}=q(e),a=hr(.3*t+.622*r+.078*n+Y),i=hr(.23*t+.692*r+.078*n+Y),l=hr(.2434226892454782*t+.2047674442449682*r+.5518098665095535*n+Y),d={mode:"xyb",x:(a-i)/2,y:(a+i)/2,b:l-(a+i)/2};return o!==void 0&&(d.alpha=o),d},qo=Li;var br=e=>Math.pow(e+mt,3),Ri=({x:e,y:t,b:r,alpha:n})=>{e===void 0&&(e=0),t===void 0&&(t=0),r===void 0&&(r=0);let o=br(e+t)-Y,a=br(t-e)-Y,i=br(r+t)-Y,l=$({r:11.031566904639861*o-9.866943908131562*a-.16462299650829934*i,g:-3.2541473810744237*o+4.418770377582723*a-.16462299650829934*i,b:-3.6588512867136815*o+2.7129230459360922*a+1.9459282407775895*i});return n!==void 0&&(l.alpha=n),l},$o=Ri;var Xi={mode:"xyb",channels:["x","y","b","alpha"],parse:["--xyb"],serialize:"--xyb",toMode:{rgb:$o},fromMode:{rgb:qo},ranges:{x:[-.0154,.0281],y:[0,.8453],b:[-.2778,.388]},interpolate:{x:f,y:f,b:f,alpha:{use:f,fixup:m}}},Ao=Xi;var Hi={mode:"xyz50",parse:["xyz-d50"],serialize:"xyz-d50",toMode:{rgb:D,lab:be},fromMode:{rgb:j,lab:he},channels:["x","y","z","alpha"],ranges:{x:[0,.964],y:[0,.999],z:[0,.825]},interpolate:{x:f,y:f,z:f,alpha:{use:f,fixup:m}}},Do=Hi;var _i=e=>{let{x:t,y:r,z:n,alpha:o}=e;t===void 0&&(t=0),r===void 0&&(r=0),n===void 0&&(n=0);let a={mode:"xyz50",x:1.0479298208405488*t+.0229467933410191*r-.0501922295431356*n,y:.0296278156881593*t+.990434484573249*r-.0170738250293851*n,z:-.0092430581525912*t+.0150551448965779*r+.7518742899580008*n};return o!==void 0&&(a.alpha=o),a},jo=_i;var Si=e=>{let{x:t,y:r,z:n,alpha:o}=e;t===void 0&&(t=0),r===void 0&&(r=0),n===void 0&&(n=0);let a={mode:"xyz65",x:.9554734527042182*t-.0230985368742614*r+.0632593086610217*n,y:-.0283697069632081*t+1.0099954580058226*r+.021041398966943*n,z:.0123140016883199*t-.0205076964334779*r+1.3303659366080753*n};return o!==void 0&&(a.alpha=o),a},Jo=Si;var Ii={mode:"xyz65",toMode:{rgb:P,xyz50:jo},fromMode:{rgb:I,xyz50:Jo},ranges:{x:[0,.95],y:[0,1],z:[0,1.088]},channels:["x","y","z","alpha"],parse:["xyz","xyz-d65"],serialize:"xyz-d65",interpolate:{x:f,y:f,z:f,alpha:{use:f,fixup:m}}},Eo=Ii;var Pi=({r:e,g:t,b:r,alpha:n})=>{e===void 0&&(e=0),t===void 0&&(t=0),r===void 0&&(r=0);let o={mode:"yiq",y:.29889531*e+.58662247*t+.11448223*r,i:.59597799*e-.2741761*t-.32180189*r,q:.21147017*e-.52261711*t+.31114694*r};return n!==void 0&&(o.alpha=n),o},Yo=Pi;var Ci=({y:e,i:t,q:r,alpha:n})=>{e===void 0&&(e=0),t===void 0&&(t=0),r===void 0&&(r=0);let o={mode:"rgb",r:e+.95608445*t+.6208885*r,g:e-.27137664*t-.6486059*r,b:e-1.10561724*t+1.70250126*r};return n!==void 0&&(o.alpha=n),o},Wo=Ci;var Oi={mode:"yiq",toMode:{rgb:Wo},fromMode:{rgb:Yo},channels:["y","i","q","alpha"],parse:["--yiq"],serialize:"--yiq",ranges:{i:[-.595,.595],q:[-.522,.522]},interpolate:{y:f,i:f,q:f,alpha:{use:f,fixup:m}}},Go=Oi;function gr(e){let t=Z("lrgb")(e);return .2126*t.r+.7152*t.g+.0722*t.b}function ht(e,t){let r=gr(e),n=gr(t);return(Math.max(r,n)+.05)/(Math.min(r,n)+.05)}var bm=g(Wr),gm=g(eo),xm=g(oo),vm=g(no),ym=g(ao),Mm=g(Ve),wm=g(Qe),Tm=g(uo),km=g(co),zm=g(ho),Lm=g(bo),Rm=g(ge),Xm=g(xo),Hm=g(xe),_m=g(yo),Sm=g(To),Im=g(ko),Pm=g(zo),Cm=g(Lo),Om=g(Ro),Nm=g(Ho),qm=g(So),$m=g(Io),Am=g(Po),Dm=g(No),jm=g(N),Jm=g(Ao),Em=g(Do),Ym=g(Eo),Wm=g(Go);var Zo={descriptions:[{criteria:{hsl:{h:null,s:[.75,1],l:[.4,.55]}},descriptive:["saturated","strong","lush","ablaze","beaming","bold","brilliant","flamboyant","vibrant","vivid","loud"]},{criteria:{hsl:{h:null,s:null,l:[0,.07]}},descriptive:["dark","ashy","somber","bleak","muddy","sooty"]},{criteria:{hsl:{h:null,s:null,l:[0,.3]}},descriptive:["dark","dim","gloomy","dull"]},{criteria:{hsl:{h:null,s:[.1,.7],l:[.15,.5]}},descriptive:["bleak","muted","matte","dusty"]},{criteria:{hsl:{h:null,s:[.12,1],l:[.7,1]}},descriptive:["tinted"]},{criteria:{hsl:{h:null,s:[.2,1],l:[.75,.95]}},descriptive:["pastel"]},{criteria:{hsl:{h:null,s:null,l:[.88,1]}},descriptive:["pale","light","faded","delicate","glistening","bleached"]},{criteria:{hsl:{h:null,s:[.5,1],l:[.7,.9]}},descriptive:["fresh","sparkling","glittering","glowing","jazzy","opalescent"]},{criteria:{hsl:{h:null,s:null,l:[.9,1]}},descriptive:["neutral"]},{criteria:{hsl:{h:null,s:[.74,1],l:[.9,1]}},descriptive:["muted"]},{criteria:{hsl:{h:null,s:null,l:1}},descriptive:["colorless","bright","brilliant","high"]},{criteria:{hsl:{h:null,s:null,l:0}},descriptive:["colorless","low","dark"]},{criteria:{hsl:{h:null,s:[0,.01],l:null}},descriptive:["colorless","neutral"]},{criteria:{hsl:{h:null,s:null,l:[.01,.3]}},descriptive:["shady"]},{criteria:{hsl:{h:null,s:[0,.4],l:null}},descriptive:["ashy","dusty"]},{criteria:{hsl:{h:null,s:null,l:[.01,.08]}},descriptive:["almost black"]},{criteria:{hsl:{h:null,s:null,l:[0,.02]}},descriptive:["black"]},{criteria:{hsl:{h:null,s:null,l:[0,.09]}},descriptive:["very dark"]},{criteria:{hsl:{h:null,s:[0,.4],l:[0,.22]}},descriptive:["dark"]},{criteria:{hsl:{h:null,s:[.1,.4],l:[0,.6]}},descriptive:["dark","inky","dim","gloomy"]},{criteria:{hsl:{h:null,s:[0,.04],l:[.1,.99]}},descriptive:["grey"],nouns:["grey"],description:["Grey is a color often linked with neutrality, balance, and calm. It sits between black and white on the color spectrum, giving it a muted, understated quality. When you think of grey, you might picture misty mornings, smooth stone, or the quiet stillness of a cloudy day. It's a versatile color, fitting equally well in minimalist designs or more somber settings. Grey can evoke feelings of tranquility, contemplation, and sophistication. Close your eyes and imagine grey\u2014it might appear as a soft shadow or a subtle haze that wraps the world in a calm, muted tone."]},{criteria:{hsl:{h:null,s:[.04,.1],l:[.17,.99]}},descriptive:["almost grey"]},{criteria:{hsl:{h:null,s:[.1,.3],l:[.17,.99]}},descriptive:["very unsaturated"]},{criteria:{hsl:{h:null,s:[.3,.46],l:null}},descriptive:["unsaturated"]},{criteria:{hsl:{h:null,s:[.46,.6],l:[.4,.55]}},descriptive:["rather unsaturated"]},{criteria:{hsl:{h:null,s:[.601,.8],l:[.45,.6]}},descriptive:["saturated"]},{criteria:{hsl:{h:null,s:[.801,.94],l:[.45,.6]}},descriptive:["rather saturated"]},{criteria:{hsl:{h:null,s:[.941,1],l:[.45,.6]}},descriptive:["very saturated"]},{criteria:{hsl:{h:[0,90],s:[.3,1],l:[.1,1]}},descriptive:["warm","mellow"]},{criteria:{hsl:{h:[270,360],s:[.3,1],l:[.1,1]}},descriptive:["warm","mellow"]},{criteria:{hsl:{h:[90.01,269.99],s:null,l:[.1,1]}},descriptive:["cold","cool"]},{criteria:{hsl:{h:null,s:null,l:[.98,1]}},nouns:["white"],description:["White is a color that is often associated with purity, innocence, and cleanliness. It is the lightest color on the visible spectrum and is often described as having a bright, luminous quality. When you think of white, you might imagine a freshly fallen snow, a blank canvas, or a cloudless sky. It is a versatile color that can be used in a wide range of settings and contexts, from formal to casual. If you close your eyes and picture white, you might imagine a bright, radiant light that illuminates everything around it."],meanings:["purity","cleanliness","simplicity","innocence","freshness","light","goodness","virtue","safety","peace","tranquility","wholeness","perfection","honesty","truth","sincerity"],usage:["health","hospital","sanitary"]},{criteria:{hsl:{h:null,s:null,l:[0,.08]}},nouns:["black"],description:["Black is a color that is often associated with power, elegance, and sophistication. It is a color that is often used to create a sense of mystery, depth, and contrast, and it is often described as a color that can be both bold and elegant. In art and design, black is often used to create a sense of sophistication and drama, and it is often used in fashion to create a sense of sophistication and refinement."],meanings:["power","control","authority","discipline","discretion","secrecy","elegance","mystery"],usage:["intimidate","create fear","authority","luxury"]},{criteria:{hsl:{h:[0,15],s:[.1,1],l:[.07,.99]}},descriptive:["red","reddish"],nouns:["red"],description:["Red is a warm, vibrant color that is often associated with passion and excitement. It is the color of fire, and it is often used to grab attention and convey a sense of urgency or danger. In terms of wavelength, red is the color that is associated with the longest wavelengths of visible light, and it is one of the primary colors of light, along with blue and green. Some people may associate the color red with feelings of love and warmth, while others may associate it with anger or danger. Overall, red is a bold and striking color that can be used to convey a wide range of emotions and messages."],meanings:["excitement","energy","passion","courage","attention","lust","power","love","speed","anger","lust","excitement","danger","ferocity","violence","fury","anger","vigor","urgency"],usage:["stimulate","create urgency","draw attention","caution","encourage","excite"]},{criteria:{hsl:{h:[15,45],s:[.1,1],l:[.4,.99]}},descriptive:["orange"],nouns:["orange"],description:["Orange is a vibrant and playful color that is often associated with creativity, energy, and warmth. It is a secondary color that is made by combining red and yellow, and it is often described as a warm and friendly color that can be both invigorating and calming. It is often associated with joy, enthusiasm, and warmth, and it is often used in art and design to create a sense of excitement and playfulness."],meanings:["optimism","independence","adventure","creativity","fun"],usage:["stimulate","draw attention","express freedom","fascinate"]},{criteria:{hsl:{h:[15,45],s:[.1,1],l:[.07,.4]}},descriptive:["brown"],nouns:["brown"],description:["Brown is a warm and earthy color that is often associated with nature, stability, and reliability. It is a secondary color that is made by combining red, blue, and yellow in different proportions, and it is often described as a rich and luxurious color that can be both comforting and grounding. It is often associated with wood, soil, and the natural world, and it is often used in art and design to create a sense of warmth and permanence."],meanings:["strength","reliability","resilience","loneliness","sadness","isolation","warmth","comfort","security"],usage:["agriculture","legal","food","tobacco","alcohol"]},{criteria:{hsl:{h:[45,70],s:[.1,1],l:[.07,.99]}},descriptive:["yellow"],nouns:["yellow"],description:["Yellow is a bright and cheerful color that is often associated with sunshine, happiness, and warmth. It is a primary color that is made by combining red and green light, and it is usually described as a warm and vibrant color that can be both calming and energizing. It is often associated with joy, happiness, and friendship, and it is often used in art and design to create a sense of cheerfulness and playfulness."],meanings:["enthusiasm","opportunity","spontaneity","happiness","positivity"],usage:["stimulate","relax","awake awareness","energize","affect mood","sale","cheap","budget","construction","convey competence"]},{criteria:{hsl:{h:[70,79],s:[.1,1],l:[.07,.99]}},descriptive:["lime"],nouns:["lime"],description:["Lime is a bright, vibrant color that is often associated with freshness, energy, and youth. It is a pale shade of green that is similar to chartreuse, but it is slightly lighter and more vibrant. Some people may associate the color lime with feelings of playfulness and excitement, while others may associate it with feelings of rejuvenation and renewal. In terms of wavelength, lime is a mixture of green and yellow light, and it is often used in art and design to create a sense of energy and vitality. Overall, lime is a lively and refreshing color that can be used to create a wide range of moods and atmospheres."],meanings:["growth","harmony","fertility","kindness","dependability"],usage:["restore energy","promote growth","awake awareness","rejuvenate","nature"]},{criteria:{hsl:{h:[79,163],s:[.1,1],l:[.07,.99]}},descriptive:["green","greenish"],nouns:["green"],description:["Green is a cool, refreshing color that is often associated with nature, growth, and freshness. It is the color of grass, leaves, and trees, and it is often used to create a sense of harmony and balance. Some people may associate the color green with feelings of jealousy or envy, while others may associate it with feelings of peace and tranquility. In terms of wavelength, green is a primary color of light, and it is located between blue and yellow on the visible light spectrum. It is often used in art and design to create a sense of growth and renewal. Overall, green is a versatile and popular color that can be used to create a wide range of moods and atmospheres."],meanings:["safety","harmony","stability","reliability","balance"],usage:["relax","ballance","revitalize","encourage","posses"]},{criteria:{hsl:{h:[163,193],s:[.1,1],l:[.07,.99]}},descriptive:["cyan"],nouns:["cyan","sky blue"],description:["Cyan is a bright, fresh color that is often associated with the ocean, the sky, and the natural world. It is a pale shade of blue that is similar to teal, but it is slightly lighter and more muted. Some people may associate the color cyan with feelings of peace and serenity, while others may associate it with feelings of youth and playfulness. In terms of wavelength, cyan is a mixture of blue and green light, and it is often used in art and design to create a sense of freshness and vitality. Overall, cyan is a versatile and refreshing color that can be used to create a wide range of moods and atmospheres."],meanings:["freedom","trust","wisdom","joy","refreshing","consciousness","stimulating"],usage:["self expression","communication","children products","technology","aerospace","entertainment","productivity"]},{criteria:{hsl:{h:[193,240],s:[.1,1],l:[.07,.99]}},descriptive:["blue","blueish"],nouns:["blue"],description:["Blue is a cool, calming color that is often associated with trust, reliability, and intelligence. It is the color of the sky and the ocean, and it is often used to create a sense of peace and tranquility. Some people may associate the color blue with feelings of sadness or melancholy, while others may associate it with feelings of calm and relaxation. In terms of wavelength, blue is a primary color of light, and it is located between green and violet on the visible light spectrum. It is often used in art and design to create a sense of balance and harmony. Overall, blue is a versatile and popular color that can be used to create a wide range of moods and atmospheres."],meanings:["trust","responsibility","honesty","loyalty","security","relying","calmness","control"],usage:["security","finance","technology","health care","accounting"]},{criteria:{hsl:{h:[240,260],s:[.1,1],l:[.07,.99]}},descriptive:["indigo"],nouns:["indigo"],description:["Indigo is a deep, rich color that is often associated with spirituality, intuition, and wisdom. It is a dark shade of blue that is similar to navy, but it is slightly lighter and more muted. Some people may associate the color indigo with feelings of calm and relaxation, while others may associate it with feelings of mystery and intrigue. In terms of wavelength, indigo is a deep blue color that is located between blue and violet on the visible light spectrum. It is often used in art and design to add a touch of depth and complexity. Overall, indigo is a beautiful and versatile color that can be used to create a wide range of moods and atmospheres."],meanings:["spirituality","structure","compassion","sensitivity","mystery","tolerance","integrity","order","wisdom","inspiration"],usage:["luxury","religion","psychic"]},{criteria:{hsl:{h:[260,270],s:[.1,1],l:[.07,.99]}},descriptive:["violet"],nouns:["violet"],description:["Violet is a rich, regal color that is often associated with luxury, royalty, and sophistication. It is a deep shade of purple that is similar to lavender, but it is slightly darker and more intense. Some people may associate the color violet with feelings of mystery and spirituality, while others may associate it with feelings of calm and tranquility. In terms of wavelength, violet is a mixture of blue and red light, and it is often used in art and design to add a touch of elegance and refinement. Overall, violet is a beautiful and sophisticated color that can be used to create a calm and peaceful atmosphere."],meanings:["spirituality","structure","compassion","sensitivity","mystery","tolerance","integrity","order","wisdom","inspiration"],usage:["luxury","religion","psychic"]},{criteria:{hsl:{h:[270,291],s:[.1,1],l:[.07,.99]}},descriptive:["purple","purplish"],nouns:["purple"],description:["Purple is a rich and vibrant color that is often associated with royalty, luxury, and creativity. It is a combination of blue and red, with more red than blue, giving it a warm and passionate quality. The shade of purple can vary from a deep, dark hue to a light, almost lavender color, and each shade can evoke different emotions and meanings. Some people may associate purple with spirituality and mysticism, while others may see it as a symbol of extravagance and decadence. In terms of wavelength, purple is located between blue and violet on the visible light spectrum and has a shorter wavelength than most other colors. Because of its striking and eye-catching nature, purple is frequently used in fashion, art, and design to add a pop of color and flair. Overall, purple is a captivating and dynamic color that can express a wide range of moods and emotions, making it a favorite among many people."],meanings:["spirituality","structure","compassion","sensitivity","mystery","tolerance","integrity","order","wisdom","inspiration"],usage:["luxury","religion","psychic","royalty"]},{criteria:{hsl:{h:[291,327],s:[.1,1],l:[.07,.99]}},descriptive:["magenta"],nouns:["magenta"],description:["Magenta is a deep, rich color that is often associated with creativity, passion, and intensity. It is a vibrant shade of pink that is similar to fuchsia, but it is slightly darker and more muted. Some people may associate the color magenta with feelings of excitement and energy, while others may associate it with feelings of love and romance. In terms of wavelength, magenta is a mixture of red and blue light, and it is often used in art and design to add a bold and striking touch. Overall, magenta is a vibrant and lively color that can be used to add drama and excitement to any setting."],meanings:["support","kind","change","harmony","kink","charm","politeness","sensitivity","tenderness","sweetness","femininity","romance","seductiveness","sexiness"],usage:["children products",,"erotica"]},{criteria:{hsl:{h:[327,344],s:[.1,1],l:[.07,.99]}},descriptive:["pink"],nouns:["pink"],description:["Pink is a light, delicate color that is often associated with femininity, romance, and sweetness. It is a pale shade of red, and it is often described as a softer, more gentle version of the color. Some people may associate the color pink with feelings of happiness and playfulness, while others may associate it with feelings of warmth and comfort. In terms of wavelength, pink is a mixture of red and white light, and it is often used in decorations and clothing to add a touch of whimsy and fun. Overall, pink is a cheerful and playful color that can be used to create a warm and inviting atmosphere."],meanings:["support","kindness","change","harmony","kink","charm","politeness","sensitivity","tenderness","sweetness","femininity","romance","seductiveness","sexiness"],usage:["children products","erotica"]},{criteria:{hsl:{h:[344,360],s:[.1,1],l:[.07,.99]}},descriptive:["red","reddish"],nouns:["red"],description:["Red is a warm, vibrant color that is often associated with passion and excitement. It is the color of fire, and it is often used to grab attention and convey a sense of urgency or danger. In terms of wavelength, red is the color that is associated with the longest wavelengths of visible light, and it is one of the primary colors of light, along with blue and green. Some people may associate the color red with feelings of love and warmth, while others may associate it with anger or danger. Overall, red is a bold and striking color that can be used to convey a wide range of emotions and messages."],meanings:["excitement","energy","passion","courage","attention","lust","power","love","speed","anger","lust","excitement","danger","ferocity","violence","fury","anger","vigor","urgency"],usage:["stimulate","create urgency","draw attention","caution","encourage"]}],temperatures:[{value:1800,descriptive:["ultra warm"]},{value:2400,descriptive:["very warm"]},{value:2700,descriptive:["warm"]},{value:3e3,descriptive:["warm white"]},{value:4e3,descriptive:["cool or cold"]},{value:6500,descriptive:["cool"]}],percentWords:[{maxPercentile:.06,word:"a dash of"},{maxPercentile:.16,word:"a little bit of"},{maxPercentile:.31,word:"some"},{maxPercentile:.56,word:"a good bit of"},{maxPercentile:.71,word:"a lot of"},{maxPercentile:.86,word:"a whole lot of"},{maxPercentile:.99,word:"neatly entirely"},{maxPercentile:1,word:"entirely"}]};var Bo={rgb:Z("rgb"),hsl:Z("hsl")},Ni={rgb:["r","g","b"],cmyk:["c","m","y","k"],hsl:["h","s","l"]},E,Fo,ve,xr=class{constructor(t,r=Zo){Xr(this,E);Tt(this,"formats",{});Tt(this,"currentColor",null);this.color=t,this.descriptions=r.descriptions,this.temperatures=r.temperatures,this.percentWords=r.percentWords}set color(t){this.currentColor=oe(this,E,Fo).call(this,t);let r=Bo.rgb(this.currentColor);this.formats.rgb=r,this.formats.hsl=Bo.hsl(this.currentColor),this.formats.cmyk=Sr(r)}get color(){return this.currentColor}get temperatureWords(){let t=Hr(this.formats.rgb);return this.temperatures.reduce((r,n)=>Math.abs(n.value-t)r[a]),o=n.reduce((a,i)=>a+i,0);return n.map(a=>o?a/o:0)}percentageWords(t="rgb"){return this.percentages(t).map(r=>this.percentWords.find(n=>n.maxPercentile>=r).word)}get descriptiveWords(){return oe(this,E,ve).call(this,"descriptive")}get nouns(){return oe(this,E,ve).call(this,"nouns")}get meanings(){return oe(this,E,ve).call(this,"meanings")}get usage(){return oe(this,E,ve).call(this,"usage")}get description(){return oe(this,E,ve).call(this,"description")}get bestContrast(){return ht(this.color,"black")>ht(this.color,"white")?"black":"white"}getDescriptiveList(t,r){let n=[...this.descriptiveWords];if(t&&(n=zt(n)),r&&(n=n.slice(0,r)),n.length>1){let o=n.pop();return`${n.join(", ")} and ${o}`}else return n[0]}};E=new WeakSet,Fo=function(t){try{return Xe(t)}catch(r){throw new TypeError("Invalid color. Check the chroma-js documentation.")}},ve=function(t="descriptive",r=!1,n){let o=this.descriptions.reduce((a,i)=>i.hasOwnProperty(t)&&Object.keys(i.criteria).every(p=>{let c=this.formats[p];return Object.entries(i.criteria[p]).every(([h,b])=>{if(!(h in c)||c[h]===void 0||c[h]===null||b===null)return!0;let x=c[h];return h==="h"&&(x=Math.round(x)),Array.isArray(b)?_r(x,b[0],b[1]):isNaN(b)?!1:x===b})})?[...new Set([...a,...i[t]])]:a,[]);return r?zt(o).slice(0,n):o.slice(0,n)};var qi=xr;return ln($i);})(); 5 | -------------------------------------------------------------------------------- /dist/index.js: -------------------------------------------------------------------------------- 1 | var M=Object.defineProperty;var m=s=>{throw TypeError(s)};var k=(s,r,e)=>r in s?M(s,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[r]=e;var d=(s,r,e)=>k(s,typeof r!="symbol"?r+"":r,e),E=(s,r,e)=>r.has(s)||m("Cannot "+e);var b=(s,r,e)=>r.has(s)?m("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(s):r.set(s,e);var a=(s,r,e)=>(E(s,r,"access private method"),e);var o,W,h;import{rgb2temperature as j,isInRange as A,randomizeArr as v,rgbToCMYK as x}from"./utils";import{wcagContrast as C,parse as I,converter as y}from"culori";import N from"./en";const w={rgb:y("rgb"),hsl:y("hsl")},O={rgb:["r","g","b"],cmyk:["c","m","y","k"],hsl:["h","s","l"]};class T{constructor(r,e=N){b(this,o);d(this,"formats",{});d(this,"currentColor",null);this.color=r,this.descriptions=e.descriptions,this.temperatures=e.temperatures,this.percentWords=e.percentWords}set color(r){this.currentColor=a(this,o,W).call(this,r);const e=w.rgb(this.currentColor);this.formats.rgb=e,this.formats.hsl=w.hsl(this.currentColor),this.formats.cmyk=x(e)}get color(){return this.currentColor}get temperatureWords(){const r=j(this.formats.rgb);return this.temperatures.reduce((e,t)=>Math.abs(t.value-r)e[n]),i=t.reduce((n,c)=>n+c,0);return t.map(n=>i?n/i:0)}percentageWords(r="rgb"){return this.percentages(r).map(e=>this.percentWords.find(t=>t.maxPercentile>=e).word)}get descriptiveWords(){return a(this,o,h).call(this,"descriptive")}get nouns(){return a(this,o,h).call(this,"nouns")}get meanings(){return a(this,o,h).call(this,"meanings")}get usage(){return a(this,o,h).call(this,"usage")}get description(){return a(this,o,h).call(this,"description")}get bestContrast(){return C(this.color,"black")>C(this.color,"white")?"black":"white"}getDescriptiveList(r,e){let t=[...this.descriptiveWords];if(r&&(t=v(t)),e&&(t=t.slice(0,e)),t.length>1){const i=t.pop();return`${t.join(", ")} and ${i}`}else return t[0]}}o=new WeakSet,W=function(r){try{return I(r)}catch{throw new TypeError("Invalid color. Check the chroma-js documentation.")}},h=function(r="descriptive",e=!1,t){const i=this.descriptions.reduce((n,c)=>c.hasOwnProperty(r)&&Object.keys(c.criteria).every(f=>{const p=this.formats[f];return Object.entries(c.criteria[f]).every(([u,l])=>{if(!(u in p)||p[u]===void 0||p[u]===null||l===null)return!0;let g=p[u];return u==="h"&&(g=Math.round(g)),Array.isArray(l)?A(g,l[0],l[1]):isNaN(l)?!1:g===l})})?[...new Set([...n,...c[r]])]:n,[]);return e?v(i).slice(0,t):i.slice(0,t)};export default T; 2 | -------------------------------------------------------------------------------- /jest.config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | testEnvironment: "jest-environment-node", 3 | transform: { 4 | "^.+\\.jsx?$": "babel-jest", 5 | }, 6 | }; 7 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "color-description", 3 | "version": "0.15.0", 4 | "description": "Textual color description", 5 | "main": "dist/index.js", 6 | "module": "dist/index.esm.js", 7 | "browser": "dist/index.iife.js", 8 | "type": "module", 9 | "scripts": { 10 | "build": "npm run build:style && npm run build:esm && npm run build:browser && npm run build:node", 11 | "build:esm": "esbuild src/index.js --outfile=dist/index.esm.js --format=esm --bundle --target=es2020 --minify", 12 | "build:browser": "esbuild src/index.js --outfile=dist/index.iife.js --bundle --target=es6 --format=iife --global-name=ColorDescription --minify", 13 | "build:node": "esbuild src/index.js --outfile=dist/index.js --platform=node --target=node14 --minify", 14 | "build:style": "npx prettier . --write", 15 | "test": "npm run build && node --experimental-vm-modules node_modules/.bin/jest --verbose ./tests", 16 | "dev:watch": "esbuild src/index.js --outfile=dist/index.iife.js --bundle --target=es6 --format=iife --global-name=ColorDescription --watch", 17 | "dev:watch-demo": "live-server ./dist --entry-file=dist/index.html --watch=dist/index.html,./dist/index.iife.js", 18 | "dev": "concurrently \"npm run dev:watch\" \"npm run dev:watch-demo\"" 19 | }, 20 | "repository": { 21 | "type": "git", 22 | "url": "git+https://github.com/words/color-description.git" 23 | }, 24 | "keywords": [ 25 | "color", 26 | "text", 27 | "colour", 28 | "description", 29 | "naming", 30 | "accessibility" 31 | ], 32 | "author": "meodai@gmail.com", 33 | "license": "MIT", 34 | "bugs": { 35 | "url": "https://github.com/words/color-description/issues" 36 | }, 37 | "homepage": "https://github.com/words/color-description#readme", 38 | "config": { 39 | "commitizen": { 40 | "path": "git-cz" 41 | } 42 | }, 43 | "devDependencies": { 44 | "concurrently": "^9.0.1", 45 | "culori": "^4.0.1", 46 | "esbuild": "^0.24.0", 47 | "jest": "^29.7.0", 48 | "live-server": "^1.2.2", 49 | "prettier": "^3.3.3" 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/en.js: -------------------------------------------------------------------------------- 1 | export default { 2 | descriptions: [ 3 | { 4 | criteria: { 5 | hsl: { 6 | h: null, 7 | s: [0.75, 1], 8 | l: [0.4, 0.55], 9 | }, 10 | }, 11 | descriptive: [ 12 | "saturated", 13 | "strong", 14 | "lush", 15 | "ablaze", 16 | "beaming", 17 | "bold", 18 | "brilliant", 19 | "flamboyant", 20 | "vibrant", 21 | "vivid", 22 | "loud", 23 | ], 24 | }, 25 | { 26 | criteria: { 27 | hsl: { 28 | h: null, 29 | s: null, 30 | l: [0, 0.07], 31 | }, 32 | }, 33 | descriptive: ["dark", "ashy", "somber", "bleak", "muddy", "sooty"], 34 | }, 35 | { 36 | criteria: { 37 | hsl: { 38 | h: null, 39 | s: null, 40 | l: [0, 0.3], 41 | }, 42 | }, 43 | descriptive: ["dark", "dim", "gloomy", "dull"], 44 | }, 45 | { 46 | criteria: { 47 | hsl: { 48 | h: null, 49 | s: [0.1, 0.7], 50 | l: [0.15, 0.5], 51 | }, 52 | }, 53 | descriptive: ["bleak", "muted", "matte", "dusty"], 54 | }, 55 | { 56 | criteria: { 57 | hsl: { 58 | h: null, 59 | s: [0.12, 1], 60 | l: [0.7, 1], 61 | }, 62 | }, 63 | descriptive: ["tinted"], 64 | }, 65 | { 66 | criteria: { 67 | hsl: { 68 | h: null, 69 | s: [0.2, 1], 70 | l: [0.75, 0.95], 71 | }, 72 | }, 73 | descriptive: ["pastel"], 74 | }, 75 | { 76 | criteria: { 77 | hsl: { 78 | h: null, 79 | s: null, 80 | l: [0.88, 1], 81 | }, 82 | }, 83 | descriptive: [ 84 | "pale", 85 | "light", 86 | "faded", 87 | "delicate", 88 | "glistening", 89 | "bleached", 90 | ], 91 | }, 92 | { 93 | criteria: { 94 | hsl: { 95 | h: null, 96 | s: [0.5, 1], 97 | l: [0.7, 0.9], 98 | }, 99 | }, 100 | descriptive: [ 101 | "fresh", 102 | "sparkling", 103 | "glittering", 104 | "glowing", 105 | "jazzy", 106 | "opalescent", 107 | ], 108 | }, 109 | { 110 | criteria: { 111 | hsl: { 112 | h: null, 113 | s: null, 114 | l: [0.9, 1], 115 | }, 116 | }, 117 | descriptive: ["neutral"], 118 | }, 119 | { 120 | criteria: { 121 | hsl: { 122 | h: null, 123 | s: [0.74, 1], 124 | l: [0.9, 1], 125 | }, 126 | }, 127 | descriptive: ["muted"], 128 | }, 129 | { 130 | criteria: { 131 | hsl: { 132 | h: null, 133 | s: null, 134 | l: 1, 135 | }, 136 | }, 137 | descriptive: ["colorless", "bright", "brilliant", "high"], 138 | }, 139 | { 140 | criteria: { 141 | hsl: { 142 | h: null, 143 | s: null, 144 | l: 0, 145 | }, 146 | }, 147 | descriptive: ["colorless", "low", "dark"], 148 | }, 149 | { 150 | criteria: { 151 | hsl: { 152 | h: null, 153 | s: [0, 0.01], 154 | l: null, 155 | }, 156 | }, 157 | descriptive: ["colorless", "neutral"], 158 | }, 159 | { 160 | criteria: { 161 | hsl: { 162 | h: null, 163 | s: null, 164 | l: [0.01, 0.3], 165 | }, 166 | }, 167 | descriptive: ["shady"], 168 | }, 169 | { 170 | criteria: { 171 | hsl: { 172 | h: null, 173 | s: [0, 0.4], 174 | l: null, 175 | }, 176 | }, 177 | descriptive: ["ashy", "dusty"], 178 | }, 179 | { 180 | criteria: { 181 | hsl: { 182 | h: null, 183 | s: null, 184 | l: [0.01, 0.08], 185 | }, 186 | }, 187 | descriptive: ["almost black"], 188 | }, 189 | { 190 | criteria: { 191 | hsl: { 192 | h: null, 193 | s: null, 194 | l: [0.0, 0.02], 195 | }, 196 | }, 197 | descriptive: ["black"], 198 | }, 199 | { 200 | criteria: { 201 | hsl: { 202 | h: null, 203 | s: null, 204 | l: [0, 0.09], 205 | }, 206 | }, 207 | descriptive: ["very dark"], 208 | }, 209 | { 210 | criteria: { 211 | hsl: { 212 | h: null, 213 | s: [0, 0.4], 214 | l: [0, 0.22], 215 | }, 216 | }, 217 | descriptive: ["dark"], 218 | }, 219 | { 220 | criteria: { 221 | hsl: { 222 | h: null, 223 | s: [0.1, 0.4], 224 | l: [0, 0.6], 225 | }, 226 | }, 227 | descriptive: ["dark", "inky", "dim", "gloomy"], 228 | }, 229 | { 230 | criteria: { 231 | hsl: { 232 | h: null, 233 | s: [0, 0.04], 234 | l: [0.1, 0.99], 235 | }, 236 | }, 237 | descriptive: ["grey"], 238 | nouns: ["grey"], 239 | description: [ 240 | "Grey is a color often linked with neutrality, balance, and calm. It sits between black and white on the color spectrum, giving it a muted, understated quality. When you think of grey, you might picture misty mornings, smooth stone, or the quiet stillness of a cloudy day. It's a versatile color, fitting equally well in minimalist designs or more somber settings. Grey can evoke feelings of tranquility, contemplation, and sophistication. Close your eyes and imagine grey—it might appear as a soft shadow or a subtle haze that wraps the world in a calm, muted tone.", 241 | ], 242 | }, 243 | { 244 | criteria: { 245 | hsl: { 246 | h: null, 247 | s: [0.04, 0.1], 248 | l: [0.17, 0.99], 249 | }, 250 | }, 251 | descriptive: ["almost grey"], 252 | }, 253 | { 254 | criteria: { 255 | hsl: { 256 | h: null, 257 | s: [0.1, 0.3], 258 | l: [0.17, 0.99], 259 | }, 260 | }, 261 | descriptive: ["very unsaturated"], 262 | }, 263 | { 264 | criteria: { 265 | hsl: { 266 | h: null, 267 | s: [0.3, 0.46], 268 | l: null, 269 | }, 270 | }, 271 | descriptive: ["unsaturated"], 272 | }, 273 | { 274 | criteria: { 275 | hsl: { 276 | h: null, 277 | s: [0.46, 0.6], 278 | l: [0.4, 0.55], 279 | }, 280 | }, 281 | descriptive: ["rather unsaturated"], 282 | }, 283 | { 284 | criteria: { 285 | hsl: { 286 | h: null, 287 | s: [0.601, 0.8], 288 | l: [0.45, 0.6], 289 | }, 290 | }, 291 | descriptive: ["saturated"], 292 | }, 293 | { 294 | criteria: { 295 | hsl: { 296 | h: null, 297 | s: [0.801, 0.94], 298 | l: [0.45, 0.6], 299 | }, 300 | }, 301 | descriptive: ["rather saturated"], 302 | }, 303 | { 304 | criteria: { 305 | hsl: { 306 | h: null, 307 | s: [0.941, 1], 308 | l: [0.45, 0.6], 309 | }, 310 | }, 311 | descriptive: ["very saturated"], 312 | }, 313 | { 314 | criteria: { 315 | hsl: { 316 | h: [0, 90], 317 | s: [0.3, 1], 318 | l: [0.1, 1], 319 | }, 320 | }, 321 | descriptive: ["warm", "mellow"], 322 | }, 323 | { 324 | criteria: { 325 | hsl: { 326 | h: [270, 360], 327 | s: [0.3, 1], 328 | l: [0.1, 1], 329 | }, 330 | }, 331 | descriptive: ["warm", "mellow"], 332 | }, 333 | { 334 | criteria: { 335 | hsl: { 336 | h: [90.01, 269.99], 337 | s: null, 338 | l: [0.1, 1], 339 | }, 340 | }, 341 | descriptive: ["cold", "cool"], 342 | }, 343 | { 344 | criteria: { 345 | hsl: { 346 | h: null, 347 | s: null, 348 | l: [0.98, 1], 349 | }, 350 | }, 351 | nouns: ["white"], 352 | description: [ 353 | "White is a color that is often associated with purity, innocence, and cleanliness. It is the lightest color on the visible spectrum and is often described as having a bright, luminous quality. When you think of white, you might imagine a freshly fallen snow, a blank canvas, or a cloudless sky. It is a versatile color that can be used in a wide range of settings and contexts, from formal to casual. If you close your eyes and picture white, you might imagine a bright, radiant light that illuminates everything around it.", 354 | ], 355 | meanings: [ 356 | "purity", 357 | "cleanliness", 358 | "simplicity", 359 | "innocence", 360 | "freshness", 361 | "light", 362 | "goodness", 363 | "virtue", 364 | "safety", 365 | "peace", 366 | "tranquility", 367 | "wholeness", 368 | "perfection", 369 | "honesty", 370 | "truth", 371 | "sincerity", 372 | ], 373 | usage: ["health", "hospital", "sanitary"], 374 | }, 375 | { 376 | criteria: { 377 | hsl: { 378 | h: null, 379 | s: null, 380 | l: [0.0, 0.08], 381 | }, 382 | }, 383 | nouns: ["black"], 384 | description: [ 385 | "Black is a color that is often associated with power, elegance, and sophistication. It is a color that is often used to create a sense of mystery, depth, and contrast, and it is often described as a color that can be both bold and elegant. In art and design, black is often used to create a sense of sophistication and drama, and it is often used in fashion to create a sense of sophistication and refinement.", 386 | ], 387 | meanings: [ 388 | "power", 389 | "control", 390 | "authority", 391 | "discipline", 392 | "discretion", 393 | "secrecy", 394 | "elegance", 395 | "mystery", 396 | ], 397 | usage: ["intimidate", "create fear", "authority", "luxury"], 398 | }, 399 | { 400 | criteria: { 401 | hsl: { 402 | h: [0, 15], 403 | s: [0.1, 1], 404 | l: [0.07, 0.99], 405 | }, 406 | }, 407 | descriptive: ["red", "reddish"], 408 | nouns: ["red"], 409 | description: [ 410 | "Red is a warm, vibrant color that is often associated with passion and excitement. It is the color of fire, and it is often used to grab attention and convey a sense of urgency or danger. In terms of wavelength, red is the color that is associated with the longest wavelengths of visible light, and it is one of the primary colors of light, along with blue and green. Some people may associate the color red with feelings of love and warmth, while others may associate it with anger or danger. Overall, red is a bold and striking color that can be used to convey a wide range of emotions and messages.", 411 | ], 412 | meanings: [ 413 | "excitement", 414 | "energy", 415 | "passion", 416 | "courage", 417 | "attention", 418 | "lust", 419 | "power", 420 | "love", 421 | "speed", 422 | "anger", 423 | "lust", 424 | "excitement", 425 | "danger", 426 | "ferocity", 427 | "violence", 428 | "fury", 429 | "anger", 430 | "vigor", 431 | "urgency", 432 | ], 433 | usage: [ 434 | "stimulate", 435 | "create urgency", 436 | "draw attention", 437 | "caution", 438 | "encourage", 439 | "excite", 440 | ], 441 | }, 442 | { 443 | criteria: { 444 | hsl: { 445 | h: [15, 45], 446 | s: [0.1, 1], 447 | l: [0.4, 0.99], 448 | }, 449 | }, 450 | descriptive: ["orange"], 451 | nouns: ["orange"], 452 | description: [ 453 | "Orange is a vibrant and playful color that is often associated with creativity, energy, and warmth. It is a secondary color that is made by combining red and yellow, and it is often described as a warm and friendly color that can be both invigorating and calming. It is often associated with joy, enthusiasm, and warmth, and it is often used in art and design to create a sense of excitement and playfulness.", 454 | ], 455 | meanings: ["optimism", "independence", "adventure", "creativity", "fun"], 456 | usage: ["stimulate", "draw attention", "express freedom", "fascinate"], 457 | }, 458 | { 459 | criteria: { 460 | hsl: { 461 | h: [15, 45], 462 | s: [0.1, 1], 463 | l: [0.07, 0.4], 464 | }, 465 | }, 466 | descriptive: ["brown"], 467 | nouns: ["brown"], 468 | description: [ 469 | "Brown is a warm and earthy color that is often associated with nature, stability, and reliability. It is a secondary color that is made by combining red, blue, and yellow in different proportions, and it is often described as a rich and luxurious color that can be both comforting and grounding. It is often associated with wood, soil, and the natural world, and it is often used in art and design to create a sense of warmth and permanence.", 470 | ], 471 | meanings: [ 472 | "strength", 473 | "reliability", 474 | "resilience", 475 | "loneliness", 476 | "sadness", 477 | "isolation", 478 | "warmth", 479 | "comfort", 480 | "security", 481 | ], 482 | usage: ["agriculture", "legal", "food", "tobacco", "alcohol"], 483 | }, 484 | { 485 | criteria: { 486 | hsl: { 487 | h: [45, 70], 488 | s: [0.1, 1], 489 | l: [0.07, 0.99], 490 | }, 491 | }, 492 | descriptive: ["yellow"], 493 | nouns: ["yellow"], 494 | description: [ 495 | "Yellow is a bright and cheerful color that is often associated with sunshine, happiness, and warmth. It is a primary color that is made by combining red and green light, and it is usually described as a warm and vibrant color that can be both calming and energizing. It is often associated with joy, happiness, and friendship, and it is often used in art and design to create a sense of cheerfulness and playfulness.", 496 | ], 497 | meanings: [ 498 | "enthusiasm", 499 | "opportunity", 500 | "spontaneity", 501 | "happiness", 502 | "positivity", 503 | ], 504 | usage: [ 505 | "stimulate", 506 | "relax", 507 | "awake awareness", 508 | "energize", 509 | "affect mood", 510 | "sale", 511 | "cheap", 512 | "budget", 513 | "construction", 514 | "convey competence", 515 | ], 516 | }, 517 | { 518 | criteria: { 519 | hsl: { 520 | h: [70, 79], 521 | s: [0.1, 1], 522 | l: [0.07, 0.99], 523 | }, 524 | }, 525 | descriptive: ["lime"], 526 | nouns: ["lime"], 527 | description: [ 528 | "Lime is a bright, vibrant color that is often associated with freshness, energy, and youth. It is a pale shade of green that is similar to chartreuse, but it is slightly lighter and more vibrant. Some people may associate the color lime with feelings of playfulness and excitement, while others may associate it with feelings of rejuvenation and renewal. In terms of wavelength, lime is a mixture of green and yellow light, and it is often used in art and design to create a sense of energy and vitality. Overall, lime is a lively and refreshing color that can be used to create a wide range of moods and atmospheres.", 529 | ], 530 | meanings: ["growth", "harmony", "fertility", "kindness", "dependability"], 531 | usage: [ 532 | "restore energy", 533 | "promote growth", 534 | "awake awareness", 535 | "rejuvenate", 536 | "nature", 537 | ], 538 | }, 539 | { 540 | criteria: { 541 | hsl: { 542 | h: [79, 163], 543 | s: [0.1, 1], 544 | l: [0.07, 0.99], 545 | }, 546 | }, 547 | descriptive: ["green", "greenish"], 548 | nouns: ["green"], 549 | description: [ 550 | "Green is a cool, refreshing color that is often associated with nature, growth, and freshness. It is the color of grass, leaves, and trees, and it is often used to create a sense of harmony and balance. Some people may associate the color green with feelings of jealousy or envy, while others may associate it with feelings of peace and tranquility. In terms of wavelength, green is a primary color of light, and it is located between blue and yellow on the visible light spectrum. It is often used in art and design to create a sense of growth and renewal. Overall, green is a versatile and popular color that can be used to create a wide range of moods and atmospheres.", 551 | ], 552 | meanings: ["safety", "harmony", "stability", "reliability", "balance"], 553 | usage: ["relax", "ballance", "revitalize", "encourage", "posses"], 554 | }, 555 | { 556 | criteria: { 557 | hsl: { 558 | h: [163, 193], 559 | s: [0.1, 1], 560 | l: [0.07, 0.99], 561 | }, 562 | }, 563 | descriptive: ["cyan"], 564 | nouns: ["cyan", "sky blue"], 565 | description: [ 566 | "Cyan is a bright, fresh color that is often associated with the ocean, the sky, and the natural world. It is a pale shade of blue that is similar to teal, but it is slightly lighter and more muted. Some people may associate the color cyan with feelings of peace and serenity, while others may associate it with feelings of youth and playfulness. In terms of wavelength, cyan is a mixture of blue and green light, and it is often used in art and design to create a sense of freshness and vitality. Overall, cyan is a versatile and refreshing color that can be used to create a wide range of moods and atmospheres.", 567 | ], 568 | meanings: [ 569 | "freedom", 570 | "trust", 571 | "wisdom", 572 | "joy", 573 | "refreshing", 574 | "consciousness", 575 | "stimulating", 576 | ], 577 | usage: [ 578 | "self expression", 579 | "communication", 580 | "children products", 581 | "technology", 582 | "aerospace", 583 | "entertainment", 584 | "productivity", 585 | ], 586 | }, 587 | { 588 | criteria: { 589 | hsl: { 590 | h: [193, 240], 591 | s: [0.1, 1], 592 | l: [0.07, 0.99], 593 | }, 594 | }, 595 | descriptive: ["blue", "blueish"], 596 | nouns: ["blue"], 597 | description: [ 598 | "Blue is a cool, calming color that is often associated with trust, reliability, and intelligence. It is the color of the sky and the ocean, and it is often used to create a sense of peace and tranquility. Some people may associate the color blue with feelings of sadness or melancholy, while others may associate it with feelings of calm and relaxation. In terms of wavelength, blue is a primary color of light, and it is located between green and violet on the visible light spectrum. It is often used in art and design to create a sense of balance and harmony. Overall, blue is a versatile and popular color that can be used to create a wide range of moods and atmospheres.", 599 | ], 600 | meanings: [ 601 | "trust", 602 | "responsibility", 603 | "honesty", 604 | "loyalty", 605 | "security", 606 | "relying", 607 | "calmness", 608 | "control", 609 | ], 610 | usage: ["security", "finance", "technology", "health care", "accounting"], 611 | }, 612 | { 613 | criteria: { 614 | hsl: { 615 | h: [240, 260], 616 | s: [0.1, 1], 617 | l: [0.07, 0.99], 618 | }, 619 | }, 620 | descriptive: ["indigo"], 621 | nouns: ["indigo"], 622 | description: [ 623 | "Indigo is a deep, rich color that is often associated with spirituality, intuition, and wisdom. It is a dark shade of blue that is similar to navy, but it is slightly lighter and more muted. Some people may associate the color indigo with feelings of calm and relaxation, while others may associate it with feelings of mystery and intrigue. In terms of wavelength, indigo is a deep blue color that is located between blue and violet on the visible light spectrum. It is often used in art and design to add a touch of depth and complexity. Overall, indigo is a beautiful and versatile color that can be used to create a wide range of moods and atmospheres.", 624 | ], 625 | meanings: [ 626 | "spirituality", 627 | "structure", 628 | "compassion", 629 | "sensitivity", 630 | "mystery", 631 | "tolerance", 632 | "integrity", 633 | "order", 634 | "wisdom", 635 | "inspiration", 636 | ], 637 | usage: ["luxury", "religion", "psychic"], 638 | }, 639 | { 640 | criteria: { 641 | hsl: { 642 | h: [260, 270], 643 | s: [0.1, 1], 644 | l: [0.07, 0.99], 645 | }, 646 | }, 647 | descriptive: ["violet"], 648 | nouns: ["violet"], 649 | description: [ 650 | "Violet is a rich, regal color that is often associated with luxury, royalty, and sophistication. It is a deep shade of purple that is similar to lavender, but it is slightly darker and more intense. Some people may associate the color violet with feelings of mystery and spirituality, while others may associate it with feelings of calm and tranquility. In terms of wavelength, violet is a mixture of blue and red light, and it is often used in art and design to add a touch of elegance and refinement. Overall, violet is a beautiful and sophisticated color that can be used to create a calm and peaceful atmosphere.", 651 | ], 652 | meanings: [ 653 | "spirituality", 654 | "structure", 655 | "compassion", 656 | "sensitivity", 657 | "mystery", 658 | "tolerance", 659 | "integrity", 660 | "order", 661 | "wisdom", 662 | "inspiration", 663 | ], 664 | usage: ["luxury", "religion", "psychic"], 665 | }, 666 | { 667 | criteria: { 668 | hsl: { 669 | h: [270, 291], 670 | s: [0.1, 1], 671 | l: [0.07, 0.99], 672 | }, 673 | }, 674 | descriptive: ["purple", "purplish"], 675 | nouns: ["purple"], 676 | description: [ 677 | "Purple is a rich and vibrant color that is often associated with royalty, luxury, and creativity. It is a combination of blue and red, with more red than blue, giving it a warm and passionate quality. The shade of purple can vary from a deep, dark hue to a light, almost lavender color, and each shade can evoke different emotions and meanings. Some people may associate purple with spirituality and mysticism, while others may see it as a symbol of extravagance and decadence. In terms of wavelength, purple is located between blue and violet on the visible light spectrum and has a shorter wavelength than most other colors. Because of its striking and eye-catching nature, purple is frequently used in fashion, art, and design to add a pop of color and flair. Overall, purple is a captivating and dynamic color that can express a wide range of moods and emotions, making it a favorite among many people.", 678 | ], 679 | meanings: [ 680 | "spirituality", 681 | "structure", 682 | "compassion", 683 | "sensitivity", 684 | "mystery", 685 | "tolerance", 686 | "integrity", 687 | "order", 688 | "wisdom", 689 | "inspiration", 690 | ], 691 | usage: ["luxury", "religion", "psychic", "royalty"], 692 | }, 693 | { 694 | criteria: { 695 | hsl: { 696 | h: [291, 327], 697 | s: [0.1, 1], 698 | l: [0.07, 0.99], 699 | }, 700 | }, 701 | descriptive: ["magenta"], 702 | nouns: ["magenta"], 703 | description: [ 704 | "Magenta is a deep, rich color that is often associated with creativity, passion, and intensity. It is a vibrant shade of pink that is similar to fuchsia, but it is slightly darker and more muted. Some people may associate the color magenta with feelings of excitement and energy, while others may associate it with feelings of love and romance. In terms of wavelength, magenta is a mixture of red and blue light, and it is often used in art and design to add a bold and striking touch. Overall, magenta is a vibrant and lively color that can be used to add drama and excitement to any setting.", 705 | ], 706 | meanings: [ 707 | "support", 708 | "kind", 709 | "change", 710 | "harmony", 711 | "kink", 712 | "charm", 713 | "politeness", 714 | "sensitivity", 715 | "tenderness", 716 | "sweetness", 717 | "femininity", 718 | "romance", 719 | "seductiveness", 720 | "sexiness", 721 | ], 722 | usage: ["children products", , "erotica"], 723 | }, 724 | { 725 | criteria: { 726 | hsl: { 727 | h: [327, 344], 728 | s: [0.1, 1], 729 | l: [0.07, 0.99], 730 | }, 731 | }, 732 | descriptive: ["pink"], 733 | nouns: ["pink"], 734 | description: [ 735 | "Pink is a light, delicate color that is often associated with femininity, romance, and sweetness. It is a pale shade of red, and it is often described as a softer, more gentle version of the color. Some people may associate the color pink with feelings of happiness and playfulness, while others may associate it with feelings of warmth and comfort. In terms of wavelength, pink is a mixture of red and white light, and it is often used in decorations and clothing to add a touch of whimsy and fun. Overall, pink is a cheerful and playful color that can be used to create a warm and inviting atmosphere.", 736 | ], 737 | meanings: [ 738 | "support", 739 | "kindness", 740 | "change", 741 | "harmony", 742 | "kink", 743 | "charm", 744 | "politeness", 745 | "sensitivity", 746 | "tenderness", 747 | "sweetness", 748 | "femininity", 749 | "romance", 750 | "seductiveness", 751 | "sexiness", 752 | ], 753 | usage: ["children products", "erotica"], 754 | }, 755 | { 756 | criteria: { 757 | hsl: { 758 | h: [344, 360], 759 | s: [0.1, 1], 760 | l: [0.07, 0.99], 761 | }, 762 | }, 763 | descriptive: ["red", "reddish"], 764 | nouns: ["red"], 765 | description: [ 766 | "Red is a warm, vibrant color that is often associated with passion and excitement. It is the color of fire, and it is often used to grab attention and convey a sense of urgency or danger. In terms of wavelength, red is the color that is associated with the longest wavelengths of visible light, and it is one of the primary colors of light, along with blue and green. Some people may associate the color red with feelings of love and warmth, while others may associate it with anger or danger. Overall, red is a bold and striking color that can be used to convey a wide range of emotions and messages.", 767 | ], 768 | meanings: [ 769 | "excitement", 770 | "energy", 771 | "passion", 772 | "courage", 773 | "attention", 774 | "lust", 775 | "power", 776 | "love", 777 | "speed", 778 | "anger", 779 | "lust", 780 | "excitement", 781 | "danger", 782 | "ferocity", 783 | "violence", 784 | "fury", 785 | "anger", 786 | "vigor", 787 | "urgency", 788 | ], 789 | usage: [ 790 | "stimulate", 791 | "create urgency", 792 | "draw attention", 793 | "caution", 794 | "encourage", 795 | ], 796 | }, 797 | ], 798 | 799 | temperatures: [ 800 | { 801 | value: 1800, 802 | descriptive: ["ultra warm"], 803 | }, 804 | { 805 | value: 2400, 806 | descriptive: ["very warm"], 807 | }, 808 | { 809 | value: 2700, 810 | descriptive: ["warm"], 811 | }, 812 | { 813 | value: 3000, 814 | descriptive: ["warm white"], 815 | }, 816 | { 817 | value: 4000, 818 | descriptive: ["cool or cold"], 819 | }, 820 | { 821 | value: 6500, 822 | descriptive: ["cool"], 823 | }, 824 | ], 825 | percentWords: [ 826 | { 827 | maxPercentile: 0.06, 828 | word: "a dash of", 829 | }, 830 | { 831 | maxPercentile: 0.16, 832 | word: "a little bit of", 833 | }, 834 | { 835 | maxPercentile: 0.31, 836 | word: "some", 837 | }, 838 | { 839 | maxPercentile: 0.56, 840 | word: "a good bit of", 841 | }, 842 | { 843 | maxPercentile: 0.71, 844 | word: "a lot of", 845 | }, 846 | { 847 | maxPercentile: 0.86, 848 | word: "a whole lot of", 849 | }, 850 | { 851 | maxPercentile: 0.99, 852 | word: "neatly entirely", 853 | }, 854 | { 855 | maxPercentile: 1, 856 | word: "entirely", 857 | }, 858 | ], 859 | }; 860 | -------------------------------------------------------------------------------- /src/index.js: -------------------------------------------------------------------------------- 1 | import { rgb2temperature, isInRange, randomizeArr, rgbToCMYK } from "./utils"; 2 | import { wcagContrast, parse, converter, formatHex } from "culori"; 3 | import wordsEN from "./en"; 4 | 5 | const converters = { 6 | rgb: converter("rgb"), 7 | hsl: converter("hsl"), 8 | }; 9 | 10 | const formatComponents = { 11 | rgb: ["r", "g", "b"], 12 | cmyk: ["c", "m", "y", "k"], 13 | hsl: ["h", "s", "l"], 14 | }; 15 | 16 | class ColorDescription { 17 | formats = {}; 18 | currentColor = null; 19 | 20 | constructor(color, words = wordsEN) { 21 | this.color = color; 22 | this.descriptions = words.descriptions; 23 | this.temperatures = words.temperatures; 24 | this.percentWords = words.percentWords; 25 | } 26 | 27 | set color(color) { 28 | this.currentColor = this.#parseColor(color); 29 | 30 | const rgb = converters["rgb"](this.currentColor); 31 | this.formats.rgb = rgb; 32 | this.formats.hsl = converters["hsl"](this.currentColor); 33 | this.formats.cmyk = rgbToCMYK(rgb); 34 | } 35 | 36 | get color() { 37 | return this.currentColor; 38 | } 39 | 40 | /** 41 | * @param {string} color culori-js compatible color string 42 | * @returns {object} culori-js instance 43 | * @throws {TypeError} if the color is not valid 44 | */ 45 | #parseColor(color) { 46 | try { 47 | return parse(color); 48 | } catch (error) { 49 | throw new TypeError("Invalid color. Check the chroma-js documentation."); 50 | } 51 | } 52 | 53 | /** 54 | * @returns {Array} descriptive words describing the color temperature 55 | */ 56 | get temperatureWords() { 57 | const goal = rgb2temperature(this.formats.rgb); 58 | return this.temperatures.reduce( 59 | (prev, curr) => 60 | Math.abs(curr.value - goal) < Math.abs(prev.value - goal) ? curr : prev, 61 | { value: 0 }, 62 | ); 63 | } 64 | 65 | /** 66 | * @param {string} model color model in which the components are measured 67 | * possible values: "rgb", "cmyk" 68 | * @returns {Array} color component mix in percent 69 | */ 70 | percentages(model = "rgb") { 71 | // validate model 72 | if (!["rgb", "cmyk"].includes(model)) { 73 | throw new TypeError( 74 | 'Invalid color model. Use "rgb" or "cmyk" for percentages.', 75 | ); 76 | } 77 | const color = this.formats[model]; 78 | const props = formatComponents[model].map((c) => color[c]); 79 | const total = props.reduce((r, d) => r + d, 0); 80 | return props.map((c) => (total ? c / total : 0)); 81 | } 82 | 83 | /** 84 | * @param {string} model color model in which the components are measured 85 | * @returns {Array} descriptive words for color percentages 86 | */ 87 | percentageWords(model = "rgb") { 88 | return this.percentages(model).map( 89 | (component) => 90 | this.percentWords.find((words) => words.maxPercentile >= component) 91 | .word, 92 | ); 93 | } 94 | 95 | /** 96 | * @param {string} scope the scope of words to retrieve 97 | * @param {boolean} randomize whether to randomize the words 98 | * @param {number} wordLimit the maximum number of words to retrieve 99 | * @returns {Array} words matching the criteria 100 | */ 101 | #getWords(scope = "descriptive", randomize = false, wordLimit) { 102 | const words = this.descriptions.reduce((rem, current) => { 103 | if (!current.hasOwnProperty(scope)) { 104 | return rem; 105 | } 106 | 107 | const colorModels = Object.keys(current.criteria); 108 | 109 | const matchesEveryCriteria = colorModels.every((colorModel) => { 110 | const colorAsModel = this.formats[colorModel]; 111 | 112 | return Object.entries(current.criteria[colorModel]).every( 113 | ([key, criterium]) => { 114 | // Check if the key exists in colorAsModel 115 | if ( 116 | !(key in colorAsModel) || 117 | colorAsModel[key] === undefined || 118 | colorAsModel[key] === null || 119 | criterium === null 120 | ) 121 | return true; // Skip if the component doesn't exist 122 | 123 | let value = colorAsModel[key]; 124 | 125 | if (key === "h") { 126 | // not sure if this is the best way to handle hue since other color models can have a component with the same name 127 | value = Math.round(value); 128 | } 129 | 130 | if (Array.isArray(criterium)) { 131 | return isInRange(value, criterium[0], criterium[1]); 132 | } else if (!isNaN(criterium)) { 133 | return value === criterium; 134 | } else { 135 | return false; 136 | } 137 | }, 138 | ); 139 | }); 140 | 141 | if (matchesEveryCriteria) { 142 | return [...new Set([...rem, ...current[scope]])]; 143 | } else { 144 | return rem; 145 | } 146 | }, []); 147 | 148 | if (randomize) { 149 | return randomizeArr(words).slice(0, wordLimit); 150 | } 151 | 152 | return words.slice(0, wordLimit); 153 | } 154 | 155 | get descriptiveWords() { 156 | return this.#getWords("descriptive"); 157 | } 158 | 159 | get nouns() { 160 | return this.#getWords("nouns"); 161 | } 162 | 163 | get meanings() { 164 | return this.#getWords("meanings"); 165 | } 166 | 167 | get usage() { 168 | return this.#getWords("usage"); 169 | } 170 | 171 | /** 172 | * @returns {string} a description of the color 173 | */ 174 | get description() { 175 | return this.#getWords("description"); 176 | } 177 | 178 | get bestContrast() { 179 | return wcagContrast(this.color, "black") > wcagContrast(this.color, "white") 180 | ? "black" 181 | : "white"; 182 | } 183 | 184 | /** 185 | * @param {Boolean} random randomizes sentence of descriptive 186 | * @param {Integer} limit maximum descriptive to return 187 | * @returns {String} descriptive describing the color 188 | */ 189 | getDescriptiveList(random, limit) { 190 | let arr = [...this.descriptiveWords]; 191 | 192 | if (random) { 193 | arr = randomizeArr(arr); 194 | } 195 | 196 | if (limit) { 197 | arr = arr.slice(0, limit); 198 | } 199 | 200 | if (arr.length > 1) { 201 | const last = arr.pop(); 202 | return `${arr.join(", ")} and ${last}`; 203 | } else { 204 | return arr[0]; 205 | } 206 | } 207 | } 208 | 209 | export default ColorDescription; 210 | -------------------------------------------------------------------------------- /src/utils.js: -------------------------------------------------------------------------------- 1 | const { round, min, max, log, floor, random } = Math; 2 | 3 | const temperature2rgb = (kelvin) => { 4 | const temp = kelvin / 100; 5 | let r, g, b; 6 | if (temp < 66) { 7 | r = 1; 8 | g = 9 | temp < 6 10 | ? 0 11 | : (-155.25485562709179 - 12 | 0.44596950469579133 * (g = temp - 2) + 13 | 104.49216199393888 * log(g)) / 14 | 255; 15 | b = 16 | temp < 20 17 | ? 0 18 | : (-254.76935184120902 + 19 | 0.8274096064007395 * (b = temp - 10) + 20 | 115.67994401066147 * log(b)) / 21 | 255; 22 | } else { 23 | r = 24 | (351.97690566805693 + 25 | 0.114206453784165 * (r = temp - 55) - 26 | 40.25366309332127 * log(r)) / 27 | 255; 28 | g = 29 | (325.4494125711974 + 30 | 0.07943456536662342 * (g = temp - 50) - 31 | 28.0852963507957 * log(g)) / 32 | 255; 33 | b = 1; 34 | } 35 | return { 36 | r: max(0, min(1, r)), 37 | g: max(0, min(1, g)), 38 | b: max(0, min(1, b)), 39 | a: 1, 40 | }; 41 | }; 42 | 43 | /** chroma-js temperature function */ 44 | export const rgb2temperature = (rgb) => { 45 | const { r, g, b } = rgb; 46 | let minTemp = 1000; 47 | let maxTemp = 40000; 48 | const eps = 0.4; 49 | let temp; 50 | while (maxTemp - minTemp > eps) { 51 | temp = (maxTemp + minTemp) * 0.5; 52 | const rgbFromTemp = temperature2rgb(temp); 53 | if (rgbFromTemp.b / rgbFromTemp.r >= b / r) { 54 | maxTemp = temp; 55 | } else { 56 | minTemp = temp; 57 | } 58 | } 59 | return round(temp); 60 | }; 61 | 62 | export const isInRange = (x, rMin, rMax) => x >= rMin && x <= rMax; 63 | 64 | export const randomizeArr = (arr) => { 65 | let newArr = [...arr]; 66 | for (let i = newArr.length - 1; i > 0; i--) { 67 | const j = floor(random() * (i + 1)); 68 | [newArr[i], newArr[j]] = [newArr[j], newArr[i]]; 69 | } 70 | return newArr; 71 | }; 72 | 73 | export const rgbToCMYK = (rgb) => { 74 | const { r, g, b } = rgb; 75 | const k = 1 - max(r, g, b); 76 | const kInverted = 1 - k; 77 | return { 78 | mode: "cmyk", 79 | c: kInverted && (kInverted - r) / kInverted, 80 | m: kInverted && (kInverted - g) / kInverted, 81 | y: kInverted && (kInverted - b) / kInverted, 82 | k, 83 | }; 84 | }; 85 | -------------------------------------------------------------------------------- /tests/colorDescriptionLib.test.js: -------------------------------------------------------------------------------- 1 | import ColorDescription from "../src/index"; 2 | 3 | describe("ColorDescription Library", () => { 4 | let colorDesc; 5 | 6 | beforeEach(() => { 7 | colorDesc = new ColorDescription("#FF5733"); 8 | }); 9 | 10 | /* 11 | test("Constructor and color parsing", () => { 12 | expect(colorDesc.color).toBeInstanceOf(chroma); 13 | expect(colorDesc.color.hex()).toBe("#ff5733"); 14 | 15 | expect(() => new ColorDescription("not a color")).toThrow(TypeError); 16 | });*/ 17 | 18 | test("Color setter", () => { 19 | colorDesc.color = "#00FF00"; 20 | expect(colorDesc.formats.rgb.r).toBe(0); 21 | expect(colorDesc.formats.rgb.g).toBe(1); 22 | expect(colorDesc.formats.rgb.b).toBe(0); 23 | 24 | expect(() => { 25 | colorDesc.color = "invalid color"; 26 | }).toThrow(TypeError); 27 | }); 28 | 29 | test("Temperature words", () => { 30 | const tempWords = colorDesc.temperatureWords; 31 | expect(tempWords).toHaveProperty("value"); 32 | expect(tempWords).toHaveProperty("descriptive"); 33 | expect(Array.isArray(tempWords.descriptive)).toBe(true); 34 | }); 35 | 36 | test("Percentages", () => { 37 | const percentages = colorDesc.percentages(); 38 | expect(Array.isArray(percentages)).toBe(true); 39 | expect(percentages).toHaveLength(3); 40 | percentages.forEach((percent) => { 41 | expect(percent).toBeGreaterThanOrEqual(0); 42 | expect(percent).toBeLessThanOrEqual(1); 43 | }); 44 | }); 45 | 46 | test("Percentage words", () => { 47 | const percentWords = colorDesc.percentageWords(); 48 | expect(Array.isArray(percentWords)).toBe(true); 49 | expect(percentWords).toHaveLength(3); 50 | percentWords.forEach((word) => { 51 | expect(typeof word).toBe("string"); 52 | }); 53 | }); 54 | 55 | test("Descriptive words", () => { 56 | const descriptiveWords = colorDesc.descriptiveWords; 57 | expect(Array.isArray(descriptiveWords)).toBe(true); 58 | descriptiveWords.forEach((word) => { 59 | expect(typeof word).toBe("string"); 60 | }); 61 | }); 62 | 63 | test("Nouns", () => { 64 | const nouns = colorDesc.nouns; 65 | expect(Array.isArray(nouns)).toBe(true); 66 | nouns.forEach((noun) => { 67 | expect(typeof noun).toBe("string"); 68 | }); 69 | }); 70 | 71 | test("Meanings", () => { 72 | const meanings = colorDesc.meanings; 73 | expect(Array.isArray(meanings)).toBe(true); 74 | meanings.forEach((meaning) => { 75 | expect(typeof meaning).toBe("string"); 76 | }); 77 | }); 78 | 79 | test("Usage", () => { 80 | const usage = colorDesc.usage; 81 | expect(Array.isArray(usage)).toBe(true); 82 | usage.forEach((use) => { 83 | expect(typeof use).toBe("string"); 84 | }); 85 | }); 86 | 87 | test("Description", () => { 88 | const description = colorDesc.description; 89 | expect(Array.isArray(description)).toBe(true); 90 | expect(description.length).toBeGreaterThanOrEqual(1); 91 | description.forEach((desc) => { 92 | expect(typeof desc).toBe("string"); 93 | }); 94 | }); 95 | 96 | test("Best contrast", () => { 97 | const contrast = colorDesc.bestContrast; 98 | expect(contrast).toMatch(/^(black|white)$/); 99 | }); 100 | 101 | test("Get descriptive list", () => { 102 | const list = colorDesc.getDescriptiveList(false, 3); 103 | expect(typeof list).toBe("string"); 104 | expect(list.split(",").length).toBeLessThanOrEqual(3); 105 | }); 106 | 107 | test("Get descriptive list with randomization", () => { 108 | const list1 = colorDesc.getDescriptiveList(true, 5); 109 | const list2 = colorDesc.getDescriptiveList(true, 5); 110 | expect(list1).not.toBe(list2); // This might occasionally fail due to randomness 111 | }); 112 | }); 113 | -------------------------------------------------------------------------------- /tests/test.js: -------------------------------------------------------------------------------- 1 | import ColorDescription from "../src/index"; 2 | 3 | test("parses color corectly", () => { 4 | const cd = new ColorDescription("red"); 5 | 6 | expect(cd).toHaveProperty("formats"); 7 | expect(cd.formats.rgb.r).toBe(1); 8 | expect(cd.formats.rgb.g).toBe(0); 9 | expect(cd.formats.rgb.b).toBe(0); 10 | }); 11 | 12 | test("get adjectives for color temperature", () => { 13 | const cd = new ColorDescription("red"); 14 | 15 | expect(cd).toHaveProperty("temperatureWords"); 16 | expect(cd.temperatureWords.descriptive[0]).toBe("ultra warm"); 17 | }); 18 | 19 | test("gets fancy HSL Descriptions", () => { 20 | const cd = new ColorDescription("white"); 21 | 22 | expect(cd).toHaveProperty("descriptiveWords"); 23 | expect(cd.descriptiveWords.length).toBeGreaterThan(0); 24 | }); 25 | 26 | test("gets a maximum of 2 Descriptions", () => { 27 | const cd = new ColorDescription("white"); 28 | 29 | expect(cd).toHaveProperty("getDescriptiveList"); 30 | expect(cd.getDescriptiveList(false, 2).length).toBeGreaterThan(0); 31 | expect(cd.getDescriptiveList(false, 2).split(" and ").length).toBe(2); 32 | }); 33 | 34 | test("getting RGB in percentage of the whole color", () => { 35 | const cd = new ColorDescription("#ffffff"); 36 | 37 | expect(cd).toHaveProperty("percentages"); 38 | expect(cd.percentages()[0]).toBeGreaterThan(0.3); 39 | expect(cd.percentages()[1]).toBeGreaterThan(0.3); 40 | expect(cd.percentages()[2]).toBeGreaterThan(0.3); 41 | 42 | cd.color = "#ff0000"; 43 | expect(cd.percentages()[0]).toBe(1); 44 | }); 45 | 46 | test("get general color adjectives", () => { 47 | const cd = new ColorDescription("#ffffff"); 48 | 49 | expect(cd).toHaveProperty("percentages"); 50 | expect(cd.percentages()[0]).toBeGreaterThan(0.3); 51 | expect(cd.percentages()[1]).toBeGreaterThan(0.3); 52 | expect(cd.percentages()[2]).toBeGreaterThan(0.3); 53 | 54 | cd.color = "#ff0000"; 55 | expect(cd.percentages()[0]).toBe(1); 56 | }); 57 | 58 | test("get best contrast color, using WCAG formula", () => { 59 | // test data from https://webaim.org/resources/contrastchecker/ 60 | const cd = new ColorDescription("#0000ff"); 61 | 62 | expect(cd).toHaveProperty("bestContrast"); 63 | expect(cd.bestContrast).toBe("white"); 64 | }); 65 | --------------------------------------------------------------------------------