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: bool
True if this is a dark theme
background: C
Background colour
frame: C
Colour for frames (not always used)
edit_bg: C
Background colour of EditBox
edit_bg_disabled: C
Background colour of EditBox
(disabled state)
edit_bg_error: C
Background colour of EditBox
(error state)
accent: C
Theme accent
This should be a bold colour, used for small details.
accent_soft: C
Soft 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: C
Normal text colour (over background)
text_invert: C
Opposing text colour (e.g. white if text
is black)
text_disabled: C
Disabled text colour
text_sel_bg: C
Selected 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