0e5550c2cedbd7e60308ea7a647abc80.json
2.76 KB
{"ast":null,"code":"var _interopRequireDefault=require(\"@babel/runtime/helpers/interopRequireDefault\");Object.defineProperty(exports,\"__esModule\",{value:true});exports.default=void 0;var _isWebColor=_interopRequireDefault(require(\"../isWebColor\"));var _processColor=_interopRequireDefault(require(\"../../exports/processColor\"));var normalizeColor=function normalizeColor(color,opacity){if(opacity===void 0){opacity=1;}if(color==null)return;if(typeof color==='string'&&(0,_isWebColor.default)(color)){return color;}var colorInt=(0,_processColor.default)(color);if(colorInt!=null){var r=colorInt>>16&255;var g=colorInt>>8&255;var b=colorInt&255;var a=(colorInt>>24&255)/255;var alpha=(a*opacity).toFixed(2);return\"rgba(\"+r+\",\"+g+\",\"+b+\",\"+alpha+\")\";}};var _default=normalizeColor;exports.default=_default;","map":{"version":3,"sources":["C:/Users/bluej/Desktop/2_2/searchGuide/searchGuide/node_modules/react-native-web/dist/modules/normalizeColor/index.js"],"names":["normalizeColor","color","opacity","colorInt","r","g","b","a","alpha","toFixed"],"mappings":"mKAQA,iEACA,gFAEA,GAAIA,CAAAA,cAAc,CAAG,QAASA,CAAAA,cAAT,CAAwBC,KAAxB,CAA+BC,OAA/B,CAAwC,CAC3D,GAAIA,OAAO,GAAK,IAAK,EAArB,CAAwB,CACtBA,OAAO,CAAG,CAAV,CACD,CAED,GAAID,KAAK,EAAI,IAAb,CAAmB,OAEnB,GAAI,MAAOA,CAAAA,KAAP,GAAiB,QAAjB,EAA6B,wBAAWA,KAAX,CAAjC,CAAoD,CAClD,MAAOA,CAAAA,KAAP,CACD,CAED,GAAIE,CAAAA,QAAQ,CAAG,0BAAaF,KAAb,CAAf,CAEA,GAAIE,QAAQ,EAAI,IAAhB,CAAsB,CACpB,GAAIC,CAAAA,CAAC,CAAGD,QAAQ,EAAI,EAAZ,CAAiB,GAAzB,CACA,GAAIE,CAAAA,CAAC,CAAGF,QAAQ,EAAI,CAAZ,CAAgB,GAAxB,CACA,GAAIG,CAAAA,CAAC,CAAGH,QAAQ,CAAG,GAAnB,CACA,GAAII,CAAAA,CAAC,CAAG,CAACJ,QAAQ,EAAI,EAAZ,CAAiB,GAAlB,EAAyB,GAAjC,CACA,GAAIK,CAAAA,KAAK,CAAG,CAACD,CAAC,CAAGL,OAAL,EAAcO,OAAd,CAAsB,CAAtB,CAAZ,CACA,MAAO,QAAUL,CAAV,CAAc,GAAd,CAAoBC,CAApB,CAAwB,GAAxB,CAA8BC,CAA9B,CAAkC,GAAlC,CAAwCE,KAAxC,CAAgD,GAAvD,CACD,CACF,CArBD,C,aAuBeR,c","sourcesContent":["/**\n * Copyright (c) Nicolas Gallagher.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\nimport isWebColor from '../isWebColor';\nimport processColor from '../../exports/processColor';\n\nvar normalizeColor = function normalizeColor(color, opacity) {\n if (opacity === void 0) {\n opacity = 1;\n }\n\n if (color == null) return;\n\n if (typeof color === 'string' && isWebColor(color)) {\n return color;\n }\n\n var colorInt = processColor(color);\n\n if (colorInt != null) {\n var r = colorInt >> 16 & 255;\n var g = colorInt >> 8 & 255;\n var b = colorInt & 255;\n var a = (colorInt >> 24 & 255) / 255;\n var alpha = (a * opacity).toFixed(2);\n return \"rgba(\" + r + \",\" + g + \",\" + b + \",\" + alpha + \")\";\n }\n};\n\nexport default normalizeColor;"]},"metadata":{},"sourceType":"script"}