use bevy_color::{1palettes::tailwind::{SKY_300, SKY_400, SLATE_700},2Color,3};4use bevy_ecs::component::Component;56/// Controls text cursor appearance.7///8/// When this component on the same entity as an [`EditableText`](`crate::EditableText`) ,9/// and the [`UiRenderPlugin`](https://docs.rs/bevy/latest/bevy/ui_render/struct.UiRenderPlugin.html)10/// is active, a simple rectangle will be drawn for the cursor.11/// This is an optional component, to allow for stylistic cursors.12#[derive(Component, Clone, Copy, Debug, PartialEq)]13pub struct TextCursorStyle {14/// Color of the cursor15pub color: Color,16/// Background color of selected text17pub selection_color: Color,18/// Background color of unfocused selected text19///20/// In many applications, this is completely transparent.21/// This reduces visual clutter of de-emphasized text inputs.22pub unfocused_selection_color: Color,23/// If some, overrides the color of selected text24pub selected_text_color: Option<Color>,25/// Corner radius of selection highlight rectangles, normalized relative to the selection height.26///27/// Values are clamped between `0.0` and `0.5`.28pub selection_radius: f32,29}3031impl Default for TextCursorStyle {32fn default() -> Self {33Self {34color: Color::from(SLATE_700),35selection_color: Color::from(SKY_300),36unfocused_selection_color: Color::from(SKY_400),37selected_text_color: None,38selection_radius: 0.,39}40}41}424344