MCPcopy Index your code
hub / github.com/simstudioai/sim / applyLumOff

Function applyLumOff

apps/sim/lib/pptx-renderer/utils/color.ts:79–85  ·  view source on GitHub ↗
(hex: string, lumOff: number)

Source from the content-addressed store, hash-verified

77 * Adds to the L channel of HSL.
78 */
79export function applyLumOff(hex: string, lumOff: number): string {
80 const { r, g, b } = hexToRgb(hex)
81 const { h, s, l } = rgbToHsl(r, g, b)
82 const newL = Math.max(0, Math.min(1, l + lumOff / 100000))
83 const rgb = hslToRgb(h, s, newL)
84 return rgbToHex(rgb.r, rgb.g, rgb.b)
85}
86
87/**
88 * Apply saturation modulation.

Callers 1

applyColorModifiersFunction · 0.85

Calls 4

hexToRgbFunction · 0.90
rgbToHslFunction · 0.90
hslToRgbFunction · 0.90
rgbToHexFunction · 0.90

Tested by

no test coverage detected