(rgb: RgbColor)
| 15 | } |
| 16 | |
| 17 | function rgbToHex(rgb: RgbColor): string { |
| 18 | const hex = Object.values(rgb) |
| 19 | .map((component) => component.toString(16).padStart(2, '0')) |
| 20 | .join(''); |
| 21 | |
| 22 | return `#${hex}`; |
| 23 | } |
| 24 | |
| 25 | // Calculate the HEX representation for a color as if |
| 26 | // it was rendered on a white background |
no test coverage detected