cosmic::theme

Type Alias CosmicComponent

source
pub type CosmicComponent = Component;

Aliased Type§

struct CosmicComponent {
    pub base: Alpha<Rgb, f32>,
    pub hover: Alpha<Rgb, f32>,
    pub pressed: Alpha<Rgb, f32>,
    pub selected: Alpha<Rgb, f32>,
    pub selected_text: Alpha<Rgb, f32>,
    pub focus: Alpha<Rgb, f32>,
    pub divider: Alpha<Rgb, f32>,
    pub on: Alpha<Rgb, f32>,
    pub disabled: Alpha<Rgb, f32>,
    pub on_disabled: Alpha<Rgb, f32>,
    pub border: Alpha<Rgb, f32>,
    pub disabled_border: Alpha<Rgb, f32>,
}

Fields§

§base: Alpha<Rgb, f32>

The base color of the widget

§hover: Alpha<Rgb, f32>

The color of the widget when it is hovered

§pressed: Alpha<Rgb, f32>

the color of the widget when it is pressed

§selected: Alpha<Rgb, f32>

the color of the widget when it is selected

§selected_text: Alpha<Rgb, f32>

the color of the widget when it is selected

§focus: Alpha<Rgb, f32>

the color of the widget when it is focused

§divider: Alpha<Rgb, f32>

the color of dividers for this widget

§on: Alpha<Rgb, f32>

the color of text for this widget

§disabled: Alpha<Rgb, f32>

the color of the widget when it is disabled

§on_disabled: Alpha<Rgb, f32>

the color of text in the widget when it is disabled

§border: Alpha<Rgb, f32>

the color of the border for the widget

§disabled_border: Alpha<Rgb, f32>

the color of the border for the widget when it is disabled

Implementations

source§

impl Component

source

pub fn hover_state_color(&self) -> Alpha<Rgb, f32>

get @hover_state_color

source

pub fn pressed_state_color(&self) -> Alpha<Rgb, f32>

get @pressed_state_color

source

pub fn selected_state_color(&self) -> Alpha<Rgb, f32>

get @selected_state_color

source

pub fn selected_state_text_color(&self) -> Alpha<Rgb, f32>

get @selected_state_text_color

source

pub fn focus_color(&self) -> Alpha<Rgb, f32>

get @focus_color

source

pub fn colored_component( base: Alpha<Rgb, f32>, neutral: Alpha<Rgb, f32>, accent: Alpha<Rgb, f32>, hovered: Alpha<Rgb, f32>, pressed: Alpha<Rgb, f32>, ) -> Component

helper for producing a component from a base color a neutral and an accent

source

pub fn colored_button( base: Alpha<Rgb, f32>, overlay: Alpha<Rgb, f32>, on_button: Alpha<Rgb, f32>, accent: Alpha<Rgb, f32>, hovered: Alpha<Rgb, f32>, pressed: Alpha<Rgb, f32>, ) -> Component

helper for producing a button component

source

pub fn component( base: Alpha<Rgb, f32>, accent: Alpha<Rgb, f32>, on_component: Alpha<Rgb, f32>, hovered: Alpha<Rgb, f32>, pressed: Alpha<Rgb, f32>, is_high_contrast: bool, border: Alpha<Rgb, f32>, ) -> Component

helper for producing a component color theme

Trait Implementations

source§

impl Clone for Component

source§

fn clone(&self) -> Component

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Component

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl Default for Component

source§

fn default() -> Component

Returns the “default value” for a type. Read more
source§

impl<'de> Deserialize<'de> for Component

source§

fn deserialize<__D>( __deserializer: __D, ) -> Result<Component, <__D as Deserializer<'de>>::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl PartialEq for Component

source§

fn eq(&self, other: &Component) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Serialize for Component

source§

fn serialize<__S>( &self, __serializer: __S, ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl StructuralPartialEq for Component