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

Function linearToSrgb

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

Source from the content-addressed store, hash-verified

18}
19
20function linearToSrgb(c: number): number {
21 const s = c <= 0.0031308 ? c * 12.92 : 1.055 * c ** (1 / 2.4) - 0.055
22 return Math.max(0, Math.min(255, Math.round(s * 255)))
23}
24
25// ---------------------------------------------------------------------------
26// OOXML Color Modifiers

Callers 2

applyTintFunction · 0.85
applyShadeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected