)]}'
{
  "commit": "412bf44e4e551022e18ce97e3f4bcfbadb92c877",
  "tree": "b4df29b6d81584e62546d3dc93e93369c0447982",
  "parents": [
    "67ec0d36293eb963590e0606c8bede379be4d142"
  ],
  "author": {
    "name": "fondoger",
    "email": "fondoger@outlook.com",
    "time": "Thu May 07 01:20:36 2026 +0800"
  },
  "committer": {
    "name": "GitHub",
    "email": "noreply@github.com",
    "time": "Wed May 06 17:20:36 2026 +0000"
  },
  "message": "[vector_graphics_compiler] Fix HSL color parsing for decimal percentage components (#11619)\n\n## Description\n\nFixes a bug in the HSL color parser where decimal percentage components\n(e.g. `76.2745098039%`) were incorrectly multiplied by `2.55` — the\nconversion factor used for **rgb** percentages (percent → 0–255).  For\n**hsl**, saturation and lightness must stay in the 0–100 range (later\ndivided by 100) so the multiplication produced wildly wrong values\n(e.g. `76.27 → 194`, then `194 / 100 \u003d 1.94`).\n\nThe same branch also mis-handled the `hsla` alpha component: a unitless\ndecimal like `0.5` should be converted to 0–255 via `× 255`, not `× 2.55`.\n\n### Root cause\n\n`parser.dart` checked `rawColor.contains(\u0027.\u0027)` and unconditionally\napplied `* 2.55`, regardless of whether the current function was\n`rgb()`/`rgba()` (correct) or `hsl()`/`hsla()` (incorrect).\n\n### Fix\n\nTrack whether each token had a `%` suffix before stripping it.\nFor HSL percentage components, return the raw `double` (0–100 range).\nFor unitless alpha decimals (0–1 range), multiply by 255.\n\n### Reproduction (from issue #185833)\n\n```\nhsl(270, 100%, 76.2745098039%)\n```\n\n| Before fix | After fix |\n|---|---|\n| `#efdeff` ❌ | `#c286ff` ✓ |\n\n## Tests\n\nFour new tests added to `parsers_test.dart`:\n\n- `hsl` with integer percentages (regression)\n- `hsl` with decimal lightness percentage (the reported bug)\n- `hsla` with integer percentages + decimal alpha (regression)\n- `hsla` with decimal lightness + decimal alpha (combined case)\n\n## Related Issues\n\nFixes https://github.com/flutter/flutter/issues/185833",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "1bc29a647144c19ee8c50a3701324bbcdab6b056",
      "old_mode": 33188,
      "old_path": "packages/vector_graphics_compiler/CHANGELOG.md",
      "new_id": "13682cba547d6a21311e9f78030c9e68380a52a0",
      "new_mode": 33188,
      "new_path": "packages/vector_graphics_compiler/CHANGELOG.md"
    },
    {
      "type": "modify",
      "old_id": "6209ae2df55834c3d5b8bb723def1c13898d98ad",
      "old_mode": 33188,
      "old_path": "packages/vector_graphics_compiler/lib/src/svg/parser.dart",
      "new_id": "52eb38612a4816b4d22ca2c5bfe9ceb75e2fbd68",
      "new_mode": 33188,
      "new_path": "packages/vector_graphics_compiler/lib/src/svg/parser.dart"
    },
    {
      "type": "modify",
      "old_id": "f231c934ba220c2a3df6a7a4553d73a475d4e766",
      "old_mode": 33188,
      "old_path": "packages/vector_graphics_compiler/pubspec.yaml",
      "new_id": "47e7b8c02181cb2d2df0502f818d2176d03d7fa7",
      "new_mode": 33188,
      "new_path": "packages/vector_graphics_compiler/pubspec.yaml"
    },
    {
      "type": "modify",
      "old_id": "1750ae4dd7230e3876fbf6d50ae348f0e26585b6",
      "old_mode": 33188,
      "old_path": "packages/vector_graphics_compiler/test/parsers_test.dart",
      "new_id": "84c408227b8573e38573e648ee86f54bbf82f85b",
      "new_mode": 33188,
      "new_path": "packages/vector_graphics_compiler/test/parsers_test.dart"
    }
  ]
}
