(a: HexColor, b: HexColor)
| 99 | return 0.2126 * lift(rgb.r) + 0.7152 * lift(rgb.g) + 0.0722 * lift(rgb.b) |
| 100 | } |
| 101 | const hit = (a: HexColor, b: HexColor) => { |
| 102 | const x = lum(a) |
| 103 | const y = lum(b) |
| 104 | const light = Math.max(x, y) |
| 105 | const dark = Math.min(x, y) |
| 106 | return (light + 0.05) / (dark + 0.05) |
| 107 | } |
| 108 | const on = (fill: HexColor) => { |
| 109 | const light = "#ffffff" as HexColor |
| 110 | const dark = "#000000" as HexColor |