(rgb: RGBColor)
| 286 | * Convert a RGB color set to a hex color. |
| 287 | */ |
| 288 | export function rgbArrayToHex(rgb: RGBColor): string { |
| 289 | return `#${rgb |
| 290 | .map((channel) => { |
| 291 | const component = channel.toString(16); |
| 292 | if (component.length === 1) return `0${component}`; |
| 293 | return component; |
| 294 | }) |
| 295 | .join('')}`; |
| 296 | } |
| 297 | |
| 298 | export function getColor(percentage: number, start: RGBColor, end: RGBColor) { |
| 299 | const rgb = end.map((channel, index) => { |
no test coverage detected