Repository navigation
Pin and document that drawText ignores an alpha component in its color - #75
Merged
Merged
Conversation
drawRectangle's alpha handling was already documented and pinned, but drawText's color and drawButton's colorText were not: the alpha is dropped entirely, so even a = 0 paints opaque text on the display and on a per-pixel alpha surface. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Member
Author
|
Self-review rubric (scored against the diff and command output):
Judgment-call notes:
None of the changed paths is on the do-not-auto-merge list ( This review was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener). drafted by Claude on behalf of Daniel Stephenson |
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
Stage B (unit-test expansion) combined with the matching Stage A documentation fix, for the text-color path.
drawRectangle's handling of an(r, g, b, a)color is already documented and pinned (test: pin that a color's alpha is not blended by drawRectangle #70), butdrawText'scoloranddrawButton'scolorTextwere not covered by either.a = 0paints fully opaque glyph stems, on the display and on apygame.SRCALPHAsurface alike. Only the antialiased edges blend.test_draw_text_ignores_the_alpha_of_its_color(parametrized overa = 0anda = 128) pins this. The test can tell the two behaviours apart: if alpha were respected,a = 0would paint nothing anda = 128would blend, so the exact RGB color would never appear in either case.drawText/drawButtondocstrings now describe the behaviour.No production behaviour is changed and no public signature is touched, so the consumer-impact gate does not apply.
Test plan
python3 -m py_compile src/main/python/preponderous/graphik/graphik.pypython3 -m pytest: 157 passed (155 before, plus 2 new parametrized cases)Testworkflow green across 3.9–3.13 (this also checks the claim against the newer pygame wheels CI installs)Skipped issues
All open issues were deferred, because each one needs a maintainer decision or touches a path excluded from autonomous change:
.github/workflows/.No tracking issue: the gap was found during a documentation and test sweep.
This PR description was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener).
🤖 Generated with Claude Code
drafted by Claude on behalf of Daniel Stephenson