diff options
author | 2023-09-19 23:00:20 +0200 | |
---|---|---|
committer | 2023-09-19 23:00:20 +0200 | |
commit | be340a8cd822be1ea0fe4c1b1f3a62ca66d705b4 (patch) | |
tree | 38f6d1dc01bc3c32859b46b20e136daa0f90754e /wgpu/src/text.rs | |
parent | 9af0a27e675b71164f32f8d82eb4cde9cdd459f3 (diff) | |
download | iced-be340a8cd822be1ea0fe4c1b1f3a62ca66d705b4.tar.gz iced-be340a8cd822be1ea0fe4c1b1f3a62ca66d705b4.tar.bz2 iced-be340a8cd822be1ea0fe4c1b1f3a62ca66d705b4.zip |
Fix gamma correction for colored glyphs in `iced_wgpu`
Diffstat (limited to 'wgpu/src/text.rs')
-rw-r--r-- | wgpu/src/text.rs | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/wgpu/src/text.rs b/wgpu/src/text.rs index 581df0cb..f746be63 100644 --- a/wgpu/src/text.rs +++ b/wgpu/src/text.rs @@ -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), }) }, ); |