From 0a1ebbaff63fa547992fbe184fc9149e6ce62fb6 Mon Sep 17 00:00:00 2001 From: "Austin M. Reppert" Date: Sat, 14 Dec 2024 10:18:20 -0500 Subject: [PATCH] Update to new colors --- examples/scenes/src/cosmic_text_scene.rs | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/examples/scenes/src/cosmic_text_scene.rs b/examples/scenes/src/cosmic_text_scene.rs index 9750e0885..fe0d1b0e1 100644 --- a/examples/scenes/src/cosmic_text_scene.rs +++ b/examples/scenes/src/cosmic_text_scene.rs @@ -20,6 +20,7 @@ use unicode_segmentation::UnicodeSegmentation; use std::cmp; use std::collections::HashMap; use std::sync::Arc; +use vello::peniko::color::palette; impl TestScene for CosmicTextScene { fn render(&mut self, scene: &mut Scene, _scene_params: &mut SceneParams) { @@ -153,10 +154,10 @@ impl CosmicTextScene { vello_fonts, buffer_glyphs: create_glyphs_for_editor( &editor, - Color::from_rgba8(255, 255, 255, 255), - Color::from_rgba8(255, 0, 0, 255), - Color::from_rgba8(0, 0, 255, 255), - Color::from_rgba8(255, 255, 255, 255), + palette::css::WHITE, + palette::css::RED, + palette::css::BLUE, + palette::css::WHITE, ), } } @@ -333,7 +334,7 @@ fn create_glyphs( }; if let Some(editor_info) = &editor_info { - if text_color.components != editor_info.selected_text_color.components { + if text_color != editor_info.selected_text_color { if let Some((start, end)) = editor_info.selection_bounds { if line_i >= start.line && line_i <= end.line @@ -347,9 +348,7 @@ fn create_glyphs( } if let Some((last_font, last_glyph_color)) = last_font { - if last_font != glyph.font_id - || last_glyph_color.components != glyph_color.components - { + if last_font != glyph.font_id || last_glyph_color != glyph_color { buffer_line.glyph_runs.push(BufferGlyphRun { font: last_font, glyphs: current_glyphs,