{"record":{"id":"275824e92cf0d3c9","repo":"glanceapp/glance","slug":"hsl-saturation-must-be-between-0-and-d","errorCode":null,"errorMessage":"HSL saturation must be between 0 and %d","messagePattern":"HSL saturation must be between 0 and (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/glance/config-fields.go","lineNumber":77,"sourceCode":"\t\treturn fmt.Errorf(\"invalid HSL color format: %s\", value)\n\t}\n\n\thue, err := strconv.ParseFloat(matches[1], 64)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif hue > hslHueMax {\n\t\treturn fmt.Errorf(\"HSL hue must be between 0 and %d\", hslHueMax)\n\t}\n\n\tsaturation, err := strconv.ParseFloat(matches[2], 64)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif saturation > hslSaturationMax {\n\t\treturn fmt.Errorf(\"HSL saturation must be between 0 and %d\", hslSaturationMax)\n\t}\n\n\tlightness, err := strconv.ParseFloat(matches[3], 64)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif lightness > hslLightnessMax {\n\t\treturn fmt.Errorf(\"HSL lightness must be between 0 and %d\", hslLightnessMax)\n\t}\n\n\tc.H = hue\n\tc.S = saturation\n\tc.L = lightness\n\n\treturn nil\n}\n","sourceCodeStart":59,"sourceCodeEnd":95,"githubUrl":"https://github.com/glanceapp/glance/blob/91324e8de762702e97b0ac5c8e36271d644d8642/internal/glance/config-fields.go#L59-L95","documentation":"Returned by hslColorField.UnmarshalYAML when the saturation component of an HSL color string exceeds hslSaturationMax (100) after parsing as float. Like the hue check it fires only after the overall pattern matched, so the syntax is right but the second component is out of range.","triggerScenarios":"An HSL color such as `200 150% 40%` — saturation above 100%.","commonSituations":"Copying saturation values from tools that emit 0-255 or 0-1 scales; typos; forgetting the % conversion when porting from another format.","solutions":["Keep saturation between 0% and 100%.","Re-check the source of the value if it came from a picker using a different scale.","Validate config with `glance config:validate`."],"exampleFix":"# before\nprimary-color: 200 150% 40%\n\n# after\nprimary-color: 200 60% 40%","handlingStrategy":"validation","validationCode":"python3 -c \"\nimport re,sys\nhsl=re.compile(r'^(\\d+(?:\\.\\d+)?) (\\d+(?:\\.\\d+)?)% (\\d+(?:\\.\\d+)?)%$')\nm=hsl.match('200 150% 40%')\nsys.exit('saturation out of range' if m and float(m.group(2))>100 else 0)\n\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep saturation on the 0-100% scale.","When porting from 0-1 scales, multiply by 100 and append %."],"tags":["config","theme","color","range","validation"],"backgroundTag":null,"analyzedSha":"91324e8de762702e97b0ac5c8e36271d644d8642","analyzedAt":"2026-08-15T14:12:54.279Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}