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

Function applySatMod

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

Source from the content-addressed store, hash-verified

90 * Multiplies the S channel of HSL.
91 */
92export function applySatMod(hex: string, satMod: number): string {
93 const { r, g, b } = hexToRgb(hex)
94 const { h, s, l } = rgbToHsl(r, g, b)
95 const newS = Math.max(0, Math.min(1, s * (satMod / 100000)))
96 const rgb = hslToRgb(h, newS, l)
97 return rgbToHex(rgb.r, rgb.g, rgb.b)
98}
99
100/**
101 * Apply hue 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