Struct kas_theme::Colors [−][src]
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
Adjust a colour depending on state
Get colour of a text area, depending on state
Get colour for navigation highlight region, if any
Get accent colour, adjusted for state
Get soft accent colour, adjusted for state
Get colour for a checkbox mark, depending on state
Get background highlight colour of a menu entry, if any
Trait Implementations
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Performs the conversion.
Performs the conversion.
Auto Trait Implementations
impl<C> RefUnwindSafe for Colors<C> where
C: RefUnwindSafe,
impl<C> UnwindSafe for Colors<C> where
C: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
pub fn cast_trunc(self) -> T
pub fn cast_trunc(self) -> T
Cast to integer, truncating Read more
pub fn cast_nearest(self) -> T
pub fn cast_nearest(self) -> T
Cast to the nearest integer Read more
pub fn cast_floor(self) -> T
pub fn cast_floor(self) -> T
Cast the floor to an integer Read more
pub fn try_cast_trunc(self) -> Result<T, Error>
pub fn try_cast_trunc(self) -> Result<T, Error>
Try converting to integer with truncation Read more
pub fn try_cast_nearest(self) -> Result<T, Error>
pub fn try_cast_nearest(self) -> Result<T, Error>
Try converting to the nearest integer Read more
pub fn try_cast_floor(self) -> Result<T, Error>
pub fn try_cast_floor(self) -> Result<T, Error>
Try converting the floor to an integer Read more
pub fn try_cast_ceil(self) -> Result<T, Error>
pub fn try_cast_ceil(self) -> Result<T, Error>
Try convert the ceiling to an integer Read more