MCPcopy Create free account
hub / github.com/simstudioai/sim / srgbToLinear

Function srgbToLinear

apps/sim/lib/pptx-renderer/utils/color.ts:15–18  ·  view source on GitHub ↗
(c: number)

Source from the content-addressed store, hash-verified

13// ---------------------------------------------------------------------------
14
15function srgbToLinear(c: number): number {
16 const s = c / 255
17 return s <= 0.04045 ? s / 12.92 : ((s + 0.055) / 1.055) ** 2.4
18}
19
20function linearToSrgb(c: number): number {
21 const s = c <= 0.0031308 ? c * 12.92 : 1.055 * c ** (1 / 2.4) - 0.055

Callers 2

applyTintFunction · 0.85
applyShadeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected