mirror of
https://github.com/emilk/egui.git
synced 2026-08-29 04:40:03 -04:00
Improve text rendering in light mode (#7290)
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):  ## Before / After   ## 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:  
This commit is contained in:
@@ -544,7 +544,7 @@ impl Painter {
|
||||
let data: Vec<u8> = {
|
||||
profiling::scope!("font -> sRGBA");
|
||||
image
|
||||
.srgba_pixels(None)
|
||||
.srgba_pixels(Default::default())
|
||||
.flat_map(|a| a.to_array())
|
||||
.collect()
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user