You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[vector_graphics_compiler] Align HSL color parsing with RGB parser support #186153
The previous fix corrected decimal percentage handling in legacy hsl() / hsla() color parsing. During review, maintainers suggested two follow-up improvements:
Move HSL parsing out of parser.dart into colors.dart, similar to the existing RGB parsing path, so HSL can share the same parser organization and support both legacy and modern syntax.
Optional, doesn't need to be part of this PR, but an idea for another potential improvement:
If we move the hsl code to a parseHslFunction in colors.dart similar to this parseRgbFunction, that could enable us to support both legacy and modern css style color strings "hsla(H, S, L, A)" and "hsla(H S L A)" the way we do for rgb in colors.dart.
Add parseCssHsl and parseHslFunction to colors.dart, following the existing parseCssRgb / parseRgbFunction structure.
Keep this scoped to the same practical numeric subset supported by the current RGB parser rather than implementing the full CSS Color 4 grammar.
Support both:
legacy comma-separated HSL/HSLA syntax, e.g. hsl(270, 100%, 76%)
modern space-separated HSL/HSLA syntax, e.g. hsl(270 100% 76% / 0.5)
Add tests for valid/invalid HSL syntax variants and HSLA alpha clamping.
Notes
This is not intended to be a complete CSS Color 4 parser. For example, angle hue units, none, calc(), and relative color syntax remain out of scope, matching the existing RGB parser's regex-based subset approach.
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.
Activity
mbcorona commentedon May 6, 2026
Hi @fondoger , thanks for reporting the issue and linking a PR, routing to team-engine for review.
[vector_graphics_compiler] Add modern HSL color parsing (flutter#11657)
github-actions commentedon May 25, 2026
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.[vector_graphics_compiler] Add modern HSL color parsing (flutter#11657)