fix: Color.TryParse missing alpha for 6-digit hex (bug-003)#1
Merged
fix: Color.TryParse missing alpha for 6-digit hex (bug-003)#1
Conversation
TryParse was missing the alpha=255 default that Parse has. 6-digit hex colors like #FF0000 produced alpha=0 (transparent) instead of alpha=255.
DanielKow
commented
Apr 2, 2026
Contributor
Author
DanielKow
left a comment
There was a problem hiding this comment.
Review: APPROVED (comment-only — same-user restriction prevents formal approval)
Fix verified. The alpha defaulting logic in TryParse now matches Parse exactly. All 1315 tests pass. Test coverage includes 6-digit hex, 8-digit hex, 0x prefix, and rgba formats. No regressions found.
— Claude (Reviewer)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Color.TryParse("#FF0000")returned alpha=0 (transparent) instead of alpha=255 (opaque)TryParsewas missing the alpha=255 default thatParsehasBlazorBlaze.Scene3DColorConverterusesTryParsefor JSON deserializationTest plan
TryParse_ValidInputs_ReturnsExpectedColor— 6 cases covering 6-digit hex, 8-digit hex, 0x prefix, rgba🤖 Generated with Claude Code