(hex)
| 256 | } |
| 257 | |
| 258 | function parseHex(hex) { |
| 259 | if (hex.startsWith('#')) { |
| 260 | hex = hex.slice(1); |
| 261 | } |
| 262 | |
| 263 | hex = hex.replace(/([^0-9a-f])/gi, 'F'); |
| 264 | |
| 265 | if (hex.length === 3 || hex.length === 4) { |
| 266 | hex = hex.split('').map(function (x) { |
| 267 | return x + x; |
| 268 | }).join(''); |
| 269 | } |
| 270 | |
| 271 | if (hex.length === 6) { |
| 272 | hex = (0, padEnd)(hex, 8, 'F'); |
| 273 | } else { |
| 274 | hex = (0, padEnd)((0, padEnd)(hex, 6), 8, 'F'); |
| 275 | } |
| 276 | |
| 277 | return "#".concat(hex).toUpperCase().substr(0, 9); |
| 278 | } |
| 279 | |
| 280 | function parseGradient(gradient, colors, currentTheme) { |
| 281 | return gradient.replace(/([a-z]+(\s[a-z]+-[1-5])?)(?=$|,)/gi, function (x) { |
no test coverage detected