From 7f0db20b6f7951665a450c8e4a5f40d53adfd680 Mon Sep 17 00:00:00 2001 From: Nico Burns Date: Mon, 19 Feb 2024 15:22:47 +1300 Subject: [PATCH] Swap color channels --- examples/rich-text-winit/src/main.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/rich-text-winit/src/main.rs b/examples/rich-text-winit/src/main.rs index 1336fc677c..124d4c3caf 100644 --- a/examples/rich-text-winit/src/main.rs +++ b/examples/rich-text-winit/src/main.rs @@ -229,7 +229,8 @@ fn main() { &mut swash_cache, cosmic_text::Color::rgb(0xFF, 0xFF, 0xFF), |x, y, w, h, color| { - paint.set_color_rgba8(color.r(), color.g(), color.b(), color.a()); + // Note red and blue channel swapped + paint.set_color_rgba8(color.b(), color.g(), color.r(), color.a()); pixmap.fill_rect( Rect::from_xywh(x as f32, y as f32, w as f32, h as f32) .unwrap(),