pub struct Colors<C> {Show 13 fields
pub is_dark: bool,
pub background: C,
pub frame: C,
pub edit_bg: C,
pub edit_bg_disabled: C,
pub edit_bg_error: C,
pub accent: C,
pub accent_soft: C,
pub nav_focus: C,
pub text: C,
pub text_invert: C,
pub text_disabled: C,
pub text_sel_bg: C,
}Expand description
Provides standard theme colours
Fields§
§is_dark: boolTrue if this is a dark theme
background: CBackground colour
frame: CColour for frames (not always used)
edit_bg: CBackground colour of EditBox
edit_bg_disabled: CBackground colour of EditBox (disabled state)
edit_bg_error: CBackground colour of EditBox (error state)
accent: CTheme accent
This should be a bold colour, used for small details.
accent_soft: CSoft version of accent
A softer version of the accent colour, used for block elements in some themes.
Highlight colour for keyboard navigation
This may be the same as accent. It should contrast well with
accent_soft. Themes should use nav_focus over accent where a
strong contrast is required.
text: CNormal text colour (over background)
text_invert: COpposing text colour (e.g. white if text is black)
text_disabled: CDisabled text colour
text_sel_bg: CSelected text background colour
This may be the same as accent_soft.
Implementations§
Source§impl Colors<Rgba>
impl Colors<Rgba>
Sourcepub fn adjust_for_state(col: Rgba, state: InputState) -> Rgba
pub fn adjust_for_state(col: Rgba, state: InputState) -> Rgba
Adjust a colour depending on state
Sourcepub fn from_bg(
&self,
bg: Background,
state: InputState,
force_accent: bool,
) -> Rgba
pub fn from_bg( &self, bg: Background, state: InputState, force_accent: bool, ) -> Rgba
Extract from Background
Sourcepub fn from_edit_bg(&self, bg: Background, state: InputState) -> Rgba
pub fn from_edit_bg(&self, bg: Background, state: InputState) -> Rgba
Get colour of a text area, depending on state
Get colour for navigation highlight region, if any
Sourcepub fn accent_state(&self, state: InputState) -> Rgba
pub fn accent_state(&self, state: InputState) -> Rgba
Get accent colour, adjusted for state
Sourcepub fn accent_soft_state(&self, state: InputState) -> Rgba
pub fn accent_soft_state(&self, state: InputState) -> Rgba
Get soft accent colour, adjusted for state
Sourcepub fn check_mark_state(&self, state: InputState) -> Rgba
pub fn check_mark_state(&self, state: InputState) -> Rgba
Get colour for a check box mark, depending on state
Get background highlight colour of a menu entry, if any