Repository navigation
Paint --color green as #008000 again, not lime [patch] - #170
matt-edmondson wants to merge 3 commits into
Conversation
Since #69, ColorParser resolves names through ktsu.Semantics.Color's NamedColors, and in 5.12.1 (the newest on NuGet) NamedColors.Green is #00FF00, the colour CSS calls lime. ColorTranslator, which parsed the option before #69, gave green #008000, so `-c green` pipelines silently started painting a different colour with no warning. ColorParser now maps green to #008000 before consulting NamedColors. Semantics 6 fixes the table upstream (ktsu-dev/Semantics#449), so the special case can be dropped once that release is published. Pin every supported name to the colour it painted before #69, so a later change to the upstream table can't shift a colour silently. Fixes #169 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017vfJW2cDk8g13PxSem1QXB
…t audit 3.1.12 has a high-severity advisory (GHSA-v76p-62qx-wwq2), and restore treats NU1903 as an error, so every build on main currently fails before compiling. 3.2.0 restores cleanly with the audit on and all 101 tests, gold masters included, pass. Same change as Dependabot's #145. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017vfJW2cDk8g13PxSem1QXB
|
The first CI run failed at restore on every OS. This PR didn't cause it:
Generated by Claude Code |
…n CI This reverts commit db7d18b. ImageSharp 3.2.0's build targets fail with "No Six Labors license found" on CI, so the bump only trades the NU1903 restore error for a build error. Back to 3.1.12 until the advisory is handled the way the maintainer chooses. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017vfJW2cDk8g13PxSem1QXB
|
Update on CI: I've reverted the ImageSharp 3.2.0 bump in 0fc5c20. On CI, 3.2.0's build targets fail with So this PR now contains only the
Once Generated by Claude Code |
Fixes #169
What changed
ktsu.Semantics.Color5.12.1 is still the newest version on NuGet. In that versionNamedColors.Greenis#00FF00, which CSS calls lime. Before #69,ColorTranslatorgavegreenas#008000. So after #69,-c greenpainted(0, 255, 0)and exited 0, with no warning.ColorParser.TryParsenow mapsgreen(case-insensitive) to#008000before it looks inNamedColors. A comment says to drop this special case once Semantics 6 is on NuGet, since NamedColors "green" is #00FF00 (CSS "lime"), while gray and purple use CSS values, so names resolve to a different green than CSS Semantics#449 fixes the table upstream.EachKnownNameKeepsTheColourItPaintedBeforeTheNamedColorsSwitchpins each of the 12 opaque names to its oldColorTranslatorvalue. If the upstream table changes again, a colour can't shift without a test failing.ParsesTransparentAsFullyTransparentcheckstransparent.I didn't move the Semantics packages to 6.x, because 6.x isn't on NuGet yet. This uses the fallback the issue allows.
limeis not added, because 5.12.1 doesn't define it.Verification
greenrow of the new test failed: expected(0,128,0,255), got(0,255,0,255). It passes after the fix.dotnet testonIconHelper.Test: 101/101 pass, including the gold masters aftergit lfs pull.Note, unrelated to this PR: restore on
mainnow fails withNU1903because of a new high-severity advisory forSixLabors.ImageSharp3.1.12 (GHSA-v76p-62qx-wwq2). I ran the tests locally with-p:NuGetAudit=false. CI on this PR will probably go red at restore for the same reason until #145 (ImageSharp 3.2.0) or an equivalent bump lands.Generated by Claude Code