MCPcopy Index your code
hub / github.com/anomalyco/opencode / srgbToLinear

Function srgbToLinear

packages/opencode/src/cli/cmd/run/theme.ts:218–224  ·  view source on GitHub ↗
(value: number)

Source from the content-addressed store, hash-verified

216}
217
218function srgbToLinear(value: number): number {
219 if (value <= 0.04045) {
220 return value / 12.92
221 }
222
223 return ((value + 0.055) / 1.055) ** 2.4
224}
225
226function oklab(color: RGBA) {
227 const r = srgbToLinear(color.r)

Callers 1

oklabFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected