({r, g, b, a}: RGBA)
| 134 | } |
| 135 | |
| 136 | export function rgbToHexString({r, g, b, a}: RGBA): string { |
| 137 | return `#${(a != null && a < 1 ? [r, g, b, Math.round(a * 255)] : [r, g, b]).map((x) => { |
| 138 | return `${x < 16 ? '0' : ''}${x.toString(16)}`; |
| 139 | }).join('')}`; |
| 140 | } |
| 141 | |
| 142 | export function hslToString(hsl: HSLA): string { |
| 143 | const {h, s, l, a} = hsl; |
no outgoing calls
no test coverage detected