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

Function applyHueMod

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

Source from the content-addressed store, hash-verified

103 * In OOXML, hueMod multiplies the hue value. Hue wraps around at 360.
104 */
105export function applyHueMod(hex: string, hueMod: number): string {
106 const { r, g, b } = hexToRgb(hex)
107 const { h, s, l } = rgbToHsl(r, g, b)
108 const newH = (h * (hueMod / 100000)) % 360
109 const rgb = hslToRgb(newH, s, l)
110 return rgbToHex(rgb.r, rgb.g, rgb.b)
111}
112
113/**
114 * Apply hue offset (additive).

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