| 5 | const MAX_COLORS = 8; |
| 6 | |
| 7 | const hexToRGB = hex => { |
| 8 | const c = hex.replace('#', '').padEnd(6, '0'); |
| 9 | const r = parseInt(c.slice(0, 2), 16) / 255; |
| 10 | const g = parseInt(c.slice(2, 4), 16) / 255; |
| 11 | const b = parseInt(c.slice(4, 6), 16) / 255; |
| 12 | return [r, g, b]; |
| 13 | }; |
| 14 | |
| 15 | const prepColors = input => { |
| 16 | const base = (input && input.length ? input : ['#A6C8FF', '#5227FF', '#FF9FFC']).slice(0, MAX_COLORS); |
no outgoing calls
no test coverage detected