@sardine/colour 2.0.1 → 2.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/tests/CIEDE2000.test.js +2 -0
- package/dist/cjs/tests/CIEDE2000.test.js.map +1 -0
- package/dist/cjs/tests/assertions.test.js +2 -0
- package/dist/cjs/tests/assertions.test.js.map +1 -0
- package/dist/cjs/tests/convertCSSRGBtoHex.test.js +2 -0
- package/dist/cjs/tests/convertCSSRGBtoHex.test.js.map +1 -0
- package/dist/cjs/tests/convertCSSRGBtoRGB.test.js +2 -0
- package/dist/cjs/tests/convertCSSRGBtoRGB.test.js.map +1 -0
- package/dist/cjs/tests/convertHextoRGB.test.js +2 -0
- package/dist/cjs/tests/convertHextoRGB.test.js.map +1 -0
- package/dist/cjs/tests/convertNamedCSSColourtoHex.test.js +2 -0
- package/dist/cjs/tests/convertNamedCSSColourtoHex.test.js.map +1 -0
- package/dist/cjs/tests/convertRGBtoHex.test.js +2 -0
- package/dist/cjs/tests/convertRGBtoHex.test.js.map +1 -0
- package/dist/cjs/tests/convertRGBtoLab.test.js +2 -0
- package/dist/cjs/tests/convertRGBtoLab.test.js.map +1 -0
- package/dist/cjs/tests/convertRGBtoXYZ.test.js +2 -0
- package/dist/cjs/tests/convertRGBtoXYZ.test.js.map +1 -0
- package/dist/cjs/tests/convertXYZtoLab.test.js +2 -0
- package/dist/cjs/tests/convertXYZtoLab.test.js.map +1 -0
- package/dist/cjs/tests/getLuminance.test.js +2 -0
- package/dist/cjs/tests/getLuminance.test.js.map +1 -0
- package/dist/cjs/tests/isCSSNameDarkColour.test.js +2 -0
- package/dist/cjs/tests/isCSSNameDarkColour.test.js.map +1 -0
- package/dist/cjs/tests/isCSSRGBDarkColour.test.js +2 -0
- package/dist/cjs/tests/isCSSRGBDarkColour.test.js.map +1 -0
- package/dist/cjs/tests/isDarkColour.test.js +2 -0
- package/dist/cjs/tests/isDarkColour.test.js.map +1 -0
- package/dist/cjs/tests/isHexDarkColour.test.js +2 -0
- package/dist/cjs/tests/isHexDarkColour.test.js.map +1 -0
- package/dist/cjs/tests/pickColourContrast.test.js +2 -0
- package/dist/cjs/tests/pickColourContrast.test.js.map +1 -0
- package/dist/cjs/tests/util.test.js +2 -0
- package/dist/cjs/tests/util.test.js.map +1 -0
- package/dist/cjs/types.js +2 -0
- package/dist/cjs/types.js.map +1 -0
- package/package.json +5 -5
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});const _ava=_interop_require_default(require("ava"));const _CIEDE2000=require("../CIEDE2000.js");function _interop_require_default(obj){return obj&&obj.__esModule?obj:{default:obj}}(0,_ava.default)("mesures colour difference #1",({is})=>{const colour1={L:50,a:2.6772,b:-79.7751};const colour2={L:50,a:0,b:-82.7485};is((0,_CIEDE2000.ciede2000)(colour1,colour2),2.0424596801565738)});(0,_ava.default)("mesures colour difference #2",({is})=>{const colour1={L:60.2574,a:-34.0099,b:36.2677};const colour2={L:60.4626,a:-34.1751,b:39.4387};is((0,_CIEDE2000.ciede2000)(colour1,colour2),1.2644200135991919)});(0,_ava.default)("mesures colour difference #3",({is})=>{const colour1={L:50,a:2.5,b:0};const colour2={L:58,a:24,b:15};is((0,_CIEDE2000.ciede2000)(colour1,colour2),19.453521433392584)});(0,_ava.default)("mesures colour difference #4",({is})=>{const colour1={L:50,a:2.5,b:0};const colour2={L:50,a:3.25917204763466,b:.334992094209014};is((0,_CIEDE2000.ciede2000)(colour1,colour2),.9999999764765461)});(0,_ava.default)("mesures colour difference #5",({is})=>{const colour1={L:90.9257,a:-.5406,b:-.9208};const colour2={L:88.6381,a:-.8985,b:-.7239};is((0,_CIEDE2000.ciede2000)(colour1,colour2).toFixed(4),"1.5381")});
|
|
2
|
+
//# sourceMappingURL=CIEDE2000.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/tests/CIEDE2000.test.ts"],"sourcesContent":["import test from \"ava\";\nimport { ciede2000 } from \"../CIEDE2000.js\";\nimport type { LabColour } from \"../types.js\";\n\n/*\n * Test data provided by Gaurav Sharma\n * http://www2.ece.rochester.edu/~gsharma/ciede2000/dataNprograms/ciede2000testdata.txt\n */\n\ntest(\"mesures colour difference #1\", ({ is }) => {\n\tconst colour1: LabColour = {\n\t\tL: 50.0,\n\t\ta: 2.6772,\n\t\tb: -79.7751,\n\t};\n\n\tconst colour2: LabColour = {\n\t\tL: 50.0,\n\t\ta: 0.0,\n\t\tb: -82.7485,\n\t};\n\tis(ciede2000(colour1, colour2), 2.0424596801565738);\n});\n\ntest(\"mesures colour difference #2\", ({ is }) => {\n\tconst colour1: LabColour = {\n\t\tL: 60.2574,\n\t\ta: -34.0099,\n\t\tb: 36.2677,\n\t};\n\n\tconst colour2: LabColour = {\n\t\tL: 60.4626,\n\t\ta: -34.1751,\n\t\tb: 39.4387,\n\t};\n\tis(ciede2000(colour1, colour2), 1.2644200135991919);\n});\n\ntest(\"mesures colour difference #3\", ({ is }) => {\n\tconst colour1: LabColour = {\n\t\tL: 50,\n\t\ta: 2.5,\n\t\tb: 0,\n\t};\n\n\tconst colour2: LabColour = {\n\t\tL: 58,\n\t\ta: 24,\n\t\tb: 15,\n\t};\n\tis(ciede2000(colour1, colour2), 19.453521433392584);\n});\n\ntest(\"mesures colour difference #4\", ({ is }) => {\n\tconst colour1: LabColour = {\n\t\tL: 50,\n\t\ta: 2.5,\n\t\tb: 0,\n\t};\n\n\tconst colour2: LabColour = {\n\t\tL: 50,\n\t\ta: 3.25917204763466,\n\t\tb: 0.334992094209014,\n\t};\n\tis(ciede2000(colour1, colour2), 0.9999999764765461);\n});\n\ntest(\"mesures colour difference #5\", ({ is }) => {\n\tconst colour1: LabColour = {\n\t\tL: 90.9257,\n\t\ta: -0.5406,\n\t\tb: -0.9208,\n\t};\n\n\tconst colour2: LabColour = {\n\t\tL: 88.6381,\n\t\ta: -0.8985,\n\t\tb: -0.7239,\n\t};\n\tis(ciede2000(colour1, colour2).toFixed(4), \"1.5381\");\n});\n"],"names":["test","is","colour1","L","a","b","colour2","ciede2000","toFixed"],"mappings":"kHAAiB,iCACS,uGAQ1BA,GAAAA,YAAI,EAAC,+BAAgC,CAAC,CAAEC,EAAE,CAAE,IAC3C,MAAMC,QAAqB,CAC1BC,EAAG,GACHC,EAAG,OACHC,EAAG,CAAC,OACL,EAEA,MAAMC,QAAqB,CAC1BH,EAAG,GACHC,EAAG,EACHC,EAAG,CAAC,OACL,EACAJ,GAAGM,GAAAA,oBAAS,EAACL,QAASI,SAAU,mBACjC,GAEAN,GAAAA,YAAI,EAAC,+BAAgC,CAAC,CAAEC,EAAE,CAAE,IAC3C,MAAMC,QAAqB,CAC1BC,EAAG,QACHC,EAAG,CAAC,QACJC,EAAG,OACJ,EAEA,MAAMC,QAAqB,CAC1BH,EAAG,QACHC,EAAG,CAAC,QACJC,EAAG,OACJ,EACAJ,GAAGM,GAAAA,oBAAS,EAACL,QAASI,SAAU,mBACjC,GAEAN,GAAAA,YAAI,EAAC,+BAAgC,CAAC,CAAEC,EAAE,CAAE,IAC3C,MAAMC,QAAqB,CAC1BC,EAAG,GACHC,EAAG,IACHC,EAAG,CACJ,EAEA,MAAMC,QAAqB,CAC1BH,EAAG,GACHC,EAAG,GACHC,EAAG,EACJ,EACAJ,GAAGM,GAAAA,oBAAS,EAACL,QAASI,SAAU,mBACjC,GAEAN,GAAAA,YAAI,EAAC,+BAAgC,CAAC,CAAEC,EAAE,CAAE,IAC3C,MAAMC,QAAqB,CAC1BC,EAAG,GACHC,EAAG,IACHC,EAAG,CACJ,EAEA,MAAMC,QAAqB,CAC1BH,EAAG,GACHC,EAAG,iBACHC,EAAG,gBACJ,EACAJ,GAAGM,GAAAA,oBAAS,EAACL,QAASI,SAAU,kBACjC,GAEAN,GAAAA,YAAI,EAAC,+BAAgC,CAAC,CAAEC,EAAE,CAAE,IAC3C,MAAMC,QAAqB,CAC1BC,EAAG,QACHC,EAAG,CAAC,MACJC,EAAG,CAAC,KACL,EAEA,MAAMC,QAAqB,CAC1BH,EAAG,QACHC,EAAG,CAAC,MACJC,EAAG,CAAC,KACL,EACAJ,GAAGM,GAAAA,oBAAS,EAACL,QAASI,SAASE,OAAO,CAAC,GAAI,SAC5C"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});const _ava=_interop_require_default(require("ava"));const _assertions=require("../assertions.js");function _interop_require_default(obj){return obj&&obj.__esModule?obj:{default:obj}}(0,_ava.default)("assert true if string is in the CSS RGB format",({is})=>{is((0,_assertions.isCSSRGBColour)("rgb(12, 23, 111)"),true)});(0,_ava.default)("assert false if string is not in the CSS RGB format",({is})=>{is((0,_assertions.isCSSRGBColour)("zzz( 23, 111, 87)"),false)});_ava.default.skip("assert false if string doesn't have 3 colour values",({is})=>{is((0,_assertions.isCSSRGBColour)("rgb( 23, 111)"),false)});(0,_ava.default)("assert true if string is a short hexadecimal colour",({is})=>{is((0,_assertions.isHexColour)("#333"),true)});(0,_ava.default)("assert true if string is a six digital hexadecimal colour",({is})=>{is((0,_assertions.isHexColour)("#333000"),true)});(0,_ava.default)("assert true if string is a short hexadecimal colour with alpha",({is})=>{is((0,_assertions.isHexColour)("#333f"),true)});(0,_ava.default)("assert true if string is an hexadecimal colour with alpha",({is})=>{is((0,_assertions.isHexColour)("#333000ff"),true)});(0,_ava.default)("assert false if string is not a valid hexadecimal colour",({is})=>{is((0,_assertions.isHexColour)("#333HH0ff"),false)});
|
|
2
|
+
//# sourceMappingURL=assertions.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/tests/assertions.test.ts"],"sourcesContent":["import test from \"ava\";\nimport { isCSSRGBColour, isHexColour } from \"../assertions.js\";\n\ntest(\"assert true if string is in the CSS RGB format\", ({ is }) => {\n\tis(isCSSRGBColour(\"rgb(12, 23, 111)\"), true);\n});\n\ntest(\"assert false if string is not in the CSS RGB format\", ({ is }) => {\n\tis(isCSSRGBColour(\"zzz( 23, 111, 87)\"), false);\n});\n\ntest.skip(\"assert false if string doesn't have 3 colour values\", ({ is }) => {\n\tis(isCSSRGBColour(\"rgb( 23, 111)\"), false);\n});\n\ntest(\"assert true if string is a short hexadecimal colour\", ({ is }) => {\n\tis(isHexColour(\"#333\"), true);\n});\n\ntest(\"assert true if string is a six digital hexadecimal colour\", ({ is }) => {\n\tis(isHexColour(\"#333000\"), true);\n});\n\ntest(\"assert true if string is a short hexadecimal colour with alpha\", ({\n\tis,\n}) => {\n\tis(isHexColour(\"#333f\"), true);\n});\n\ntest(\"assert true if string is an hexadecimal colour with alpha\", ({ is }) => {\n\tis(isHexColour(\"#333000ff\"), true);\n});\n\ntest(\"assert false if string is not a valid hexadecimal colour\", ({ is }) => {\n\tis(isHexColour(\"#333HH0ff\"), false);\n});\n"],"names":["test","is","isCSSRGBColour","skip","isHexColour"],"mappings":"kHAAiB,kCAC2B,wGAE5CA,GAAAA,YAAI,EAAC,iDAAkD,CAAC,CAAEC,EAAE,CAAE,IAC7DA,GAAGC,GAAAA,0BAAc,EAAC,oBAAqB,KACxC,GAEAF,GAAAA,YAAI,EAAC,sDAAuD,CAAC,CAAEC,EAAE,CAAE,IAClEA,GAAGC,GAAAA,0BAAc,EAAC,qBAAsB,MACzC,GAEAF,YAAI,CAACG,IAAI,CAAC,sDAAuD,CAAC,CAAEF,EAAE,CAAE,IACvEA,GAAGC,GAAAA,0BAAc,EAAC,iBAAkB,MACrC,GAEAF,GAAAA,YAAI,EAAC,sDAAuD,CAAC,CAAEC,EAAE,CAAE,IAClEA,GAAGG,GAAAA,uBAAW,EAAC,QAAS,KACzB,GAEAJ,GAAAA,YAAI,EAAC,4DAA6D,CAAC,CAAEC,EAAE,CAAE,IACxEA,GAAGG,GAAAA,uBAAW,EAAC,WAAY,KAC5B,GAEAJ,GAAAA,YAAI,EAAC,iEAAkE,CAAC,CACvEC,EAAE,CACF,IACAA,GAAGG,GAAAA,uBAAW,EAAC,SAAU,KAC1B,GAEAJ,GAAAA,YAAI,EAAC,4DAA6D,CAAC,CAAEC,EAAE,CAAE,IACxEA,GAAGG,GAAAA,uBAAW,EAAC,aAAc,KAC9B,GAEAJ,GAAAA,YAAI,EAAC,2DAA4D,CAAC,CAAEC,EAAE,CAAE,IACvEA,GAAGG,GAAAA,uBAAW,EAAC,aAAc,MAC9B"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});const _ava=_interop_require_default(require("ava"));const _convertCSSRGBtoHex=require("../convertCSSRGBtoHex.js");function _interop_require_default(obj){return obj&&obj.__esModule?obj:{default:obj}}(0,_ava.default)("converts CSS RGB format to hexadecimal colour",({is})=>{const expectedHex="#ffffff";const RGB="rgb(255,255,255)";is((0,_convertCSSRGBtoHex.convertCSSRGBtoHex)(RGB),expectedHex)});(0,_ava.default)("converts CSS RGBA format to hexadecimal colour with alpha channel",({is})=>{const expectedHex="#ffffff80";const RGBA="rgba(255,255,255,0.5)";is((0,_convertCSSRGBtoHex.convertCSSRGBtoHex)(RGBA),expectedHex)});(0,_ava.default)("converts CSS RGBA format to hexadecimal colour with short alpha channel",({is})=>{const expectedHex="#ffffff80";const RGBA="rgba(255,255,255,.5)";is((0,_convertCSSRGBtoHex.convertCSSRGBtoHex)(RGBA),expectedHex)});(0,_ava.default)("converts CSS RGB format to hexadecimal colour but clamps max channel value at 255",({is})=>{const expectedHex="#ffffff";const RGBA="rgba(300,500,900)";is((0,_convertCSSRGBtoHex.convertCSSRGBtoHex)(RGBA),expectedHex)});(0,_ava.default)("converts CSS RGB format to hexadecimal colour but clamps min channel value at 0",({is})=>{const expectedHex="#000000";const RGB="rgb(-300,-500,-900)";is((0,_convertCSSRGBtoHex.convertCSSRGBtoHex)(RGB),expectedHex)});(0,_ava.default)("converts CSS RGB with space separated values to hexadecimal colour",({is})=>{const expectedHex="#ffffff";const RGB="rgb(255 255 255)";is((0,_convertCSSRGBtoHex.convertCSSRGBtoHex)(RGB),expectedHex)});(0,_ava.default)("converts CSS RGBA with space separated values and forward slash for the alpha channel to hexadecimal colour",({is})=>{const expectedHex="#ffffff80";const RGBA="rgba(255 255 255 / 0.5)";is((0,_convertCSSRGBtoHex.convertCSSRGBtoHex)(RGBA),expectedHex)});(0,_ava.default)("throws an error if not passing a valid CSS RGB format",({is,throws})=>{const rgb="rfv(12,23,42)";const error=throws(()=>(0,_convertCSSRGBtoHex.convertCSSRGBtoHex)(rgb));is(error.message,"convertCSSRGBtoHex expects a valid CSS RGB string but got rfv(12,23,42)")});
|
|
2
|
+
//# sourceMappingURL=convertCSSRGBtoHex.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/tests/convertCSSRGBtoHex.test.ts"],"sourcesContent":["import test from \"ava\";\nimport { convertCSSRGBtoHex } from \"../convertCSSRGBtoHex.js\";\n\ntest(\"converts CSS RGB format to hexadecimal colour\", ({ is }) => {\n\tconst expectedHex = \"#ffffff\";\n\tconst RGB = \"rgb(255,255,255)\";\n\tis(convertCSSRGBtoHex(RGB), expectedHex);\n});\n\ntest(\"converts CSS RGBA format to hexadecimal colour with alpha channel\", ({\n\tis,\n}) => {\n\tconst expectedHex = \"#ffffff80\";\n\tconst RGBA = \"rgba(255,255,255,0.5)\";\n\tis(convertCSSRGBtoHex(RGBA), expectedHex);\n});\n\ntest(\"converts CSS RGBA format to hexadecimal colour with short alpha channel\", ({\n\tis,\n}) => {\n\tconst expectedHex = \"#ffffff80\";\n\tconst RGBA = \"rgba(255,255,255,.5)\";\n\tis(convertCSSRGBtoHex(RGBA), expectedHex);\n});\n\ntest(\"converts CSS RGB format to hexadecimal colour but clamps max channel value at 255\", ({\n\tis,\n}) => {\n\tconst expectedHex = \"#ffffff\";\n\tconst RGBA = \"rgba(300,500,900)\";\n\tis(convertCSSRGBtoHex(RGBA), expectedHex);\n});\n\ntest(\"converts CSS RGB format to hexadecimal colour but clamps min channel value at 0\", ({\n\tis,\n}) => {\n\tconst expectedHex = \"#000000\";\n\tconst RGB = \"rgb(-300,-500,-900)\";\n\tis(convertCSSRGBtoHex(RGB), expectedHex);\n});\n\ntest(\"converts CSS RGB with space separated values to hexadecimal colour\", ({\n\tis,\n}) => {\n\tconst expectedHex = \"#ffffff\";\n\tconst RGB = \"rgb(255 255 255)\";\n\tis(convertCSSRGBtoHex(RGB), expectedHex);\n});\n\ntest(\"converts CSS RGBA with space separated values and forward slash for the alpha channel to hexadecimal colour\", ({\n\tis,\n}) => {\n\tconst expectedHex = \"#ffffff80\";\n\tconst RGBA = \"rgba(255 255 255 / 0.5)\";\n\tis(convertCSSRGBtoHex(RGBA), expectedHex);\n});\n\ntest(\"throws an error if not passing a valid CSS RGB format\", ({\n\tis,\n\tthrows,\n}) => {\n\tconst rgb = \"rfv(12,23,42)\";\n\tconst error = throws(() => convertCSSRGBtoHex(rgb)) as Error;\n\tis(\n\t\terror.message,\n\t\t\"convertCSSRGBtoHex expects a valid CSS RGB string but got rfv(12,23,42)\",\n\t);\n});\n"],"names":["test","is","expectedHex","RGB","convertCSSRGBtoHex","RGBA","throws","rgb","error","message"],"mappings":"kHAAiB,0CACkB,gHAEnCA,GAAAA,YAAI,EAAC,gDAAiD,CAAC,CAAEC,EAAE,CAAE,IAC5D,MAAMC,YAAc,UACpB,MAAMC,IAAM,mBACZF,GAAGG,GAAAA,sCAAkB,EAACD,KAAMD,YAC7B,GAEAF,GAAAA,YAAI,EAAC,oEAAqE,CAAC,CAC1EC,EAAE,CACF,IACA,MAAMC,YAAc,YACpB,MAAMG,KAAO,wBACbJ,GAAGG,GAAAA,sCAAkB,EAACC,MAAOH,YAC9B,GAEAF,GAAAA,YAAI,EAAC,0EAA2E,CAAC,CAChFC,EAAE,CACF,IACA,MAAMC,YAAc,YACpB,MAAMG,KAAO,uBACbJ,GAAGG,GAAAA,sCAAkB,EAACC,MAAOH,YAC9B,GAEAF,GAAAA,YAAI,EAAC,oFAAqF,CAAC,CAC1FC,EAAE,CACF,IACA,MAAMC,YAAc,UACpB,MAAMG,KAAO,oBACbJ,GAAGG,GAAAA,sCAAkB,EAACC,MAAOH,YAC9B,GAEAF,GAAAA,YAAI,EAAC,kFAAmF,CAAC,CACxFC,EAAE,CACF,IACA,MAAMC,YAAc,UACpB,MAAMC,IAAM,sBACZF,GAAGG,GAAAA,sCAAkB,EAACD,KAAMD,YAC7B,GAEAF,GAAAA,YAAI,EAAC,qEAAsE,CAAC,CAC3EC,EAAE,CACF,IACA,MAAMC,YAAc,UACpB,MAAMC,IAAM,mBACZF,GAAGG,GAAAA,sCAAkB,EAACD,KAAMD,YAC7B,GAEAF,GAAAA,YAAI,EAAC,8GAA+G,CAAC,CACpHC,EAAE,CACF,IACA,MAAMC,YAAc,YACpB,MAAMG,KAAO,0BACbJ,GAAGG,GAAAA,sCAAkB,EAACC,MAAOH,YAC9B,GAEAF,GAAAA,YAAI,EAAC,wDAAyD,CAAC,CAC9DC,EAAE,CACFK,MAAM,CACN,IACA,MAAMC,IAAM,gBACZ,MAAMC,MAAQF,OAAO,IAAMF,GAAAA,sCAAkB,EAACG,MAC9CN,GACCO,MAAMC,OAAO,CACb,0EAEF"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});const _ava=_interop_require_default(require("ava"));const _convertCSSRGBtoRGB=require("../convertCSSRGBtoRGB.js");function _interop_require_default(obj){return obj&&obj.__esModule?obj:{default:obj}}(0,_ava.default)("convert CSS RGB separated by spaces",({deepEqual})=>{deepEqual((0,_convertCSSRGBtoRGB.convertCSSRGBtoRGB)("rgb( 23, 111, 99)"),{R:23,G:111,B:99,A:undefined})});
|
|
2
|
+
//# sourceMappingURL=convertCSSRGBtoRGB.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/tests/convertCSSRGBtoRGB.test.ts"],"sourcesContent":["import test from \"ava\";\nimport { convertCSSRGBtoRGB } from \"../convertCSSRGBtoRGB.js\";\n\ntest(\"convert CSS RGB separated by spaces\", ({ deepEqual }) => {\n\tdeepEqual(convertCSSRGBtoRGB(\"rgb( 23, 111, 99)\"), {\n\t\tR: 23,\n\t\tG: 111,\n\t\tB: 99,\n\t\tA: undefined,\n\t});\n});\n"],"names":["test","deepEqual","convertCSSRGBtoRGB","R","G","B","A","undefined"],"mappings":"kHAAiB,0CACkB,gHAEnCA,GAAAA,YAAI,EAAC,sCAAuC,CAAC,CAAEC,SAAS,CAAE,IACzDA,UAAUC,GAAAA,sCAAkB,EAAC,qBAAsB,CAClDC,EAAG,GACHC,EAAG,IACHC,EAAG,GACHC,EAAGC,SACJ,EACD"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});const _ava=_interop_require_default(require("ava"));const _convertHextoRGB=require("../convertHextoRGB.js");function _interop_require_default(obj){return obj&&obj.__esModule?obj:{default:obj}}(0,_ava.default)("converts a 6 digit hexadecimal colour string to RGB format",({deepEqual})=>{const hex="#ffffff";const expectedRGB={R:255,G:255,B:255};deepEqual((0,_convertHextoRGB.convertHextoRGB)(hex),expectedRGB)});(0,_ava.default)("converts a 3 digit hexadecimal colour string to RGB format",({deepEqual})=>{const hex="#fff";const expectedRGB={R:255,G:255,B:255};deepEqual((0,_convertHextoRGB.convertHextoRGB)(hex),expectedRGB)});(0,_ava.default)("converts a 8 digit hexadecimal (RGB + Alpha) colour string to RGBA format",({deepEqual})=>{const hex="#ffffffff";const expectedRGB={R:255,G:255,B:255,A:1};deepEqual((0,_convertHextoRGB.convertHextoRGB)(hex),expectedRGB)});(0,_ava.default)("converts a 4 digit hexadecimal (RGB + Alpha) colour string to RGBA format",({deepEqual})=>{const hex="#ffff";const expectedRGB={R:255,G:255,B:255,A:1};deepEqual((0,_convertHextoRGB.convertHextoRGB)(hex),expectedRGB)});(0,_ava.default)("throws an error if not passing a string",({is,throws})=>{const hex=235434;const error=throws(()=>(0,_convertHextoRGB.convertHextoRGB)(hex));is(error.message,"convertHextoRGB expects a string but got a number")});(0,_ava.default)("throws an error if not passing a valid hexadecimal value",({is,throws})=>{const hex="HH77ZZs";const error=throws(()=>(0,_convertHextoRGB.convertHextoRGB)(hex));is(error.message,"convertHextoRGB expects an valid hexadecimal colour value but got HH77ZZs")});
|
|
2
|
+
//# sourceMappingURL=convertHextoRGB.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/tests/convertHextoRGB.test.ts"],"sourcesContent":["import test from \"ava\";\nimport { convertHextoRGB } from \"../convertHextoRGB.js\";\nimport type { RGBColour } from \"../types.js\";\n\ntest(\"converts a 6 digit hexadecimal colour string to RGB format\", ({\n\tdeepEqual,\n}) => {\n\tconst hex = \"#ffffff\";\n\tconst expectedRGB: RGBColour = {\n\t\tR: 255,\n\t\tG: 255,\n\t\tB: 255,\n\t};\n\tdeepEqual(convertHextoRGB(hex), expectedRGB);\n});\n\ntest(\"converts a 3 digit hexadecimal colour string to RGB format\", ({\n\tdeepEqual,\n}) => {\n\tconst hex = \"#fff\";\n\tconst expectedRGB: RGBColour = {\n\t\tR: 255,\n\t\tG: 255,\n\t\tB: 255,\n\t};\n\tdeepEqual(convertHextoRGB(hex), expectedRGB);\n});\n\ntest(\"converts a 8 digit hexadecimal (RGB + Alpha) colour string to RGBA format\", ({\n\tdeepEqual,\n}) => {\n\tconst hex = \"#ffffffff\";\n\tconst expectedRGB: RGBColour = {\n\t\tR: 255,\n\t\tG: 255,\n\t\tB: 255,\n\t\tA: 1,\n\t};\n\tdeepEqual(convertHextoRGB(hex), expectedRGB);\n});\n\ntest(\"converts a 4 digit hexadecimal (RGB + Alpha) colour string to RGBA format\", ({\n\tdeepEqual,\n}) => {\n\tconst hex = \"#ffff\";\n\tconst expectedRGB: RGBColour = {\n\t\tR: 255,\n\t\tG: 255,\n\t\tB: 255,\n\t\tA: 1,\n\t};\n\tdeepEqual(convertHextoRGB(hex), expectedRGB);\n});\n\ntest(\"throws an error if not passing a string\", ({ is, throws }) => {\n\tconst hex = 235434;\n\t// @ts-ignore: Passing wrong type for test only\n\tconst error = throws(() => convertHextoRGB(hex)) as Error;\n\tis(error.message, \"convertHextoRGB expects a string but got a number\");\n});\n\ntest(\"throws an error if not passing a valid hexadecimal value\", ({\n\tis,\n\tthrows,\n}) => {\n\tconst hex = \"HH77ZZs\";\n\tconst error = throws(() => convertHextoRGB(hex)) as Error;\n\tis(\n\t\terror.message,\n\t\t\"convertHextoRGB expects an valid hexadecimal colour value but got HH77ZZs\",\n\t);\n});\n"],"names":["test","deepEqual","hex","expectedRGB","R","G","B","convertHextoRGB","A","is","throws","error","message"],"mappings":"kHAAiB,uCACe,6GAGhCA,GAAAA,YAAI,EAAC,6DAA8D,CAAC,CACnEC,SAAS,CACT,IACA,MAAMC,IAAM,UACZ,MAAMC,YAAyB,CAC9BC,EAAG,IACHC,EAAG,IACHC,EAAG,GACJ,EACAL,UAAUM,GAAAA,gCAAe,EAACL,KAAMC,YACjC,GAEAH,GAAAA,YAAI,EAAC,6DAA8D,CAAC,CACnEC,SAAS,CACT,IACA,MAAMC,IAAM,OACZ,MAAMC,YAAyB,CAC9BC,EAAG,IACHC,EAAG,IACHC,EAAG,GACJ,EACAL,UAAUM,GAAAA,gCAAe,EAACL,KAAMC,YACjC,GAEAH,GAAAA,YAAI,EAAC,4EAA6E,CAAC,CAClFC,SAAS,CACT,IACA,MAAMC,IAAM,YACZ,MAAMC,YAAyB,CAC9BC,EAAG,IACHC,EAAG,IACHC,EAAG,IACHE,EAAG,CACJ,EACAP,UAAUM,GAAAA,gCAAe,EAACL,KAAMC,YACjC,GAEAH,GAAAA,YAAI,EAAC,4EAA6E,CAAC,CAClFC,SAAS,CACT,IACA,MAAMC,IAAM,QACZ,MAAMC,YAAyB,CAC9BC,EAAG,IACHC,EAAG,IACHC,EAAG,IACHE,EAAG,CACJ,EACAP,UAAUM,GAAAA,gCAAe,EAACL,KAAMC,YACjC,GAEAH,GAAAA,YAAI,EAAC,0CAA2C,CAAC,CAAES,EAAE,CAAEC,MAAM,CAAE,IAC9D,MAAMR,IAAM,OAEZ,MAAMS,MAAQD,OAAO,IAAMH,GAAAA,gCAAe,EAACL,MAC3CO,GAAGE,MAAMC,OAAO,CAAE,oDACnB,GAEAZ,GAAAA,YAAI,EAAC,2DAA4D,CAAC,CACjES,EAAE,CACFC,MAAM,CACN,IACA,MAAMR,IAAM,UACZ,MAAMS,MAAQD,OAAO,IAAMH,GAAAA,gCAAe,EAACL,MAC3CO,GACCE,MAAMC,OAAO,CACb,4EAEF"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});const _ava=_interop_require_default(require("ava"));const _convertNamedCSSColourtoHex=require("../convertNamedCSSColourtoHex.js");function _interop_require_default(obj){return obj&&obj.__esModule?obj:{default:obj}}(0,_ava.default)("converts named CSS colour to hexadecimal colour",({is})=>{const expectedHex="#fffafa";is((0,_convertNamedCSSColourtoHex.convertNamedCSSColourtoHex)("snow"),expectedHex)});(0,_ava.default)("returns undefined if named CSS colour doesn't exist",({is})=>{const expectedHex=undefined;is((0,_convertNamedCSSColourtoHex.convertNamedCSSColourtoHex)("neve"),expectedHex)});
|
|
2
|
+
//# sourceMappingURL=convertNamedCSSColourtoHex.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/tests/convertNamedCSSColourtoHex.test.ts"],"sourcesContent":["import test from \"ava\";\nimport { convertNamedCSSColourtoHex } from \"../convertNamedCSSColourtoHex.js\";\n\ntest(\"converts named CSS colour to hexadecimal colour\", ({ is }) => {\n\tconst expectedHex = \"#fffafa\";\n\tis(convertNamedCSSColourtoHex(\"snow\"), expectedHex);\n});\n\ntest(\"returns undefined if named CSS colour doesn't exist\", ({ is }) => {\n\tconst expectedHex = undefined;\n\t/*@ts-expect-error*/\n\tis(convertNamedCSSColourtoHex(\"neve\"), expectedHex);\n});\n"],"names":["test","is","expectedHex","convertNamedCSSColourtoHex","undefined"],"mappings":"kHAAiB,kDAC0B,wHAE3CA,GAAAA,YAAI,EAAC,kDAAmD,CAAC,CAAEC,EAAE,CAAE,IAC9D,MAAMC,YAAc,UACpBD,GAAGE,GAAAA,sDAA0B,EAAC,QAASD,YACxC,GAEAF,GAAAA,YAAI,EAAC,sDAAuD,CAAC,CAAEC,EAAE,CAAE,IAClE,MAAMC,YAAcE,UAEpBH,GAAGE,GAAAA,sDAA0B,EAAC,QAASD,YACxC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});const _ava=_interop_require_default(require("ava"));const _convertRGBtoHex=require("../convertRGBtoHex.js");function _interop_require_default(obj){return obj&&obj.__esModule?obj:{default:obj}}(0,_ava.default)("converts RGB format to hexadecimal colour",({is})=>{const expectedHex="#ffffff";const RGB={R:255,G:255,B:255};is((0,_convertRGBtoHex.convertRGBtoHex)(RGB),expectedHex)});(0,_ava.default)("converts RGBA format to hexadecimal colour with alpha channel",({is})=>{const expectedHex="#ffffff80";const RGB={R:255,G:255,B:255,A:.5};is((0,_convertRGBtoHex.convertRGBtoHex)(RGB),expectedHex)});
|
|
2
|
+
//# sourceMappingURL=convertRGBtoHex.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/tests/convertRGBtoHex.test.ts"],"sourcesContent":["import test from \"ava\";\nimport { convertRGBtoHex } from \"../convertRGBtoHex.js\";\nimport type { RGBColour } from \"../types.js\";\n\ntest(\"converts RGB format to hexadecimal colour\", ({ is }) => {\n\tconst expectedHex = \"#ffffff\";\n\tconst RGB: RGBColour = {\n\t\tR: 255,\n\t\tG: 255,\n\t\tB: 255,\n\t};\n\tis(convertRGBtoHex(RGB), expectedHex);\n});\n\ntest(\"converts RGBA format to hexadecimal colour with alpha channel\", ({\n\tis,\n}) => {\n\tconst expectedHex = \"#ffffff80\";\n\tconst RGB: RGBColour = {\n\t\tR: 255,\n\t\tG: 255,\n\t\tB: 255,\n\t\tA: 0.5,\n\t};\n\tis(convertRGBtoHex(RGB), expectedHex);\n});\n"],"names":["test","is","expectedHex","RGB","R","G","B","convertRGBtoHex","A"],"mappings":"kHAAiB,uCACe,6GAGhCA,GAAAA,YAAI,EAAC,4CAA6C,CAAC,CAAEC,EAAE,CAAE,IACxD,MAAMC,YAAc,UACpB,MAAMC,IAAiB,CACtBC,EAAG,IACHC,EAAG,IACHC,EAAG,GACJ,EACAL,GAAGM,GAAAA,gCAAe,EAACJ,KAAMD,YAC1B,GAEAF,GAAAA,YAAI,EAAC,gEAAiE,CAAC,CACtEC,EAAE,CACF,IACA,MAAMC,YAAc,YACpB,MAAMC,IAAiB,CACtBC,EAAG,IACHC,EAAG,IACHC,EAAG,IACHE,EAAG,EACJ,EACAP,GAAGM,GAAAA,gCAAe,EAACJ,KAAMD,YAC1B"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});const _ava=_interop_require_default(require("ava"));const _convertRGBtoLab=require("../convertRGBtoLab.js");function _interop_require_default(obj){return obj&&obj.__esModule?obj:{default:obj}}(0,_ava.default)("converts RGB to Lab",({deepEqual})=>{const RGB={R:34,G:250,B:124};const expectedLab={L:87.07847680208145,a:-74.4060883781999,b:46.74058735821831};deepEqual((0,_convertRGBtoLab.convertRGBtoLab)(RGB),expectedLab)});
|
|
2
|
+
//# sourceMappingURL=convertRGBtoLab.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/tests/convertRGBtoLab.test.ts"],"sourcesContent":["import test from \"ava\";\nimport { convertRGBtoLab } from \"../convertRGBtoLab.js\";\nimport type { LabColour, RGBColour } from \"../types.js\";\n\ntest(\"converts RGB to Lab\", ({ deepEqual }) => {\n\tconst RGB: RGBColour = { R: 34, G: 250, B: 124 };\n\tconst expectedLab: LabColour = {\n\t\tL: 87.07847680208145,\n\t\ta: -74.4060883781999,\n\t\tb: 46.74058735821831,\n\t};\n\tdeepEqual(convertRGBtoLab(RGB), expectedLab);\n});\n"],"names":["test","deepEqual","RGB","R","G","B","expectedLab","L","a","b","convertRGBtoLab"],"mappings":"kHAAiB,uCACe,6GAGhCA,GAAAA,YAAI,EAAC,sBAAuB,CAAC,CAAEC,SAAS,CAAE,IACzC,MAAMC,IAAiB,CAAEC,EAAG,GAAIC,EAAG,IAAKC,EAAG,GAAI,EAC/C,MAAMC,YAAyB,CAC9BC,EAAG,kBACHC,EAAG,CAAC,iBACJC,EAAG,iBACJ,EACAR,UAAUS,GAAAA,gCAAe,EAACR,KAAMI,YACjC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});const _ava=_interop_require_default(require("ava"));const _convertRGBtoXYZ=require("../convertRGBtoXYZ.js");function _interop_require_default(obj){return obj&&obj.__esModule?obj:{default:obj}}(0,_ava.default)("convert RGB to XYZ",({deepEqual})=>{const RGB={R:34,G:250,B:124};const expectedXYZ={X:38.483384631576946,Y:70.16653157373521,Z:30.583997140084364};deepEqual((0,_convertRGBtoXYZ.convertRGBtoXYZ)(RGB),expectedXYZ)});(0,_ava.default)("convert RGB to XYZ with reverse transformation",({deepEqual})=>{const RGB={R:0,G:250,B:124};const expectedXYZ={X:37.82369749318333,Y:69.82645037678448,Z:30.553124293888928};deepEqual((0,_convertRGBtoXYZ.convertRGBtoXYZ)(RGB),expectedXYZ)});
|
|
2
|
+
//# sourceMappingURL=convertRGBtoXYZ.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/tests/convertRGBtoXYZ.test.ts"],"sourcesContent":["import test from \"ava\";\nimport { convertRGBtoXYZ } from \"../convertRGBtoXYZ.js\";\nimport type { RGBColour, XYZColour } from \"../types.js\";\n\ntest(\"convert RGB to XYZ\", ({ deepEqual }) => {\n\tconst RGB: RGBColour = { R: 34, G: 250, B: 124 };\n\tconst expectedXYZ: XYZColour = {\n\t\tX: 38.483384631576946,\n\t\tY: 70.16653157373521,\n\t\tZ: 30.583997140084364,\n\t};\n\tdeepEqual(convertRGBtoXYZ(RGB), expectedXYZ);\n});\n\ntest(\"convert RGB to XYZ with reverse transformation\", ({ deepEqual }) => {\n\tconst RGB: RGBColour = { R: 0, G: 250, B: 124 };\n\tconst expectedXYZ: XYZColour = {\n\t\tX: 37.82369749318333,\n\t\tY: 69.82645037678448,\n\t\tZ: 30.553124293888928,\n\t};\n\tdeepEqual(convertRGBtoXYZ(RGB), expectedXYZ);\n});\n"],"names":["test","deepEqual","RGB","R","G","B","expectedXYZ","X","Y","Z","convertRGBtoXYZ"],"mappings":"kHAAiB,uCACe,6GAGhCA,GAAAA,YAAI,EAAC,qBAAsB,CAAC,CAAEC,SAAS,CAAE,IACxC,MAAMC,IAAiB,CAAEC,EAAG,GAAIC,EAAG,IAAKC,EAAG,GAAI,EAC/C,MAAMC,YAAyB,CAC9BC,EAAG,mBACHC,EAAG,kBACHC,EAAG,kBACJ,EACAR,UAAUS,GAAAA,gCAAe,EAACR,KAAMI,YACjC,GAEAN,GAAAA,YAAI,EAAC,iDAAkD,CAAC,CAAEC,SAAS,CAAE,IACpE,MAAMC,IAAiB,CAAEC,EAAG,EAAGC,EAAG,IAAKC,EAAG,GAAI,EAC9C,MAAMC,YAAyB,CAC9BC,EAAG,kBACHC,EAAG,kBACHC,EAAG,kBACJ,EACAR,UAAUS,GAAAA,gCAAe,EAACR,KAAMI,YACjC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});const _ava=_interop_require_default(require("ava"));const _convertXYZtoLab=require("../convertXYZtoLab.js");function _interop_require_default(obj){return obj&&obj.__esModule?obj:{default:obj}}(0,_ava.default)("convert XYZ to Lab",({deepEqual})=>{const XYZ={X:20.517540535826125,Y:21.586050011389926,Z:23.50720846240363};const expectedLab={L:53.58501345216902,a:.003155620347972121,b:-.006243566036268078};deepEqual((0,_convertXYZtoLab.convertXYZtoLab)(XYZ),expectedLab)});(0,_ava.default)("convert XYZ to Lab with constrains",({deepEqual})=>{const XYZ={X:0,Y:18.30616888722103,Z:19.436790978392008};const expectedLab={L:49.8653712598923,a:-214.93694508574265,b:.9489453364894151};deepEqual((0,_convertXYZtoLab.convertXYZtoLab)(XYZ),expectedLab)});
|
|
2
|
+
//# sourceMappingURL=convertXYZtoLab.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/tests/convertXYZtoLab.test.ts"],"sourcesContent":["import test from \"ava\";\nimport { convertXYZtoLab } from \"../convertXYZtoLab.js\";\nimport type { LabColour, XYZColour } from \"../types.js\";\n\ntest(\"convert XYZ to Lab\", ({ deepEqual }) => {\n\tconst XYZ: XYZColour = {\n\t\tX: 20.517540535826125,\n\t\tY: 21.586050011389926,\n\t\tZ: 23.50720846240363,\n\t};\n\n\tconst expectedLab: LabColour = {\n\t\tL: 53.58501345216902,\n\t\ta: 0.003155620347972121,\n\t\tb: -0.006243566036268078,\n\t};\n\n\tdeepEqual(convertXYZtoLab(XYZ), expectedLab);\n});\n\ntest(\"convert XYZ to Lab with constrains\", ({ deepEqual }) => {\n\tconst XYZ: XYZColour = {\n\t\tX: 0,\n\t\tY: 18.30616888722103,\n\t\tZ: 19.436790978392008,\n\t};\n\n\tconst expectedLab: LabColour = {\n\t\tL: 49.8653712598923,\n\t\ta: -214.93694508574265,\n\t\tb: 0.9489453364894151,\n\t};\n\n\tdeepEqual(convertXYZtoLab(XYZ), expectedLab);\n});\n"],"names":["test","deepEqual","XYZ","X","Y","Z","expectedLab","L","a","b","convertXYZtoLab"],"mappings":"kHAAiB,uCACe,6GAGhCA,GAAAA,YAAI,EAAC,qBAAsB,CAAC,CAAEC,SAAS,CAAE,IACxC,MAAMC,IAAiB,CACtBC,EAAG,mBACHC,EAAG,mBACHC,EAAG,iBACJ,EAEA,MAAMC,YAAyB,CAC9BC,EAAG,kBACHC,EAAG,oBACHC,EAAG,CAAC,mBACL,EAEAR,UAAUS,GAAAA,gCAAe,EAACR,KAAMI,YACjC,GAEAN,GAAAA,YAAI,EAAC,qCAAsC,CAAC,CAAEC,SAAS,CAAE,IACxD,MAAMC,IAAiB,CACtBC,EAAG,EACHC,EAAG,kBACHC,EAAG,kBACJ,EAEA,MAAMC,YAAyB,CAC9BC,EAAG,iBACHC,EAAG,CAAC,mBACJC,EAAG,iBACJ,EAEAR,UAAUS,GAAAA,gCAAe,EAACR,KAAMI,YACjC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});const _ava=_interop_require_default(require("ava"));const _getSRGBLuminanceFromHex=require("../getSRGBLuminanceFromHex.js");function _interop_require_default(obj){return obj&&obj.__esModule?obj:{default:obj}}(0,_ava.default)("should return the luminance of a hex color",({is})=>{is((0,_getSRGBLuminanceFromHex.getSRGBLuminanceFromHex)("#444"),.05780543019106723)});(0,_ava.default)("should return the luminance of an 8-digit hex color",({is})=>{is((0,_getSRGBLuminanceFromHex.getSRGBLuminanceFromHex)("#6564CDB3"),.16288822420427432)});(0,_ava.default)("should return the luminance of an 4-digit hex color",({is})=>{is((0,_getSRGBLuminanceFromHex.getSRGBLuminanceFromHex)("#0f08"),.7152)});
|
|
2
|
+
//# sourceMappingURL=getLuminance.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/tests/getLuminance.test.ts"],"sourcesContent":["import test from \"ava\";\nimport { getSRGBLuminanceFromHex } from \"../getSRGBLuminanceFromHex.js\";\n\ntest(\"should return the luminance of a hex color\", ({ is }) => {\n\tis(getSRGBLuminanceFromHex(\"#444\"), 0.05780543019106723);\n});\n\ntest(\"should return the luminance of an 8-digit hex color\", ({ is }) => {\n\tis(getSRGBLuminanceFromHex(\"#6564CDB3\"), 0.16288822420427432);\n});\n\ntest(\"should return the luminance of an 4-digit hex color\", ({ is }) => {\n\tis(getSRGBLuminanceFromHex(\"#0f08\"), 0.7152);\n});\n"],"names":["test","is","getSRGBLuminanceFromHex"],"mappings":"kHAAiB,+CACuB,qHAExCA,GAAAA,YAAI,EAAC,6CAA8C,CAAC,CAAEC,EAAE,CAAE,IACzDA,GAAGC,GAAAA,gDAAuB,EAAC,QAAS,mBACrC,GAEAF,GAAAA,YAAI,EAAC,sDAAuD,CAAC,CAAEC,EAAE,CAAE,IAClEA,GAAGC,GAAAA,gDAAuB,EAAC,aAAc,mBAC1C,GAEAF,GAAAA,YAAI,EAAC,sDAAuD,CAAC,CAAEC,EAAE,CAAE,IAClEA,GAAGC,GAAAA,gDAAuB,EAAC,SAAU,MACtC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});const _ava=_interop_require_default(require("ava"));const _isCSSNameDarkColour=require("../isCSSNameDarkColour.js");function _interop_require_default(obj){return obj&&obj.__esModule?obj:{default:obj}}(0,_ava.default)("verify if `darkblue` is a dark colour",({is})=>{is((0,_isCSSNameDarkColour.isCSSNamedDarkColour)("darkblue","WCAG2.1"),true)});(0,_ava.default)("verify if `lightgoldenrodyellow` is a dark colour",({is})=>{is((0,_isCSSNameDarkColour.isCSSNamedDarkColour)("lightgoldenrodyellow","WCAG2.1"),false)});(0,_ava.default)("return undefined if named colour does not exist",({is,throws})=>{const error=throws(()=>(0,_isCSSNameDarkColour.isCSSNamedDarkColour)("rose","WCAG2.1"));is(error.message,"rose is not a valid colour format. isCSSNamedDarkColour only accepts CSS named colours. Check more details here https://developer.mozilla.org/en-US/docs/Web/CSS/named-color")});
|
|
2
|
+
//# sourceMappingURL=isCSSNameDarkColour.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/tests/isCSSNameDarkColour.test.ts"],"sourcesContent":["import test from \"ava\";\nimport { isCSSNamedDarkColour } from \"../isCSSNameDarkColour.js\";\n\ntest(\"verify if `darkblue` is a dark colour\", ({ is }) => {\n\tis(isCSSNamedDarkColour(\"darkblue\", \"WCAG2.1\"), true);\n});\n\ntest(\"verify if `lightgoldenrodyellow` is a dark colour\", ({ is }) => {\n\tis(isCSSNamedDarkColour(\"lightgoldenrodyellow\", \"WCAG2.1\"), false);\n});\n\ntest(\"return undefined if named colour does not exist\", ({ is, throws }) => {\n\t/* @ts-ignore-line */\n\tconst error = throws(() => isCSSNamedDarkColour(\"rose\", \"WCAG2.1\")) as Error;\n\tis(\n\t\terror.message,\n\t\t\"rose is not a valid colour format. isCSSNamedDarkColour only accepts CSS named colours. Check more details here https://developer.mozilla.org/en-US/docs/Web/CSS/named-color\",\n\t);\n});\n"],"names":["test","is","isCSSNamedDarkColour","throws","error","message"],"mappings":"kHAAiB,2CACoB,iHAErCA,GAAAA,YAAI,EAAC,wCAAyC,CAAC,CAAEC,EAAE,CAAE,IACpDA,GAAGC,GAAAA,yCAAoB,EAAC,WAAY,WAAY,KACjD,GAEAF,GAAAA,YAAI,EAAC,oDAAqD,CAAC,CAAEC,EAAE,CAAE,IAChEA,GAAGC,GAAAA,yCAAoB,EAAC,uBAAwB,WAAY,MAC7D,GAEAF,GAAAA,YAAI,EAAC,kDAAmD,CAAC,CAAEC,EAAE,CAAEE,MAAM,CAAE,IAEtE,MAAMC,MAAQD,OAAO,IAAMD,GAAAA,yCAAoB,EAAC,OAAQ,YACxDD,GACCG,MAAMC,OAAO,CACb,+KAEF"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});const _ava=_interop_require_default(require("ava"));const _isCSSRGBDarkColour=require("../isCSSRGBDarkColour.js");function _interop_require_default(obj){return obj&&obj.__esModule?obj:{default:obj}}(0,_ava.default)("verify if `rgb(20, 20, 20)` is a dark colour",({is})=>{is((0,_isCSSRGBDarkColour.isCSSRGBDarkColour)("rgb(20, 20, 20)","WCAG2.1"),true)});(0,_ava.default)("verify if `rgb(200, 200, 200)` is not a dark colour",({is})=>{is((0,_isCSSRGBDarkColour.isCSSRGBDarkColour)("rgb(200, 200, 200)","WCAG2.1"),false)});
|
|
2
|
+
//# sourceMappingURL=isCSSRGBDarkColour.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/tests/isCSSRGBDarkColour.test.ts"],"sourcesContent":["import test from \"ava\";\nimport { isCSSRGBDarkColour } from \"../isCSSRGBDarkColour.js\";\n\ntest(\"verify if `rgb(20, 20, 20)` is a dark colour\", ({ is }) => {\n\tis(isCSSRGBDarkColour(\"rgb(20, 20, 20)\", \"WCAG2.1\"), true);\n});\n\ntest(\"verify if `rgb(200, 200, 200)` is not a dark colour\", ({ is }) => {\n\tis(isCSSRGBDarkColour(\"rgb(200, 200, 200)\", \"WCAG2.1\"), false);\n});\n"],"names":["test","is","isCSSRGBDarkColour"],"mappings":"kHAAiB,0CACkB,gHAEnCA,GAAAA,YAAI,EAAC,+CAAgD,CAAC,CAAEC,EAAE,CAAE,IAC3DA,GAAGC,GAAAA,sCAAkB,EAAC,kBAAmB,WAAY,KACtD,GAEAF,GAAAA,YAAI,EAAC,sDAAuD,CAAC,CAAEC,EAAE,CAAE,IAClEA,GAAGC,GAAAA,sCAAkB,EAAC,qBAAsB,WAAY,MACzD"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});const _ava=_interop_require_default(require("ava"));const _isDarkColour=require("../isDarkColour.js");function _interop_require_default(obj){return obj&&obj.__esModule?obj:{default:obj}}(0,_ava.default)("should return true for `darkblue`",({is})=>{is((0,_isDarkColour.isDarkColour)("darkblue","WCAG2.1"),true)});(0,_ava.default)("should return false for `lightgoldenrodyellow`",({is})=>{is((0,_isDarkColour.isDarkColour)("lightgoldenrodyellow","WCAG2.1"),false)});(0,_ava.default)("should return true for `rgb(20, 20, 20)`",({is})=>{is((0,_isDarkColour.isDarkColour)("rgb(20, 20, 20)","WCAG2.1"),true)});(0,_ava.default)("should return false for `rgb(200, 200, 200)`",({is})=>{is((0,_isDarkColour.isDarkColour)("rgb(200, 200, 200)","WCAG2.1"),false)});(0,_ava.default)("should return false for #BED colour",({is})=>{is((0,_isDarkColour.isDarkColour)("#BED","WCAG2.1"),false)});(0,_ava.default)("should return true for #666666 colour",({is})=>{is((0,_isDarkColour.isDarkColour)("#666666","WCAG2.1"),true)});(0,_ava.default)("throws an error if not passing a valid CSS RGB format",({is,throws})=>{const rgb="rfv(12,23,42)";const error=throws(()=>(0,_isDarkColour.isDarkColour)(rgb,"WCAG2.1"));is(error.message,"rfv(12,23,42) is not a valid colour format. isDarkColour accepts CSS RGB formats, ie rgb(0,0,0) and rgba(255, 255, 255, 0.4), hexadecimal and CSS named colours.")});
|
|
2
|
+
//# sourceMappingURL=isDarkColour.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/tests/isDarkColour.test.ts"],"sourcesContent":["import test from \"ava\";\nimport { isDarkColour } from \"../isDarkColour.js\";\n\ntest(\"should return true for `darkblue`\", ({ is }) => {\n\tis(isDarkColour(\"darkblue\", \"WCAG2.1\"), true);\n});\n\ntest(\"should return false for `lightgoldenrodyellow`\", ({ is }) => {\n\tis(isDarkColour(\"lightgoldenrodyellow\", \"WCAG2.1\"), false);\n});\n\ntest(\"should return true for `rgb(20, 20, 20)`\", ({ is }) => {\n\tis(isDarkColour(\"rgb(20, 20, 20)\", \"WCAG2.1\"), true);\n});\n\ntest(\"should return false for `rgb(200, 200, 200)`\", ({ is }) => {\n\tis(isDarkColour(\"rgb(200, 200, 200)\", \"WCAG2.1\"), false);\n});\n\ntest(\"should return false for #BED colour\", ({ is }) => {\n\tis(isDarkColour(\"#BED\", \"WCAG2.1\"), false);\n});\n\ntest(\"should return true for #666666 colour\", ({ is }) => {\n\tis(isDarkColour(\"#666666\", \"WCAG2.1\"), true);\n});\n\ntest(\"throws an error if not passing a valid CSS RGB format\", ({\n\tis,\n\tthrows,\n}) => {\n\tconst rgb = \"rfv(12,23,42)\";\n\tconst error = throws(() => isDarkColour(rgb, \"WCAG2.1\")) as Error;\n\tis(\n\t\terror.message,\n\t\t\"rfv(12,23,42) is not a valid colour format. isDarkColour accepts CSS RGB formats, ie rgb(0,0,0) and rgba(255, 255, 255, 0.4), hexadecimal and CSS named colours.\",\n\t);\n});\n"],"names":["test","is","isDarkColour","throws","rgb","error","message"],"mappings":"kHAAiB,oCACY,0GAE7BA,GAAAA,YAAI,EAAC,oCAAqC,CAAC,CAAEC,EAAE,CAAE,IAChDA,GAAGC,GAAAA,0BAAY,EAAC,WAAY,WAAY,KACzC,GAEAF,GAAAA,YAAI,EAAC,iDAAkD,CAAC,CAAEC,EAAE,CAAE,IAC7DA,GAAGC,GAAAA,0BAAY,EAAC,uBAAwB,WAAY,MACrD,GAEAF,GAAAA,YAAI,EAAC,2CAA4C,CAAC,CAAEC,EAAE,CAAE,IACvDA,GAAGC,GAAAA,0BAAY,EAAC,kBAAmB,WAAY,KAChD,GAEAF,GAAAA,YAAI,EAAC,+CAAgD,CAAC,CAAEC,EAAE,CAAE,IAC3DA,GAAGC,GAAAA,0BAAY,EAAC,qBAAsB,WAAY,MACnD,GAEAF,GAAAA,YAAI,EAAC,sCAAuC,CAAC,CAAEC,EAAE,CAAE,IAClDA,GAAGC,GAAAA,0BAAY,EAAC,OAAQ,WAAY,MACrC,GAEAF,GAAAA,YAAI,EAAC,wCAAyC,CAAC,CAAEC,EAAE,CAAE,IACpDA,GAAGC,GAAAA,0BAAY,EAAC,UAAW,WAAY,KACxC,GAEAF,GAAAA,YAAI,EAAC,wDAAyD,CAAC,CAC9DC,EAAE,CACFE,MAAM,CACN,IACA,MAAMC,IAAM,gBACZ,MAAMC,MAAQF,OAAO,IAAMD,GAAAA,0BAAY,EAACE,IAAK,YAC7CH,GACCI,MAAMC,OAAO,CACb,mKAEF"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});const _ava=_interop_require_default(require("ava"));const _isHexDarkColour=require("../isHexDarkColour.js");function _interop_require_default(obj){return obj&&obj.__esModule?obj:{default:obj}}(0,_ava.default)("should return false for #BED colour",({is})=>{is((0,_isHexDarkColour.isHexDarkColour)("#BED","WCAG2.1"),false)});(0,_ava.default)("should return true for #666666 colour",({is})=>{is((0,_isHexDarkColour.isHexDarkColour)("#666666","WCAG2.1"),true)});
|
|
2
|
+
//# sourceMappingURL=isHexDarkColour.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/tests/isHexDarkColour.test.ts"],"sourcesContent":["import test from \"ava\";\nimport { isHexDarkColour } from \"../isHexDarkColour.js\";\n\ntest(\"should return false for #BED colour\", ({ is }) => {\n\tis(isHexDarkColour(\"#BED\", \"WCAG2.1\"), false);\n});\n\ntest(\"should return true for #666666 colour\", ({ is }) => {\n\tis(isHexDarkColour(\"#666666\", \"WCAG2.1\"), true);\n});\n"],"names":["test","is","isHexDarkColour"],"mappings":"kHAAiB,uCACe,6GAEhCA,GAAAA,YAAI,EAAC,sCAAuC,CAAC,CAAEC,EAAE,CAAE,IAClDA,GAAGC,GAAAA,gCAAe,EAAC,OAAQ,WAAY,MACxC,GAEAF,GAAAA,YAAI,EAAC,wCAAyC,CAAC,CAAEC,EAAE,CAAE,IACpDA,GAAGC,GAAAA,gCAAe,EAAC,UAAW,WAAY,KAC3C"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});const _ava=_interop_require_default(require("ava"));const _pickHexColourContrast=require("../pickHexColourContrast.js");function _interop_require_default(obj){return obj&&obj.__esModule?obj:{default:obj}}(0,_ava.default)("should return #FFFFFF as the best colour for a #333333 background",({is})=>{const colours={backgroundColour:"#333333",optionOneColour:"#FFFFFF",optionTwoColour:"#000000"};is((0,_pickHexColourContrast.pickHexColourContrast)(colours,"WCAG2.1"),"#FFFFFF")});(0,_ava.default)("should return #000000 as the best colour for a #BED background",({is})=>{const colours={backgroundColour:"#BED",optionOneColour:"#FFFFFF",optionTwoColour:"#000000"};is((0,_pickHexColourContrast.pickHexColourContrast)(colours,"WCAG2.1"),"#000000")});(0,_ava.default)("should return #000000 as the best colour for a #DD337F background",({is})=>{const colours={backgroundColour:"#DD337F",optionOneColour:"#FFFFFF",optionTwoColour:"#000000"};is((0,_pickHexColourContrast.pickHexColourContrast)(colours,"WCAG2.1"),"#000000")});
|
|
2
|
+
//# sourceMappingURL=pickColourContrast.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/tests/pickColourContrast.test.ts"],"sourcesContent":["import test from \"ava\";\nimport { pickHexColourContrast } from \"../pickHexColourContrast.js\";\n\ntest(\"should return #FFFFFF as the best colour for a #333333 background\", ({\n\tis,\n}) => {\n\tconst colours = {\n\t\tbackgroundColour: \"#333333\",\n\t\toptionOneColour: \"#FFFFFF\",\n\t\toptionTwoColour: \"#000000\",\n\t};\n\tis(pickHexColourContrast(colours, \"WCAG2.1\"), \"#FFFFFF\");\n});\n\ntest(\"should return #000000 as the best colour for a #BED background\", ({\n\tis,\n}) => {\n\tconst colours = {\n\t\tbackgroundColour: \"#BED\",\n\t\toptionOneColour: \"#FFFFFF\",\n\t\toptionTwoColour: \"#000000\",\n\t};\n\tis(pickHexColourContrast(colours, \"WCAG2.1\"), \"#000000\");\n});\n\ntest(\"should return #000000 as the best colour for a #DD337F background\", ({\n\tis,\n}) => {\n\tconst colours = {\n\t\tbackgroundColour: \"#DD337F\",\n\t\toptionOneColour: \"#FFFFFF\",\n\t\toptionTwoColour: \"#000000\",\n\t};\n\tis(pickHexColourContrast(colours, \"WCAG2.1\"), \"#000000\");\n});\n"],"names":["test","is","colours","backgroundColour","optionOneColour","optionTwoColour","pickHexColourContrast"],"mappings":"kHAAiB,6CACqB,mHAEtCA,GAAAA,YAAI,EAAC,oEAAqE,CAAC,CAC1EC,EAAE,CACF,IACA,MAAMC,QAAU,CACfC,iBAAkB,UAClBC,gBAAiB,UACjBC,gBAAiB,SAClB,EACAJ,GAAGK,GAAAA,4CAAqB,EAACJ,QAAS,WAAY,UAC/C,GAEAF,GAAAA,YAAI,EAAC,iEAAkE,CAAC,CACvEC,EAAE,CACF,IACA,MAAMC,QAAU,CACfC,iBAAkB,OAClBC,gBAAiB,UACjBC,gBAAiB,SAClB,EACAJ,GAAGK,GAAAA,4CAAqB,EAACJ,QAAS,WAAY,UAC/C,GAEAF,GAAAA,YAAI,EAAC,oEAAqE,CAAC,CAC1EC,EAAE,CACF,IACA,MAAMC,QAAU,CACfC,iBAAkB,UAClBC,gBAAiB,UACjBC,gBAAiB,SAClB,EACAJ,GAAGK,GAAAA,4CAAqB,EAACJ,QAAS,WAAY,UAC/C"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});const _ava=_interop_require_default(require("ava"));const _index=require("../util/index.js");function _interop_require_default(obj){return obj&&obj.__esModule?obj:{default:obj}}(0,_ava.default)("converts degrees to radians",({is})=>{is((0,_index.toRadians)(120),2.0943951023931953)});(0,_ava.default)("computes a big square",({is})=>{is((0,_index.bigSquare)(2),1448154672685047e-19)});(0,_ava.default)("computes a hue derivative at point 0,0",({is})=>{is((0,_index.hue_d)(0,0),0)});(0,_ava.default)("computes a hue derivative with an angle greater than 0",({is})=>{is((0,_index.hue_d)(5,5),45)});(0,_ava.default)("computes a hue derivative with an angle smaller than 0",({is})=>{is((0,_index.hue_d)(-5,-5),225)});(0,_ava.default)("computes the difference between two Hue derivatives",({is})=>{const hues={C1:79.82,C2:82.7485,h1_d:271.9222,h2_d:270};is((0,_index.deltaHue_d)(hues),-1.9221999999999753)});(0,_ava.default)("computes the difference between two Hue 0 derivatives",({is})=>{const hues={C1:0,C2:0,h1_d:271.9222,h2_d:270};is((0,_index.deltaHue_d)(hues),0)});(0,_ava.default)("computes the difference between two Hue derivatives greater than 180",({is})=>{const hues={C1:3.7496,C2:2.5,h1_d:0,h2_d:270};is((0,_index.deltaHue_d)(hues),-90)});(0,_ava.default)("computes the difference between two Hue derivatives smaller than -180",({is})=>{const hues={C1:3.7346,C2:3.7346,h1_d:359.9847,h2_d:179.9816};is((0,_index.deltaHue_d)(hues),179.9969)});(0,_ava.default)("computes the mean between two Hue derivatives",({is})=>{const hues={C1:79.82,C2:82.7485,h1_d:271.9222,h2_d:270};is((0,_index.meanHue_d)(hues),270.9611)});(0,_ava.default)("computes the mean between two Hue 0 derivatives",({is})=>{const hues={C1:0,C2:0,h1_d:271.9222,h2_d:270};is((0,_index.meanHue_d)(hues),541.9222)});(0,_ava.default)("computes the mean between two Hue derivatives where the absolute diff is greater than 180 and the sum smaller than 360",({is})=>{const hues={C1:3.456873841289,C2:38.9743207183753,h1_d:0,h2_d:332.493931504869};is((0,_index.meanHue_d)(hues),346.2469657524345)});(0,_ava.default)("computes the mean between two Hue derivatives where the absolute diff is greater than 180 and the sum greater than 360",({is})=>{const hues={C1:3.73461191455763,C2:3.734611942673,h1_d:359.984658170244,h2_d:179.983123987353};is((0,_index.meanHue_d)(hues),89.98389107879848)});
|
|
2
|
+
//# sourceMappingURL=util.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/tests/util.test.ts"],"sourcesContent":["import test from \"ava\";\nimport type { HueHelper } from \"../types.js\";\nimport {\n\tbigSquare,\n\tdeltaHue_d,\n\thue_d,\n\tmeanHue_d,\n\ttoRadians,\n} from \"../util/index.js\";\n\ntest(\"converts degrees to radians\", ({ is }) => {\n\tis(toRadians(120), 2.0943951023931953);\n});\n\ntest(\"computes a big square\", ({ is }) => {\n\tis(bigSquare(2), 0.0001448154672685047);\n});\n\ntest(\"computes a hue derivative at point 0,0\", ({ is }) => {\n\tis(hue_d(0, 0), 0);\n});\n\ntest(\"computes a hue derivative with an angle greater than 0\", ({ is }) => {\n\tis(hue_d(5, 5), 45);\n});\n\ntest(\"computes a hue derivative with an angle smaller than 0\", ({ is }) => {\n\tis(hue_d(-5, -5), 225);\n});\n\ntest(\"computes the difference between two Hue derivatives\", ({ is }) => {\n\tconst hues: HueHelper = {\n\t\tC1: 79.82,\n\t\tC2: 82.7485,\n\t\th1_d: 271.9222,\n\t\th2_d: 270,\n\t};\n\tis(deltaHue_d(hues), -1.9221999999999753);\n});\n\ntest(\"computes the difference between two Hue 0 derivatives\", ({ is }) => {\n\tconst hues: HueHelper = {\n\t\tC1: 0,\n\t\tC2: 0,\n\t\th1_d: 271.9222,\n\t\th2_d: 270,\n\t};\n\tis(deltaHue_d(hues), 0);\n});\n\ntest(\"computes the difference between two Hue derivatives greater than 180\", ({\n\tis,\n}) => {\n\tconst hues: HueHelper = {\n\t\tC1: 3.7496,\n\t\tC2: 2.5,\n\t\th1_d: 0,\n\t\th2_d: 270,\n\t};\n\tis(deltaHue_d(hues), -90);\n});\n\ntest(\"computes the difference between two Hue derivatives smaller than -180\", ({\n\tis,\n}) => {\n\tconst hues: HueHelper = {\n\t\tC1: 3.7346,\n\t\tC2: 3.7346,\n\t\th1_d: 359.9847,\n\t\th2_d: 179.9816,\n\t};\n\tis(deltaHue_d(hues), 179.9969);\n});\n\ntest(\"computes the mean between two Hue derivatives\", ({ is }) => {\n\tconst hues: HueHelper = {\n\t\tC1: 79.82,\n\t\tC2: 82.7485,\n\t\th1_d: 271.9222,\n\t\th2_d: 270,\n\t};\n\tis(meanHue_d(hues), 270.9611);\n});\n\ntest(\"computes the mean between two Hue 0 derivatives\", ({ is }) => {\n\tconst hues: HueHelper = {\n\t\tC1: 0,\n\t\tC2: 0,\n\t\th1_d: 271.9222,\n\t\th2_d: 270,\n\t};\n\tis(meanHue_d(hues), 541.9222);\n});\n\ntest(\"computes the mean between two Hue derivatives where the absolute diff is greater than 180 and the sum smaller than 360\", ({\n\tis,\n}) => {\n\tconst hues: HueHelper = {\n\t\tC1: 3.456873841289,\n\t\tC2: 38.9743207183753,\n\t\th1_d: 0,\n\t\th2_d: 332.493931504869,\n\t};\n\tis(meanHue_d(hues), 346.2469657524345);\n});\n\ntest(\"computes the mean between two Hue derivatives where the absolute diff is greater than 180 and the sum greater than 360\", ({\n\tis,\n}) => {\n\tconst hues: HueHelper = {\n\t\tC1: 3.73461191455763,\n\t\tC2: 3.734611942673,\n\t\th1_d: 359.984658170244,\n\t\th2_d: 179.983123987353,\n\t};\n\tis(meanHue_d(hues), 89.98389107879848);\n});\n"],"names":["test","is","toRadians","bigSquare","hue_d","hues","C1","C2","h1_d","h2_d","deltaHue_d","meanHue_d"],"mappings":"kHAAiB,6BAQV,wGAEPA,GAAAA,YAAI,EAAC,8BAA+B,CAAC,CAAEC,EAAE,CAAE,IAC1CA,GAAGC,GAAAA,gBAAS,EAAC,KAAM,mBACpB,GAEAF,GAAAA,YAAI,EAAC,wBAAyB,CAAC,CAAEC,EAAE,CAAE,IACpCA,GAAGE,GAAAA,gBAAS,EAAC,GAAI,qBAClB,GAEAH,GAAAA,YAAI,EAAC,yCAA0C,CAAC,CAAEC,EAAE,CAAE,IACrDA,GAAGG,GAAAA,YAAK,EAAC,EAAG,GAAI,EACjB,GAEAJ,GAAAA,YAAI,EAAC,yDAA0D,CAAC,CAAEC,EAAE,CAAE,IACrEA,GAAGG,GAAAA,YAAK,EAAC,EAAG,GAAI,GACjB,GAEAJ,GAAAA,YAAI,EAAC,yDAA0D,CAAC,CAAEC,EAAE,CAAE,IACrEA,GAAGG,GAAAA,YAAK,EAAC,CAAC,EAAG,CAAC,GAAI,IACnB,GAEAJ,GAAAA,YAAI,EAAC,sDAAuD,CAAC,CAAEC,EAAE,CAAE,IAClE,MAAMI,KAAkB,CACvBC,GAAI,MACJC,GAAI,QACJC,KAAM,SACNC,KAAM,GACP,EACAR,GAAGS,GAAAA,iBAAU,EAACL,MAAO,CAAC,mBACvB,GAEAL,GAAAA,YAAI,EAAC,wDAAyD,CAAC,CAAEC,EAAE,CAAE,IACpE,MAAMI,KAAkB,CACvBC,GAAI,EACJC,GAAI,EACJC,KAAM,SACNC,KAAM,GACP,EACAR,GAAGS,GAAAA,iBAAU,EAACL,MAAO,EACtB,GAEAL,GAAAA,YAAI,EAAC,uEAAwE,CAAC,CAC7EC,EAAE,CACF,IACA,MAAMI,KAAkB,CACvBC,GAAI,OACJC,GAAI,IACJC,KAAM,EACNC,KAAM,GACP,EACAR,GAAGS,GAAAA,iBAAU,EAACL,MAAO,CAAC,GACvB,GAEAL,GAAAA,YAAI,EAAC,wEAAyE,CAAC,CAC9EC,EAAE,CACF,IACA,MAAMI,KAAkB,CACvBC,GAAI,OACJC,GAAI,OACJC,KAAM,SACNC,KAAM,QACP,EACAR,GAAGS,GAAAA,iBAAU,EAACL,MAAO,SACtB,GAEAL,GAAAA,YAAI,EAAC,gDAAiD,CAAC,CAAEC,EAAE,CAAE,IAC5D,MAAMI,KAAkB,CACvBC,GAAI,MACJC,GAAI,QACJC,KAAM,SACNC,KAAM,GACP,EACAR,GAAGU,GAAAA,gBAAS,EAACN,MAAO,SACrB,GAEAL,GAAAA,YAAI,EAAC,kDAAmD,CAAC,CAAEC,EAAE,CAAE,IAC9D,MAAMI,KAAkB,CACvBC,GAAI,EACJC,GAAI,EACJC,KAAM,SACNC,KAAM,GACP,EACAR,GAAGU,GAAAA,gBAAS,EAACN,MAAO,SACrB,GAEAL,GAAAA,YAAI,EAAC,yHAA0H,CAAC,CAC/HC,EAAE,CACF,IACA,MAAMI,KAAkB,CACvBC,GAAI,eACJC,GAAI,iBACJC,KAAM,EACNC,KAAM,gBACP,EACAR,GAAGU,GAAAA,gBAAS,EAACN,MAAO,kBACrB,GAEAL,GAAAA,YAAI,EAAC,yHAA0H,CAAC,CAC/HC,EAAE,CACF,IACA,MAAMI,KAAkB,CACvBC,GAAI,iBACJC,GAAI,eACJC,KAAM,iBACNC,KAAM,gBACP,EACAR,GAAGU,GAAAA,gBAAS,EAACN,MAAO,kBACrB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/types.ts"],"names":[],"mappings":""}
|
package/package.json
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sardine/colour",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.2",
|
|
4
4
|
"description": "It does things to colours",
|
|
5
5
|
"module": "./dist/index.js",
|
|
6
|
-
"main": "./dist/index.js",
|
|
6
|
+
"main": "./dist/cjs/index.js",
|
|
7
7
|
"types": "./dist/index.d.ts",
|
|
8
8
|
"sideEffects": false,
|
|
9
|
-
"type": "module",
|
|
10
9
|
"exports": {
|
|
11
10
|
".": {
|
|
12
11
|
"types": "./dist/index.d.ts",
|
|
13
12
|
"require": "./dist/cjs/index.js",
|
|
14
|
-
"
|
|
13
|
+
"import": "./dist/index.js",
|
|
14
|
+
"default": "./dist/cjs/index.js"
|
|
15
15
|
}
|
|
16
16
|
},
|
|
17
17
|
"scripts": {
|
|
18
18
|
"build": "rm -rf ./dist && npm run build:esm && npm run build:cjs && npm run types:emit",
|
|
19
19
|
"build:esm": "npx swc --config-file .esm.swcrc ./src -d ./dist",
|
|
20
20
|
"build:cjs": "npx swc --config-file .cjs.swcrc ./src -d ./dist/cjs",
|
|
21
|
-
"test": "rm -rf ./dist && npm run build:
|
|
21
|
+
"test": "rm -rf ./dist && npm run build:cjs && c8 ava",
|
|
22
22
|
"test:coverage": "c8 -r lcovonly report",
|
|
23
23
|
"types:emit": "npx tsc --declaration --emitDeclarationOnly",
|
|
24
24
|
"types:check": "npx tsc --noEmit",
|