(c: number)
| 76 | }) |
| 77 | |
| 78 | function componentToHex(c: number): string { |
| 79 | const hex = c.toString(16) |
| 80 | return hex.length === 1 ? '0' + hex : hex |
| 81 | } |
| 82 | |
| 83 | function rgbToHex(rgb: string): string | undefined { |
| 84 | const match = rgb.match(/rgb\((\d+),\s*(\d+),\s*(\d+)\)/) |