Skip to content

Commit

Permalink
Swap color channels
Browse files Browse the repository at this point in the history
  • Loading branch information
nicoburns committed Feb 19, 2024
1 parent 1f47341 commit 7f0db20
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion examples/rich-text-winit/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down

0 comments on commit 7f0db20

Please sign in to comment.