feat(pixel): alpha-blend semi-transparent colours in PutPixel - #1
Merged
Conversation
PutPixel overwrote the destination verbatim, so a theme colour with a non-opaque alpha -- e.g. WhiteSur's borders rgba(0,0,0,0.12) -- painted as a harsh opaque line instead of a subtle hairline. Composite such colours src-over onto the existing pixel instead. Backward-compatible by construction: A==0xFF (the vast majority of widget paint) still overwrites verbatim, so opaque rendering is byte-identical; A==0 is a no-op. Blending over an opaque destination yields an opaque result, so a surface stays fully opaque for the host compositor. 100% coverage (blend-over-opaque, A==0 no-op, blend-over-empty alpha). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
PutPixeloverwrote the destination verbatim, so a theme colour with a non-opaque alpha — e.g. WhiteSur'sborders rgba(0,0,0,0.12)— painted as a harsh opaque line instead of a subtle hairline. Now such colours are composited src-over onto the existing pixel.Backward-compatible by construction:
A == 0xFF(the vast majority of widget paint) overwrites verbatim → opaque rendering is byte-identical.A == 0is a no-op.100% coverage (blend-over-opaque,
A==0no-op, blend-over-empty alpha).🤖 Generated with Claude Code