Skip to content

--color transparent is accepted and listed as a known name, but produces solid black icons #158

Open

Description

@matt-edmondson

What's wrong

transparent is one of the accepted colour names. The README lists it ("Choosing a Colour", line 111), and the validation error message prints it through ColorParser.KnownNames.

IconHelper deliberately discards the colour's alpha, because the output alpha carries the coverage. NamedColors.Transparent is #00000000, so its RGB is 0,0,0. Every icon therefore comes out as an opaque black coverage mask, and the tool exits 0. A user who asked for "transparent" gets the opposite of what the word means, and nothing tells them.

Evidence

  • IconHelper/ColorParser.cs:30: NamedColors.TryGet(trimmed, out color) accepts transparent.
  • In ktsu.Semantics.Color, NamedColors.Transparent is Color.FromHex("#00000000").
  • IconHelper/IconHelper.cs:224: (byte colorR, byte colorG, byte colorB, byte _) = color.ToBytes(); drops the alpha.
  • IconHelper.Test/ColorParserTests.cs:87 asserts that KnownNames contains "transparent".

Suggested fix

  • Reject transparent in ColorParser.TryParse or Arguments.Validate. The message should explain that the output alpha is the coverage, so a fully transparent colour has no meaning here.
  • Drop transparent from KnownNames, and update the README list and the test to match.
  • Optional: also reject any 8-digit hex whose alpha is 00. The README already says that alpha is ignored.

Acceptance criteria

  • iconhelper -c transparent … exits 1 with a clear message.
  • transparent no longer appears in the known-names list or in the README.

Activity

  1. matt-edmondson commented on Oct 30, 2026

    @matt-edmondson
    ContributorAuthor

    Triage


    Generated by Claude Code

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

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions