* @function StyleUtils.hexToRgb * @description 将16进制的颜色,转换成rgb格式 * @param {string} hexColor 16进制颜色 * @returns {string} rgb格式的颜色
(hexColor)
| 923 | * @returns {string} rgb格式的颜色 |
| 924 | */ |
| 925 | static hexToRgb(hexColor) { |
| 926 | if (!hexColor) { |
| 927 | return; |
| 928 | } |
| 929 | var s = hexColor.replace('#', '').split(''); |
| 930 | var rgb = [s[0] + s[1], s[2] + s[3], s[4] + s[5]]; |
| 931 | rgb = rgb.map(function (hex) { |
| 932 | return parseInt(hex, 16); |
| 933 | }); |
| 934 | return rgb; |
| 935 | } |
| 936 | |
| 937 | /** |
| 938 | * @function StyleUtils.formatRGB |
no test coverage detected