MCPcopy Create free account
hub / github.com/IgorWarzocha/howcode / channel

Function channel

desktop/runtime-host/theme-service.ts:89–92  ·  view source on GitHub ↗
(value: number)

Source from the content-addressed store, hash-verified

87 const rgb = hexToRgb(hex)
88 if (!rgb) return 0
89 const channel = (value: number) => {
90 const normalized = value / 255
91 return normalized <= 0.03928 ? normalized / 12.92 : ((normalized + 0.055) / 1.055) ** 2.4
92 }
93 return 0.2126 * channel(rgb.r) + 0.7152 * channel(rgb.g) + 0.0722 * channel(rgb.b)
94}
95

Callers 1

luminanceFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected