(hex: string, value?: number)
| 96 | } |
| 97 | |
| 98 | function rgba(hex: string, value?: number): RGBA { |
| 99 | const color = RGBA.fromHex(hex) |
| 100 | return value === undefined ? color : alpha(color, value) |
| 101 | } |
| 102 | |
| 103 | function mode(bg: RGBA): "dark" | "light" { |
| 104 | return luminance(bg) > 0.5 ? "light" : "dark" |