Skip to content

Conversation

@emilk
Copy link
Owner

@emilk emilk commented Jul 2, 2025

This changes how we convert glyph coverage to alpha (and ultimately a color), but only in light mode.

This is a bit of a hack, because it doesn't fix dark-on-light text in dark mode (if you have any), but for the common case this PR is a huge improvement.

You can also tweak this yourself now using Visuals::text_alpha_from_coverage or from the UI (bottom of the image):

image

Before / After

widget_gallery_light_x1 widget_gallery_light_x1

Black text Before/after

If you think the text above looks too weak, it's only because of the default text color. Here's how it looks like with perfectly #000000 black text:

image Screenshot 2025-07-02 at 13 59 30

@emilk emilk added visuals Renderings / graphics releated egui style visuals and theming labels Jul 2, 2025
@github-actions
Copy link

github-actions bot commented Jul 2, 2025

Preview available at https://egui-pr-preview.github.io/pr/7290-emilkimprove-light-mode-text
Note that it might take a couple seconds for the update to show up after the preview_build workflow has completed.

@emilk emilk marked this pull request as ready for review July 2, 2025 12:00
@emilk emilk requested a review from Wumpf as a code owner July 2, 2025 12:00
Copy link
Collaborator

@Wumpf Wumpf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If nothing else it's now a lot easier to understand what's happening and why, nice!!

Tested the looks on low-dpi SDR Windows Firefox: I found the default settings a tad bit too light, empirically a gamma of 0.9 looked a lil bit better to me. But this is starting to get arbitrary so if you think linear looks good I'm very much in favor with sticking with that
Either way I also believe this to be an improvement compared the harsh and fringy looking boundaries of TwoCoverageMinusCoverageSq

@emilk emilk merged commit dc79998 into main Jul 2, 2025
47 checks passed
@emilk emilk deleted the emilk/improve-light-mode-text branch July 2, 2025 12:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

egui style visuals and theming visuals Renderings / graphics releated

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants