{"record":{"id":"cb94894d39ce0f7b","repo":"remotion-dev/remotion","slug":"hueshift-must-be-0-but-got-hueshift","errorCode":null,"errorMessage":"\"hueShift\" must be >= 0, but got ${hueShift}","messagePattern":"\"hueShift\" must be >= 0, but got (.+?)","errorType":"validation","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"packages/effects/src/light-leak.ts","lineNumber":68,"sourceCode":"\thueShift: number;\n\tprogress: number;\n};\n\nconst 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`;","sourceCodeStart":50,"sourceCodeEnd":86,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/effects/src/light-leak.ts#L50-L86","documentation":"Thrown by the `lightLeak()` effect's validator when the resolved `hueShift` is negative. Hue shift is measured in degrees on a [0, 360] hue wheel; a negative value has no defined meaning for the shader's hue rotation, so the validator rejects it.","triggerScenarios":"Passing `lightLeak({hueShift: -30})`, or animating hueShift with `interpolate()` whose output range dips below 0 without `extrapolateLeft: 'clamp'`.","commonSituations":"Slider dragged below zero in Studio; negative output from a math expression or easing that overshoots; user assuming hueShift wraps like a modulo.","solutions":["Set `hueShift` to a value in [0, 360] (0 and 360 are equivalent).","Clamp animated hueShift: `extrapolateLeft: 'clamp'` with an output minimum of 0.","If you want a 'backward' rotation, use 360 - desiredOffset instead of a negative number."],"exampleFix":"// before\nlightLeak({hueShift: -45})\n\n// after\nlightLeak({hueShift: 315})","handlingStrategy":"validation","validationCode":"if (typeof params.hueShift === 'number') {\n  params = {...params, hueShift: Math.max(0, Math.min(360, params.hueShift))};\n}","typeGuard":"const isHueShiftSafe = (h: number | undefined): boolean =>\n  h === undefined || (h >= 0 && h <= 360);","tryCatchPattern":null,"preventionTips":["Clamp hueShift to [0, 360] before calling lightLeak().","Use `extrapolateLeft: 'clamp'` on any interpolate() driving hueShift.","Remember negative hue is not supported — convert to 360 - offset."],"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"}