Struct cosmic::cosmic_theme::Theme

source ·
pub struct Theme {
Show 26 fields pub name: String, pub background: Container, pub primary: Container, pub secondary: Container, pub accent: Component, pub success: Component, pub destructive: Component, pub warning: Component, pub accent_button: Component, pub success_button: Component, pub destructive_button: Component, pub warning_button: Component, pub icon_button: Component, pub link_button: Component, pub text_button: Component, pub button: Component, pub palette: CosmicPaletteInner, pub spacing: Spacing, pub corner_radii: CornerRadii, pub is_dark: bool, pub is_high_contrast: bool, pub gaps: (u32, u32), pub active_hint: u32, pub window_hint: Option<Rgb>, pub is_frosted: bool, pub shade: Alpha<Rgb, f32>,
}
Expand description

Cosmic Theme data structure with all colors and its name

Fields§

§name: String

name of the theme

§background: Container

background element colors

§primary: Container

primary element colors

§secondary: Container

secondary element colors

§accent: Component

accent element colors

§success: Component

suggested element colors

§destructive: Component

destructive element colors

§warning: Component

warning element colors

§accent_button: Component

accent button element colors

§success_button: Component

suggested button element colors

§destructive_button: Component

destructive button element colors

§warning_button: Component

warning button element colors

§icon_button: Component

icon button element colors

§link_button: Component

link button element colors

§text_button: Component

text button element colors

§button: Component

button component styling

§palette: CosmicPaletteInner

palette

§spacing: Spacing

spacing

§corner_radii: CornerRadii

corner radii

§is_dark: bool

is dark

§is_high_contrast: bool

is high contrast

§gaps: (u32, u32)

cosmic-comp window gaps size (outer, inner)

§active_hint: u32

cosmic-comp active hint window outline width

§window_hint: Option<Rgb>

cosmic-comp custom window hint color

§is_frosted: bool

enables blurred transparency

§shade: Alpha<Rgb, f32>

shade color for dialogs

Implementations§

source§

impl Theme

source

pub fn set_name( &mut self, config: &Config, value: String, ) -> Result<bool, Error>

Sets Theme::name and writes to cosmic_config::Config if changed

Returns Ok(true) when the field’s value has changed and was written to disk

source

pub fn set_background( &mut self, config: &Config, value: Container, ) -> Result<bool, Error>

Sets Theme::background and writes to cosmic_config::Config if changed

Returns Ok(true) when the field’s value has changed and was written to disk

source

pub fn set_primary( &mut self, config: &Config, value: Container, ) -> Result<bool, Error>

Sets Theme::primary and writes to cosmic_config::Config if changed

Returns Ok(true) when the field’s value has changed and was written to disk

source

pub fn set_secondary( &mut self, config: &Config, value: Container, ) -> Result<bool, Error>

Sets Theme::secondary and writes to cosmic_config::Config if changed

Returns Ok(true) when the field’s value has changed and was written to disk

source

pub fn set_accent( &mut self, config: &Config, value: Component, ) -> Result<bool, Error>

Sets Theme::accent and writes to cosmic_config::Config if changed

Returns Ok(true) when the field’s value has changed and was written to disk

source

pub fn set_success( &mut self, config: &Config, value: Component, ) -> Result<bool, Error>

Sets Theme::success and writes to cosmic_config::Config if changed

Returns Ok(true) when the field’s value has changed and was written to disk

source

pub fn set_destructive( &mut self, config: &Config, value: Component, ) -> Result<bool, Error>

Sets Theme::destructive and writes to cosmic_config::Config if changed

Returns Ok(true) when the field’s value has changed and was written to disk

source

pub fn set_warning( &mut self, config: &Config, value: Component, ) -> Result<bool, Error>

Sets Theme::warning and writes to cosmic_config::Config if changed

Returns Ok(true) when the field’s value has changed and was written to disk

source

pub fn set_accent_button( &mut self, config: &Config, value: Component, ) -> Result<bool, Error>

Sets Theme::accent_button and writes to cosmic_config::Config if changed

Returns Ok(true) when the field’s value has changed and was written to disk

source

pub fn set_success_button( &mut self, config: &Config, value: Component, ) -> Result<bool, Error>

Sets Theme::success_button and writes to cosmic_config::Config if changed

Returns Ok(true) when the field’s value has changed and was written to disk

source

pub fn set_destructive_button( &mut self, config: &Config, value: Component, ) -> Result<bool, Error>

Sets Theme::destructive_button and writes to cosmic_config::Config if changed

Returns Ok(true) when the field’s value has changed and was written to disk

source

pub fn set_warning_button( &mut self, config: &Config, value: Component, ) -> Result<bool, Error>

Sets Theme::warning_button and writes to cosmic_config::Config if changed

Returns Ok(true) when the field’s value has changed and was written to disk

source

pub fn set_icon_button( &mut self, config: &Config, value: Component, ) -> Result<bool, Error>

Sets Theme::icon_button and writes to cosmic_config::Config if changed

Returns Ok(true) when the field’s value has changed and was written to disk

Sets Theme::link_button and writes to cosmic_config::Config if changed

Returns Ok(true) when the field’s value has changed and was written to disk

source

pub fn set_text_button( &mut self, config: &Config, value: Component, ) -> Result<bool, Error>

Sets Theme::text_button and writes to cosmic_config::Config if changed

Returns Ok(true) when the field’s value has changed and was written to disk

source

pub fn set_button( &mut self, config: &Config, value: Component, ) -> Result<bool, Error>

Sets Theme::button and writes to cosmic_config::Config if changed

Returns Ok(true) when the field’s value has changed and was written to disk

source

pub fn set_palette( &mut self, config: &Config, value: CosmicPaletteInner, ) -> Result<bool, Error>

Sets Theme::palette and writes to cosmic_config::Config if changed

Returns Ok(true) when the field’s value has changed and was written to disk

source

pub fn set_spacing( &mut self, config: &Config, value: Spacing, ) -> Result<bool, Error>

Sets Theme::spacing and writes to cosmic_config::Config if changed

Returns Ok(true) when the field’s value has changed and was written to disk

source

pub fn set_corner_radii( &mut self, config: &Config, value: CornerRadii, ) -> Result<bool, Error>

Sets Theme::corner_radii and writes to cosmic_config::Config if changed

Returns Ok(true) when the field’s value has changed and was written to disk

source

pub fn set_is_dark( &mut self, config: &Config, value: bool, ) -> Result<bool, Error>

Sets Theme::is_dark and writes to cosmic_config::Config if changed

Returns Ok(true) when the field’s value has changed and was written to disk

source

pub fn set_is_high_contrast( &mut self, config: &Config, value: bool, ) -> Result<bool, Error>

Sets Theme::is_high_contrast and writes to cosmic_config::Config if changed

Returns Ok(true) when the field’s value has changed and was written to disk

source

pub fn set_gaps( &mut self, config: &Config, value: (u32, u32), ) -> Result<bool, Error>

Sets Theme::gaps and writes to cosmic_config::Config if changed

Returns Ok(true) when the field’s value has changed and was written to disk

source

pub fn set_active_hint( &mut self, config: &Config, value: u32, ) -> Result<bool, Error>

Sets Theme::active_hint and writes to cosmic_config::Config if changed

Returns Ok(true) when the field’s value has changed and was written to disk

source

pub fn set_window_hint( &mut self, config: &Config, value: Option<Rgb>, ) -> Result<bool, Error>

Sets Theme::window_hint and writes to cosmic_config::Config if changed

Returns Ok(true) when the field’s value has changed and was written to disk

source

pub fn set_is_frosted( &mut self, config: &Config, value: bool, ) -> Result<bool, Error>

Sets Theme::is_frosted and writes to cosmic_config::Config if changed

Returns Ok(true) when the field’s value has changed and was written to disk

source

pub fn set_shade( &mut self, config: &Config, value: Alpha<Rgb, f32>, ) -> Result<bool, Error>

Sets Theme::shade and writes to cosmic_config::Config if changed

Returns Ok(true) when the field’s value has changed and was written to disk

source§

impl Theme

source

pub fn id() -> &'static str

id of the theme

source

pub fn dark_config() -> Result<Config, Error>

Get the config for the current dark theme

source

pub fn light_config() -> Result<Config, Error>

Get the config for the current light theme

source

pub fn light_default() -> Theme

get the built in light theme

source

pub fn dark_default() -> Theme

get the built in dark theme

source

pub fn high_contrast_dark_default() -> Theme

get the built in high contrast dark theme

source

pub fn high_contrast_light_default() -> Theme

get the built in high contrast light theme

source

pub fn to_high_contrast(&self) -> Theme

Convert the theme to a high-contrast variant

source

pub fn accent_color(&self) -> Alpha<Rgb, f32>

get @accent_color

source

pub fn success_color(&self) -> Alpha<Rgb, f32>

get @success_color

source

pub fn destructive_color(&self) -> Alpha<Rgb, f32>

get @destructive_color

source

pub fn warning_color(&self) -> Alpha<Rgb, f32>

get @warning_color

source

pub fn small_widget_divider(&self) -> Alpha<Rgb, f32>

get @small_widget_divider

source

pub fn bg_color(&self) -> Alpha<Rgb, f32>

get @bg_color

source

pub fn bg_component_color(&self) -> Alpha<Rgb, f32>

get @bg_component_color

source

pub fn primary_container_color(&self) -> Alpha<Rgb, f32>

get @primary_container_color

source

pub fn primary_component_color(&self) -> Alpha<Rgb, f32>

get @primary_component_color

source

pub fn secondary_container_color(&self) -> Alpha<Rgb, f32>

get @secondary_container_color

source

pub fn secondary_component_color(&self) -> Alpha<Rgb, f32>

get @secondary_component_color

source

pub fn button_bg_color(&self) -> Alpha<Rgb, f32>

get @button_bg_color

source

pub fn on_bg_color(&self) -> Alpha<Rgb, f32>

get @on_bg_color

source

pub fn on_bg_component_color(&self) -> Alpha<Rgb, f32>

get @on_bg_component_color

source

pub fn on_primary_container_color(&self) -> Alpha<Rgb, f32>

get @on_primary_color

source

pub fn on_primary_component_color(&self) -> Alpha<Rgb, f32>

get @on_primary_component_color

source

pub fn on_secondary_container_color(&self) -> Alpha<Rgb, f32>

get @on_secondary_color

source

pub fn on_secondary_component_color(&self) -> Alpha<Rgb, f32>

get @on_secondary_component_color

source

pub fn accent_text_color(&self) -> Alpha<Rgb, f32>

get @accent_text_color

source

pub fn success_text_color(&self) -> Alpha<Rgb, f32>

get @success_text_color

source

pub fn warning_text_color(&self) -> Alpha<Rgb, f32>

get @warning_text_color

source

pub fn destructive_text_color(&self) -> Alpha<Rgb, f32>

get @destructive_text_color

source

pub fn on_accent_color(&self) -> Alpha<Rgb, f32>

get @on_accent_color

source

pub fn on_success_color(&self) -> Alpha<Rgb, f32>

get @on_success_color

source

pub fn on_warning_color(&self) -> Alpha<Rgb, f32>

get @on_warning_color

source

pub fn on_destructive_color(&self) -> Alpha<Rgb, f32>

get @on_destructive_color

source

pub fn button_color(&self) -> Alpha<Rgb, f32>

get @button_color

source

pub fn bg_divider(&self) -> Alpha<Rgb, f32>

get @bg_divider

source

pub fn bg_component_divider(&self) -> Alpha<Rgb, f32>

get @bg_component_divider

source

pub fn primary_container_divider(&self) -> Alpha<Rgb, f32>

get @primary_container_divider

source

pub fn primary_component_divider(&self) -> Alpha<Rgb, f32>

get @primary_component_divider

source

pub fn secondary_container_divider(&self) -> Alpha<Rgb, f32>

get @secondary_container_divider

source

pub fn button_divider(&self) -> Alpha<Rgb, f32>

get @button_divider

source

pub fn window_header_bg(&self) -> Alpha<Rgb, f32>

get @window_header_bg

source

pub fn space_none(&self) -> u16

get @space_none

source

pub fn space_xxxs(&self) -> u16

get @space_xxxs

source

pub fn space_xxs(&self) -> u16

get @space_xxs

source

pub fn space_xs(&self) -> u16

get @space_xs

source

pub fn space_s(&self) -> u16

get @space_s

source

pub fn space_m(&self) -> u16

get @space_m

source

pub fn space_l(&self) -> u16

get @space_l

source

pub fn space_xl(&self) -> u16

get @space_xl

source

pub fn space_xxl(&self) -> u16

get @space_xxl

source

pub fn space_xxxl(&self) -> u16

get @space_xxxl

source

pub fn radius_0(&self) -> [f32; 4]

get @radius_0

source

pub fn radius_xs(&self) -> [f32; 4]

get @radius_xs

source

pub fn radius_s(&self) -> [f32; 4]

get @radius_s

source

pub fn radius_m(&self) -> [f32; 4]

get @radius_m

source

pub fn radius_l(&self) -> [f32; 4]

get @radius_l

source

pub fn radius_xl(&self) -> [f32; 4]

get @radius_xl

source

pub fn shade_color(&self) -> Alpha<Rgb, f32>

get @shade_color

source

pub fn get_active() -> Result<Theme, (Vec<Error>, Theme)>

get the active theme

source

pub fn with_accent(&self, c: Alpha<Rgb, f32>) -> Theme

Rebuild the current theme with the provided accent

source

pub fn gtk_prefer_colorscheme() -> Theme

choose default color palette based on preferred GTK color scheme

source

pub fn preferred_theme() -> Theme

check current desktop environment and preferred color scheme and set it as default

source§

impl Theme

source

pub fn as_gtk4(&self) -> String

turn the theme into css

source

pub fn write_gtk4(&self) -> Result<(), OutputError>

write the CSS to the appropriate directory Should be written in the XDG config directory for gtk-4.0

§Errors

Returns an OutputError if there is an error writing the CSS file.

source

pub fn apply_gtk(is_dark: bool) -> Result<(), OutputError>

Apply gtk color variable settings

source

pub fn reset_gtk() -> Result<(), OutputError>

Reset the applied gtk css

source§

impl Theme

source

pub fn apply_vs_code(self) -> Result<(), OutputError>

source

pub fn reset_vs_code() -> Result<(), OutputError>

source§

impl Theme

source

pub fn apply_exports(&self) -> Result<(), OutputError>

source

pub fn write_exports(&self) -> Result<(), OutputError>

source

pub fn reset_exports() -> Result<(), OutputError>

Trait Implementations§

source§

impl Clone for Theme

source§

fn clone(&self) -> Theme

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more
source§

impl CosmicConfigEntry for Theme

source§

const VERSION: u64 = 1u64

source§

fn write_entry(&self, config: &Config) -> Result<(), Error>

source§

fn get_entry(config: &Config) -> Result<Theme, (Vec<Error>, Theme)>

source§

fn update_keys<T>( &mut self, config: &Config, changed_keys: &[T], ) -> (Vec<Error>, Vec<&'static str>)
where T: AsRef<str>,

Returns the keys that were updated
source§

impl Debug for Theme

source§

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

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

impl Default for Theme

source§

fn default() -> Theme

Returns the “default value” for a type. Read more
source§

impl<'de> Deserialize<'de> for Theme

source§

fn deserialize<__D>( __deserializer: __D, ) -> Result<Theme, <__D as Deserializer<'de>>::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl From<CosmicPalette> for Theme

source§

fn from(p: CosmicPalette) -> Theme

Converts to this type from the input type.
source§

impl PartialEq for Theme

source§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Serialize for Theme

source§

fn serialize<__S>( &self, __serializer: __S, ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl StructuralPartialEq for Theme

Auto Trait Implementations§

§

impl Freeze for Theme

§

impl RefUnwindSafe for Theme

§

impl Send for Theme

§

impl Sync for Theme

§

impl Unpin for Theme

§

impl UnwindSafe for Theme

Blanket Implementations§

source§

impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S
where T: Real + Zero + Arithmetics + Clone, Swp: WhitePoint<T>, Dwp: WhitePoint<T>, D: AdaptFrom<S, Swp, Dwp, T>,

source§

fn adapt_into_using<M>(self, method: M) -> D
where M: TransformMatrix<T>,

Convert the source color to the destination color using the specified method.
source§

fn adapt_into(self) -> D

Convert the source color to the destination color using the bradford method by default.
source§

impl<T> Also for T

source§

fn also<F>(self, block: F) -> Self
where F: FnOnce(&mut Self),

Apply a function to this value and return the (possibly) modified value.
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, Res> Apply<Res> for T
where T: ?Sized,

source§

fn apply<F>(self, f: F) -> Res
where F: FnOnce(Self) -> Res, Self: Sized,

Apply a function which takes the parameter by value.
source§

fn apply_ref<F>(&self, f: F) -> Res
where F: FnOnce(&Self) -> Res,

Apply a function which takes the parameter by reference.
source§

fn apply_mut<F>(&mut self, f: F) -> Res
where F: FnOnce(&mut Self) -> Res,

Apply a function which takes the parameter by mutable reference.
source§

impl<T, C> ArraysFrom<C> for T
where C: IntoArrays<T>,

source§

fn arrays_from(colors: C) -> T

Cast a collection of colors into a collection of arrays.
source§

impl<T, C> ArraysInto<C> for T
where C: FromArrays<T>,

source§

fn arrays_into(self) -> C

Cast this collection of arrays into a collection of colors.
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<WpParam, T, U> Cam16IntoUnclamped<WpParam, T> for U
where T: FromCam16Unclamped<WpParam, U>,

§

type Scalar = <T as FromCam16Unclamped<WpParam, U>>::Scalar

The number type that’s used in parameters when converting.
source§

fn cam16_into_unclamped( self, parameters: BakedParameters<WpParam, <U as Cam16IntoUnclamped<WpParam, T>>::Scalar>, ) -> T

Converts self into C, using the provided parameters.
source§

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

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

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

impl<T, C> ComponentsFrom<C> for T
where C: IntoComponents<T>,

source§

fn components_from(colors: C) -> T

Cast a collection of colors into a collection of color components.
source§

impl<T> Downcast for T
where T: Any,

source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
source§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
source§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> FromAngle<T> for T

source§

fn from_angle(angle: T) -> T

Performs a conversion from angle.
source§

impl<T, U> FromStimulus<U> for T
where U: IntoStimulus<T>,

source§

fn from_stimulus(other: U) -> T

Converts other into Self, while performing the appropriate scaling, rounding and clamping.
source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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, U> IntoAngle<U> for T
where U: FromAngle<T>,

source§

fn into_angle(self) -> U

Performs a conversion into T.
source§

impl<WpParam, T, U> IntoCam16Unclamped<WpParam, T> for U
where T: Cam16FromUnclamped<WpParam, U>,

§

type Scalar = <T as Cam16FromUnclamped<WpParam, U>>::Scalar

The number type that’s used in parameters when converting.
source§

fn into_cam16_unclamped( self, parameters: BakedParameters<WpParam, <U as IntoCam16Unclamped<WpParam, T>>::Scalar>, ) -> T

Converts self into C, using the provided parameters.
source§

impl<T, U> IntoColor<U> for T
where U: FromColor<T>,

source§

fn into_color(self) -> U

Convert into T with values clamped to the color defined bounds Read more
source§

impl<T, U> IntoColorUnclamped<U> for T
where U: FromColorUnclamped<T>,

source§

fn into_color_unclamped(self) -> U

Convert into T. The resulting color might be invalid in its color space Read more
source§

impl<T> IntoEither for T

source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

impl<T> IntoStimulus<T> for T

source§

fn into_stimulus(self) -> T

Converts self into T, while performing the appropriate scaling, rounding and clamping.
source§

impl<T> Pointable for T

source§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<R, P> ReadPrimitive<R> for P
where R: Read + ReadEndian<P>, P: Default,

source§

fn read_from_little_endian(read: &mut R) -> Result<Self, Error>

Read this value from the supplied reader. Same as ReadEndian::read_from_little_endian().
source§

fn read_from_big_endian(read: &mut R) -> Result<Self, Error>

Read this value from the supplied reader. Same as ReadEndian::read_from_big_endian().
source§

fn read_from_native_endian(read: &mut R) -> Result<Self, Error>

Read this value from the supplied reader. Same as ReadEndian::read_from_native_endian().
source§

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

§

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, C> TryComponentsInto<C> for T
where C: TryFromComponents<T>,

§

type Error = <C as TryFromComponents<T>>::Error

The error for when try_into_colors fails to cast.
source§

fn try_components_into(self) -> Result<C, <T as TryComponentsInto<C>>::Error>

Try to cast this collection of color components into a collection of colors. Read more
source§

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

§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

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

§

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.
source§

impl<T, U> TryIntoColor<U> for T
where U: TryFromColor<T>,

source§

fn try_into_color(self) -> Result<U, OutOfBounds<U>>

Convert into T, returning ok if the color is inside of its defined range, otherwise an OutOfBounds error is returned which contains the unclamped color. Read more
source§

impl<C, U> UintsFrom<C> for U
where C: IntoUints<U>,

source§

fn uints_from(colors: C) -> U

Cast a collection of colors into a collection of unsigned integers.
source§

impl<C, U> UintsInto<C> for U
where C: FromUints<U>,

source§

fn uints_into(self) -> C

Cast this collection of unsigned integers into a collection of colors.
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

source§

impl<T> MaybeSend for T
where T: Send,

source§

impl<T> MaybeSync for T
where T: Sync,