Skip to content

feat(pixel): alpha-blend semi-transparent colours in PutPixel - #1

Merged
tannevaled merged 1 commit into
mainfrom
alpha-blend-putpixel
Jul 6, 2026
Merged

feat(pixel): alpha-blend semi-transparent colours in PutPixel#1
tannevaled merged 1 commit into
mainfrom
alpha-blend-putpixel

Conversation

@tannevaled

Copy link
Copy Markdown
Contributor

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. 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 == 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).

🤖 Generated with Claude Code

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>
@tannevaled
tannevaled merged commit 01dc324 into main Jul 6, 2026
1 check passed
@tannevaled
tannevaled deleted the alpha-blend-putpixel branch July 6, 2026 17:01
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.

1 participant