mirror of
https://github.com/idanoo/GoScrobble.git
synced 2024-11-25 09:55:15 +00:00
1 line
5.2 KiB
JSON
1 line
5.2 KiB
JSON
{"ast":null,"code":"\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.calculateRgba = void 0;\nvar BasicColors;\n\n(function (BasicColors) {\n BasicColors[\"maroon\"] = \"#800000\";\n BasicColors[\"red\"] = \"#FF0000\";\n BasicColors[\"orange\"] = \"#FFA500\";\n BasicColors[\"yellow\"] = \"#FFFF00\";\n BasicColors[\"olive\"] = \"#808000\";\n BasicColors[\"green\"] = \"#008000\";\n BasicColors[\"purple\"] = \"#800080\";\n BasicColors[\"fuchsia\"] = \"#FF00FF\";\n BasicColors[\"lime\"] = \"#00FF00\";\n BasicColors[\"teal\"] = \"#008080\";\n BasicColors[\"aqua\"] = \"#00FFFF\";\n BasicColors[\"blue\"] = \"#0000FF\";\n BasicColors[\"navy\"] = \"#000080\";\n BasicColors[\"black\"] = \"#000000\";\n BasicColors[\"gray\"] = \"#808080\";\n BasicColors[\"silver\"] = \"#C0C0C0\";\n BasicColors[\"white\"] = \"#FFFFFF\";\n})(BasicColors || (BasicColors = {}));\n\nvar calculateRgba = function (color, opacity) {\n if (Object.keys(BasicColors).includes(color)) {\n color = BasicColors[color];\n }\n\n if (color[0] === \"#\") {\n color = color.slice(1);\n }\n\n if (color.length === 3) {\n var res_1 = \"\";\n color.split(\"\").forEach(function (c) {\n res_1 += c;\n res_1 += c;\n });\n color = res_1;\n }\n\n var rgbValues = (color.match(/.{2}/g) || []).map(function (hex) {\n return parseInt(hex, 16);\n }).join(\", \");\n return \"rgba(\" + rgbValues + \", \" + opacity + \")\";\n};\n\nexports.calculateRgba = calculateRgba;","map":{"version":3,"sources":["/app/node_modules/react-spinners/helpers/colors.js"],"names":["Object","defineProperty","exports","value","calculateRgba","BasicColors","color","opacity","keys","includes","slice","length","res_1","split","forEach","c","rgbValues","match","map","hex","parseInt","join"],"mappings":"AAAA;;AACAA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YH,WAAZ,EAAyBI,QAAzB,CAAkCH,KAAlC,CAAJ,EAA8C;AAC1CA,IAAAA,KAAK,GAAGD,WAAW,CAACC,KAAD,CAAnB;AACH;;AACD,MAAIA,KAAK,CAAC,CAAD,CAAL,KAAa,GAAjB,EAAsB;AAClBA,IAAAA,KAAK,GAAGA,KAAK,CAACI,KAAN,CAAY,CAAZ,CAAR;AACH;;AACD,MAAIJ,KAAK,CAACK,MAAN,KAAiB,CAArB,EAAwB;AACpB,QAAIC,KAAK,GAAG,EAAZ;AACAN,IAAAA,KAAK,CAACO,KAAN,CAAY,EAAZ,EAAgBC,OAAhB,CAAwB,UAAUC,CAAV,EAAa;AACjCH,MAAAA,KAAK,IAAIG,CAAT;AACAH,MAAAA,KAAK,IAAIG,CAAT;AACH,KAHD;AAIAT,IAAAA,KAAK,GAAGM,KAAR;AACH;;AACD,MAAII,SAAS,GAAG,CAACV,KAAK,CAACW,KAAN,CAAY,OAAZ,KAAwB,EAAzB,EACXC,GADW,CACP,UAAUC,GAAV,EAAe;AAAE,WAAOC,QAAQ,CAACD,GAAD,EAAM,EAAN,CAAf;AAA2B,GADrC,EAEXE,IAFW,CAEN,IAFM,CAAhB;AAGA,SAAO,UAAUL,SAAV,GAAsB,IAAtB,GAA6BT,OAA7B,GAAuC,GAA9C;AACH,CAnBD;;AAoBAL,OAAO,CAACE,aAAR,GAAwBA,aAAxB","sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.calculateRgba = void 0;\nvar BasicColors;\n(function (BasicColors) {\n BasicColors[\"maroon\"] = \"#800000\";\n BasicColors[\"red\"] = \"#FF0000\";\n BasicColors[\"orange\"] = \"#FFA500\";\n BasicColors[\"yellow\"] = \"#FFFF00\";\n BasicColors[\"olive\"] = \"#808000\";\n BasicColors[\"green\"] = \"#008000\";\n BasicColors[\"purple\"] = \"#800080\";\n BasicColors[\"fuchsia\"] = \"#FF00FF\";\n BasicColors[\"lime\"] = \"#00FF00\";\n BasicColors[\"teal\"] = \"#008080\";\n BasicColors[\"aqua\"] = \"#00FFFF\";\n BasicColors[\"blue\"] = \"#0000FF\";\n BasicColors[\"navy\"] = \"#000080\";\n BasicColors[\"black\"] = \"#000000\";\n BasicColors[\"gray\"] = \"#808080\";\n BasicColors[\"silver\"] = \"#C0C0C0\";\n BasicColors[\"white\"] = \"#FFFFFF\";\n})(BasicColors || (BasicColors = {}));\nvar calculateRgba = function (color, opacity) {\n if (Object.keys(BasicColors).includes(color)) {\n color = BasicColors[color];\n }\n if (color[0] === \"#\") {\n color = color.slice(1);\n }\n if (color.length === 3) {\n var res_1 = \"\";\n color.split(\"\").forEach(function (c) {\n res_1 += c;\n res_1 += c;\n });\n color = res_1;\n }\n var rgbValues = (color.match(/.{2}/g) || [])\n .map(function (hex) { return parseInt(hex, 16); })\n .join(\", \");\n return \"rgba(\" + rgbValues + \", \" + opacity + \")\";\n};\nexports.calculateRgba = calculateRgba;\n"]},"metadata":{},"sourceType":"script"} |