{"record":{"id":"a83a9c53bb26cb50","repo":"remotion-dev/remotion","slug":"hueshift-must-be-360-but-got-hueshift","errorCode":null,"errorMessage":"\"hueShift\" must be <= 360, but got ${hueShift}","messagePattern":"\"hueShift\" must be <= 360, but got (.+?)","errorType":"validation","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"packages/effects/src/light-leak.ts","lineNumber":72,"sourceCode":"const resolve = (p: LightLeakEffectParams): LightLeakResolved => ({\n\tseed: p.seed ?? DEFAULT_SEED,\n\thueShift: p.hueShift ?? DEFAULT_HUE_SHIFT,\n\tprogress: p.progress ?? DEFAULT_PROGRESS,\n});\n\nconst validateLightLeakParams = (params: LightLeakEffectParams): void => {\n\tassertEffectParamsObject(params, 'lightLeak()');\n\tassertOptionalFiniteNumber(params.seed, 'seed');\n\tassertOptionalFiniteNumber(params.hueShift, 'hueShift');\n\tassertOptionalFiniteNumber(params.progress, 'progress');\n\n\tconst {hueShift, progress} = resolve(params);\n\tif (hueShift < 0) {\n\t\tthrow new TypeError(`\"hueShift\" must be >= 0, but got ${hueShift}`);\n\t}\n\n\tif (hueShift > 360) {\n\t\tthrow new TypeError(`\"hueShift\" must be <= 360, but got ${hueShift}`);\n\t}\n\n\tvalidateUnitInterval(progress, 'progress');\n};\n\nconst LIGHT_LEAK_VS = /* glsl */ `#version 300 es\nin vec2 aPos;\nin vec2 aUv;\nout vec2 vUv;\nvoid main() {\n\tvUv = aUv;\n\tgl_Position = vec4(aPos, 0.0, 1.0);\n}\n`;\n\nconst LIGHT_LEAK_FS = /* glsl */ `#version 300 es\nprecision highp float;\n","sourceCodeStart":54,"sourceCodeEnd":90,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/effects/src/light-leak.ts#L54-L90","documentation":"Thrown by the `lightLeak()` validator when `hueShift` exceeds 360. Because 360 degrees is a full hue-wheel rotation (equivalent to 0), anything larger is redundant and treated as invalid input rather than silently wrapped.","triggerScenarios":"Passing `lightLeak({hueShift: 400})`; animating hueShift with an unclamped interpolate that overshoots above 360; multiplying hueShift by a factor that pushes it past 360.","commonSituations":"Slider maxed out; spring/physics animations that overshoot; arithmetic that accumulates beyond one rotation.","solutions":["Keep `hueShift` within [0, 360]; subtract 360 if you need an equivalent angle.","Clamp animated hueShift with `extrapolateRight: 'clamp'` and an output max of 360.","Normalize computed hue values with `((n % 360) + 360) % 360` before passing them in."],"exampleFix":"// before\nlightLeak({hueShift: 450})\n\n// after\nlightLeak({hueShift: 90})","handlingStrategy":"validation","validationCode":"if (typeof params.hueShift === 'number') {\n  params = {...params, hueShift: ((params.hueShift % 360) + 360) % 360};\n}","typeGuard":"const isHueShiftSafe = (h: number | undefined): boolean =>\n  h === undefined || (h >= 0 && h <= 360);","tryCatchPattern":null,"preventionTips":["Normalize hueShift with modulo into [0, 360) before passing it in.","Use `extrapolateRight: 'clamp'` on hueShift animations.","Treat 360 as identical to 0 and prefer the smaller equivalent angle."],"tags":["light-leak","validation","hue","effect-params","webgl2"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}