Repository navigation
[patch] Leave the terminal's color for a transparent foreground or background - #191
Merged
Merged
Conversation
…ckground SpectreConsoleProvider built its markup from a color's RGB channels and ignored alpha, so Background = "Transparent" (ARGB 00FFFFFF) painted an opaque white block behind the text, and any zero-alpha color drew its RGB. A color with zero alpha is now left out of the style, so the terminal's own color shows; any other alpha is drawn opaque, since a terminal cannot blend. Fixes #155 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GQx1vbckMdZECPqnBTXWek
Contributor
Author
|
Generated by Claude Code |
|
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.



Fixes #155
What was wrong
SpectreConsoleProvider.BuildStyleStringwrote a color as#RRGGBBand ignoredColor.A. As a result,Background = "Transparent"(ARGB00FFFFFF) painted an opaque white block behind the text, and any zero-alpha color was drawn using its RGB channels.Change
A == 0is left out of the markup, so the terminal's own color shows. This matches leaving the property unset.<remarks>onTextStyle.ForegroundColorandTextStyle.BackgroundColor.Tests
Four new
SpectreConsoleProviderTestsrun against a TrueColor test console.CreateProvidernow takes an optional color system and still defaults toNoColors.Background = "Transparent"writes exactlyESC[1;1HESC[38;2;255;255;0mHiESC[0m, the expected output from the issue.BackgroundColor = Color.FromArgb(0, 0, 0, 0)writes no48;parameter.Foreground = "Transparent"writes no38;parameter, and the background is still written.The first three failed before the fix. The full suite passes locally (247/247).
🤖 Generated with Claude Code
https://claude.ai/code/session_01GQx1vbckMdZECPqnBTXWek
Generated by Claude Code