镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Paint --color green as #008000 again, not lime [patch] - #170

Open
matt-edmondson wants to merge 3 commits into
mainfrom
fix/green-is-008000-169
Open

matt-edmondson wants to merge 3 commits into
mainfrom
fix/green-is-008000-169

Conversation

@matt-edmondson

Copy link
Copy Markdown
Contributor

Fixes #169

What changed

ktsu.Semantics.Color 5.12.1 is still the newest version on NuGet. In that version NamedColors.Green is #00FF00, which CSS calls lime. Before #69, ColorTranslator gave green as #008000. So after #69, -c green painted (0, 255, 0) and exited 0, with no warning.

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. lime is not added, because 5.12.1 doesn't define it.

Verification

  • Before the fix, only the green row of the new test failed: expected (0,128,0,255), got (0,255,0,255). It passes after the fix.
  • dotnet test on IconHelper.Test: 101/101 pass, including the gold masters after git lfs pull.

Note, unrelated to this PR: restore on main now fails with NU1903 because of a new high-severity advisory for SixLabors.ImageSharp 3.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

matt-edmondson and others added 2 commits November 10, 2026 12:31
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

Copy link
Copy Markdown
Contributor Author

The first CI run failed at restore on every OS. This PR didn't cause it:

NU1903: Warning As Error: Package 'SixLabors.ImageSharp' 3.1.12 has a known high severity vulnerability (GHSA-v76p-62qx-wwq2)

main fails restore the same way, because the advisory affects the ImageSharp version pinned there. Dependabot's #145 already moves it to 3.2.0, so I've brought that same one-line bump into this PR (db7d18b) so it can go green. With 3.2.0, restore passes with the audit on, and IconHelper.Test passes locally, 101/101 including the gold masters. If #145 merges first, this commit becomes a no-op.


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

Copy link
Copy Markdown
Contributor Author

Update on CI: I've reverted the ImageSharp 3.2.0 bump in 0fc5c20. On CI, 3.2.0's build targets fail with No Six Labors license found. Set $(SixLaborsLicenseKey)…, so the bump just swaps the NU1903 restore error for a build error. That is probably also why Dependabot's #145 is red. Locally it passed only because the license check doesn't run outside CI.

So this PR now contains only the green fix, and it stays red on the NU1903 error that main has too. There are two ways to clear it, and either is a maintainer decision rather than something to slip into this PR:

  1. Suppress this one advisory with <NuGetAuditSuppress Include="https://github.com/advisories/GHSA-v76p-62qx-wwq2" /> in Directory.Packages.props, as PkmnDB#45 does, until ImageSharp is upgraded.
  2. Add a Six Labors license key to CI (SixLaborsLicenseKey) and take 3.2.0 / 4.x.

Once main is fixed, merging it in here should turn this PR green, because the code change itself passes 101/101 locally.


Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

--color green paints icons lime (#00FF00) instead of the #008000 it painted before the ktsu.Semantics.Color switch

1 participant