Fix gamma correction for colored glyphs in iced_wgpu
This commit is contained in:
parent
9af0a27e67
commit
be340a8cd8
4 changed files with 43 additions and 14 deletions
|
|
@ -2,7 +2,7 @@ use crate::core::alignment;
|
|||
use crate::core::{Rectangle, Size};
|
||||
use crate::graphics::color;
|
||||
use crate::graphics::text::cache::{self, Cache};
|
||||
use crate::graphics::text::{font_system, Editor, Paragraph};
|
||||
use crate::graphics::text::{font_system, to_color, Editor, Paragraph};
|
||||
use crate::layer::Text;
|
||||
|
||||
use std::borrow::Cow;
|
||||
|
|
@ -214,16 +214,7 @@ impl Pipeline {
|
|||
right: (clip_bounds.x + clip_bounds.width) as i32,
|
||||
bottom: (clip_bounds.y + clip_bounds.height) as i32,
|
||||
},
|
||||
default_color: {
|
||||
let [r, g, b, a] = color::pack(color).components();
|
||||
|
||||
glyphon::Color::rgba(
|
||||
(r * 255.0) as u8,
|
||||
(g * 255.0) as u8,
|
||||
(b * 255.0) as u8,
|
||||
(a * 255.0) as u8,
|
||||
)
|
||||
},
|
||||
default_color: to_color(color),
|
||||
})
|
||||
},
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue