Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(Metal): fix incorrect premultiplication of colors #5172

Merged
merged 1 commit into from
Jan 17, 2025

Conversation

qwerasd205
Copy link
Collaborator

load_color was multiplying the alpha channel by itself as well, rather than just the rgb channels.

Also made sure to divide alpha out before applying gamma encoding back to text color when not using linear blending, which was another source of error.

Probably fixes the problem observed in #5133 -- I couldn't reproduce the exact color shift, but did see a similar one with some of my test colors. This most visibly affects dimmed text since it uses an alpha of less than 1 for the text color.

Also make sure to divide alpha out before applying gamma encoding back
to text color when not using linear blending.
@mitchellh mitchellh enabled auto-merge January 17, 2025 03:33
@mitchellh mitchellh merged commit 72d0855 into ghostty-org:main Jan 17, 2025
30 checks passed
@github-actions github-actions bot added this to the 1.1.0 milestone Jan 17, 2025
@qwerasd205 qwerasd205 deleted the fix-text-color-premult branch January 17, 2025 03:45
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.

2 participants