Repository navigation
Preserve straight color channels in translucent SVG paints - #199
Open
AmanBoronbaev wants to merge 1 commit into
Open
AmanBoronbaev wants to merge 1 commit into
AmanBoronbaev wants to merge 1 commit into
Conversation
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.
Go exposes premultiplied components through
color.Color.RGBA(). Writing those numbers into CSSrgba()applied the alpha a second time when the SVG was rendered. Half-transparent red became visibly darker.Convert the paint to
color.NRGBAbefore serializing the channels. The regression exercises both fill and stroke through a graphic context, with straight and premultiplied input colors. I also rasterized an exported rectangle with librsvg and checked the center pixel: RGBA (255, 0, 0, 128).The SVG package passed with the race detector. The repository-wide run reported the two existing raster bug-exposure tests for #181 and #155.
AI assistance: OpenAI Codex wrote the fix and tests and checked the rendered pixel.