Skip to main content

SymPalette

Struct SymPalette 

Source
pub struct SymPalette {
    pub c: [u32; 10],
}
Expand description

the colours of a symbol’s roles (straight 0xAARRGGBB, index = SYM_* role)

Fields§

§c: [u32; 10]

Implementations§

Source§

impl SymPalette

Source

pub fn from_theme(ui: &Ui, tint: u32) -> SymPalette

the palette of the current theme: high contrast, dark or light; tint = the category colour 0xRRGGBB as it looks in the light theme

Source

pub fn light(text: u32, bg: u32, tint: u32) -> SymPalette

the light scheme from the text and window colours (opaque): slate outlines, near-white bodies, pale steel screens

Source

pub fn dark(text: u32, bg: u32, tint: u32) -> SymPalette

the dark scheme: light grey outlines, bodies a step above the window, dark screens, the tint lighter and greyer

Source

pub fn contrast(ui: &Ui) -> SymPalette

high contrast: outlines and ports in the text colour, every fill in the window colour, the tint band in the highlight (accent) colour, LEDs in the status colours

Source

pub fn powered_off(&self) -> SymPalette

a device without power: status LEDs dark, screens off

Source

pub fn hash(&self) -> u32

FNV-1a of the colours (the cache key)

Trait Implementations§

Source§

impl Clone for SymPalette

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Copy for SymPalette

Source§

impl Debug for SymPalette

Source§

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

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

impl Eq for SymPalette

Source§

impl PartialEq for SymPalette

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for SymPalette

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.