(percentage: number, start: RGBColor, end: RGBColor)
| 296 | } |
| 297 | |
| 298 | export function getColor(percentage: number, start: RGBColor, end: RGBColor) { |
| 299 | const rgb = end.map((channel, index) => { |
| 300 | return Math.round(channel + percentage * (start[index]! - channel)); |
| 301 | }); |
| 302 | |
| 303 | return rgbArrayToHex(rgb as RGBColor); |
| 304 | } |
| 305 | |
| 306 | // Utility constants and helper functions |
| 307 | export function rgbToLinear(rgb: RGBColor): [number, number, number] { |
no test coverage detected