iced-yoda/style/src/application.rs

24 lines
688 B
Rust
Raw Normal View History

2022-11-10 01:10:28 +01:00
//! Change the appearance of an application.
use iced_core::Color;
2022-11-10 01:10:28 +01:00
/// A set of rules that dictate the style of an application.
pub trait StyleSheet {
2022-11-10 01:10:28 +01:00
/// The supported style of the [`StyleSheet`].
type Style: Default;
2022-11-10 01:10:28 +01:00
/// Returns the [`Appearance`] of the application for the provided [`Style`].
///
/// [`Style`]: Self::Style
fn appearance(&self, style: &Self::Style) -> Appearance;
}
2022-11-10 01:10:28 +01:00
/// The appearance of an application.
#[derive(Debug, Clone, Copy, PartialEq)]
pub struct Appearance {
2022-11-10 01:10:28 +01:00
/// The background [`Color`] of the application.
pub background_color: Color,
2022-11-10 01:10:28 +01:00
/// The default text [`Color`] of the application.
pub text_color: Color,
}