diff --git a/examples/restricted_input.rs b/examples/restricted_input.rs index 77f16ebb18fe00b249b8d594e3dc15c72be33e08..8d7352694b89fd3ee0e40856d6a13a23404f8eb8 100644 --- a/examples/restricted_input.rs +++ b/examples/restricted_input.rs @@ -4,8 +4,7 @@ use bevy_cosmic_edit::*; fn setup(mut commands: Commands, windows: Query<&Window, With<PrimaryWindow>>) { commands.spawn(Camera2dBundle::default()); - let attrs = - AttrsOwned::new(Attrs::new().color(bevy_color_to_cosmic(Color::rgb(0.27, 0.27, 0.27)))); + let attrs = AttrsOwned::new(Attrs::new().color(CosmicColor::rgb(0, 0, 0))); let primary_window = windows.single(); let editor = commands @@ -39,15 +38,6 @@ fn setup(mut commands: Commands, windows: Query<&Window, With<PrimaryWindow>>) { commands.insert_resource(Focus(Some(editor))); } -pub fn bevy_color_to_cosmic(color: bevy::prelude::Color) -> CosmicColor { - cosmic_text::Color::rgba( - (color.r() * 255.) as u8, - (color.g() * 255.) as u8, - (color.b() * 255.) as u8, - (color.a() * 255.) as u8, - ) -} - fn main() { App::new() .add_plugins(DefaultPlugins)