MCPcopy Create free account
hub / github.com/anomalyco/opencode / hit

Function hit

packages/ui/src/theme/resolve.ts:101–107  ·  view source on GitHub ↗
(a: HexColor, b: HexColor)

Source from the content-addressed store, hash-verified

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

Callers 1

onFunction · 0.70

Calls 1

lumFunction · 0.85

Tested by

no test coverage detected