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

Function applyHueOff

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

Source from the content-addressed store, hash-verified

116 * Adds to the hue channel of HSL, wrapping at 360.
117 */
118export function applyHueOff(hex: string, hueOff: number): string {
119 const { r, g, b } = hexToRgb(hex)
120 const { h, s, l } = rgbToHsl(r, g, b)
121 const offsetDeg = hueOff / 60000
122 const newH = (((h + offsetDeg) % 360) + 360) % 360
123 const rgb = hslToRgb(newH, s, l)
124 return rgbToHex(rgb.r, rgb.g, rgb.b)
125}
126
127/**
128 * Apply saturation 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