pub struct Color { /* private fields */ }
Expand description
A color represented with a Mode.
Implementations§
Source§impl Color
impl Color
pub const ALICE_BLUE: Self
pub const ANTIQUE_WHITE: Self
pub const AQUA: Self
pub const AQUA_MARINE: Self
pub const AZURE: Self
pub const BEIGE: Self
pub const BISQUE: Self
pub const BLACK: Self
pub const BLANCHE_DALMOND: Self
pub const BLUE: Self
pub const BLUE_VIOLET: Self
pub const BROWN: Self
pub const BURLY_WOOD: Self
pub const CADET_BLUE: Self
pub const CHARTREUSE: Self
pub const CHOCOLATE: Self
pub const CORAL: Self
pub const CORNFLOWER_BLUE: Self
pub const CORN_SILK: Self
pub const CRIMSON: Self
pub const CYAN: Self
pub const DARK_BLUE: Self
pub const DARK_CYAN: Self
pub const DARK_GOLDENROD: Self
pub const DARK_GRAY: Self
pub const DARK_GREEN: Self
pub const DARK_GREY: Self
pub const DARK_KHAKI: Self
pub const DARK_MAGENTA: Self
pub const DARK_OLIVE_GREEN: Self
pub const DARK_ORANGE: Self
pub const DARK_ORCHID: Self
pub const DARK_RED: Self
pub const DARK_SALMON: Self
pub const DARK_SEA_GREEN: Self
pub const DARK_SLATE_BLUE: Self
pub const DARK_SLATE_GRAY: Self
pub const DARK_SLATE_GREY: Self
pub const DARK_TURQUOISE: Self
pub const DARK_VIOLET: Self
pub const DEEP_PINK: Self
pub const DEEP_SKY_BLUE: Self
pub const DIM_GRAY: Self
pub const DIM_GREY: Self
pub const DODGER_BLUE: Self
pub const FIRE_BRICK: Self
pub const FLORAL_WHITE: Self
pub const FOREST_GREEN: Self
pub const FUCHSIA: Self
pub const GAINSBORO: Self
pub const GHOST_WHITE: Self
pub const GOLD: Self
pub const GOLDENROD: Self
pub const GRAY: Self
pub const GREEN: Self
pub const GREEN_YELLOW: Self
pub const GREY: Self
pub const HONEYDEW: Self
pub const HOTOINK: Self
pub const INDIAN_RED: Self
pub const INDIGO: Self
pub const IVORY: Self
pub const KHAKI: Self
pub const LAVENDER: Self
pub const LAVENDER_BLUSH: Self
pub const LAWN_GREEN: Self
pub const LEMON_CHIFFON: Self
pub const LIGHT_BLUE: Self
pub const LIGHT_CORAL: Self
pub const LIGHT_CYAN: Self
pub const LIGHT_GOLDENROD_YELLOW: Self
pub const LIGHT_GRAY: Self
pub const LIGHT_GREEN: Self
pub const LIGHT_GREY: Self
pub const LIGHT_PINK: Self
pub const LIGHT_SALMON: Self
pub const LIGHT_SEA_GREEN: Self
pub const LIGHT_SKY_BLUE: Self
pub const LIGHT_SLATE_GRAY: Self
pub const LIGHT_SLATE_GREY: Self
pub const LIGHT_STEEL_BLUE: Self
pub const LIGHT_YELLOW: Self
pub const LIME: Self
pub const LIME_GREEN: Self
pub const LINEN: Self
pub const MAGENTA: Self
pub const MAROON: Self
pub const MEDIUMAQUA_MARINE: Self
pub const MEDIUM_BLUE: Self
pub const MEDIUM_ORCHID: Self
pub const MEDIUM_PURPLE: Self
pub const MEDIUM_SEA_GREEN: Self
pub const MEDIUM_SLATE_BLUE: Self
pub const MEDIUM_SPRING_GREEN: Self
pub const MEDIUM_TURQUOISE: Self
pub const MEDIUM_VIOLET_RED: Self
pub const MIDNIGHT_BLUE: Self
pub const MINT_CREAM: Self
pub const MISTY_ROSE: Self
pub const MOCCASIN: Self
pub const NAVAJO_WHITE: Self
pub const NAVY: Self
pub const OLD_LACE: Self
pub const OLIVE: Self
pub const OLIVE_DRAB: Self
pub const ORANGE: Self
pub const ORANGE_RED: Self
pub const ORCHID: Self
pub const PALE_GOLDENROD: Self
pub const PALE_GREEN: Self
pub const PALE_TURQUOISE: Self
pub const PALE_VIOLET_RED: Self
pub const PAPAYA_WHIP: Self
pub const PEACH_PUFF: Self
pub const PERU: Self
pub const PINK: Self
pub const PLUM: Self
pub const POWDER_BLUE: Self
pub const PURPLE: Self
pub const REBECCA_PURPLE: Self
pub const RED: Self
pub const ROSY_BROWN: Self
pub const ROYAL_BLUE: Self
pub const SADDLE_BROWN: Self
pub const SALMON: Self
pub const SANDY_BROWN: Self
pub const SEA_GREEN: Self
pub const SEA_SHELL: Self
pub const SIENNA: Self
pub const SILVER: Self
pub const SKY_BLUE: Self
pub const SLATE_BLUE: Self
pub const SLATE_GRAY: Self
pub const SLATE_GREY: Self
pub const SNOW: Self
pub const SPRING_GREEN: Self
pub const STEEL_BLUE: Self
pub const TAN: Self
pub const TEAL: Self
pub const THISTLE: Self
pub const TOMATO: Self
pub const TRANSPARENT: Self
pub const TURQUOISE: Self
pub const VIOLET: Self
pub const WHEAT: Self
pub const WHITE: Self
pub const WHITE_SMOKE: Self
pub const YELLOW: Self
pub const YELLOW_GREEN: Self
Source§impl Color
impl Color
Sourcepub fn from_slice<T, S>(mode: ColorMode, slice: S) -> PixResult<Self>
pub fn from_slice<T, S>(mode: ColorMode, slice: S) -> PixResult<Self>
Constructs a Color
from a slice of 1-4 values. The number of values
provided alter how they are interpreted similar to the color!, rgb!, hsb!, and
hsl! macros.
§Errors
If the slice is empty or has more than 4 values, an error is returned.
§Examples
let vals: Vec<f64> = vec![128.0, 64.0, 0.0];
let c = Color::from_slice(ColorMode::Rgb, &vals)?; // RGB Vec
assert_eq!(c.channels(), [128, 64, 0, 255]);
let vals: [f64; 4] = [128.0, 64.0, 0.0, 128.0];
let c = Color::from_slice(ColorMode::Rgb, &vals[..])?; // RGBA slice
assert_eq!(c.channels(), [128, 64, 0, 128]);
Sourcepub const fn from_hex_alpha(hex: u32) -> Self
pub const fn from_hex_alpha(hex: u32) -> Self
Sourcepub const fn inverted(&self) -> Self
pub const fn inverted(&self) -> Self
Constructs a Color
by inverting the RGBA values.
§Example
let c = Color::from_hex(0xF0FF00);
assert_eq!(c.inverted().as_hex(), 0x0F00FF);
Sourcepub fn blended<A>(&self, bg: Color, alpha: A) -> Self
pub fn blended<A>(&self, bg: Color, alpha: A) -> Self
Constructs an opaque Color
blended over a given background, using an alpha value.
Sourcepub fn lerp<A>(&self, other: Color, amt: A) -> Self
pub fn lerp<A>(&self, other: Color, amt: A) -> Self
Constructs a Color
by linear interpolating between two Color
s by a given amount between
0.0
and 1.0
.
§Examples
let from = rgb!(255, 0, 0);
let to = rgb!(0, 100, 255);
let lerped = from.lerp(to, 0.5);
assert_eq!(lerped.channels(), [128, 50, 128, 255]);
let from = rgb!(255, 0, 0);
let to = hsb!(120.0, 80.0, 100.0, 0.5);
let lerped = from.lerp(to, 0.25); // `to` is implicity converted to RGB
assert_eq!(lerped.channels(), [204, 64, 13, 223]);
Source§impl Color
impl Color
Sourcepub const fn new(r: u8, g: u8, b: u8) -> Self
pub const fn new(r: u8, g: u8, b: u8) -> Self
Constructs a Color
with red
, green
, blue
and max alpha
.
§Example
let c = Color::new(0, 0, 128);
assert_eq!(c.channels(), [0, 0, 128, 255]);
Sourcepub const fn new_alpha(r: u8, g: u8, b: u8, a: u8) -> Self
pub const fn new_alpha(r: u8, g: u8, b: u8, a: u8) -> Self
Constructs a Color
with red
, green
, blue
and alpha
.
§Example
let c = Color::new_alpha(0, 0, 128, 50);
assert_eq!(c.channels(), [0, 0, 128, 50]);
Sourcepub fn with_mode_alpha<T: Into<f64>>(
mode: Mode,
v1: T,
v2: T,
v3: T,
alpha: T,
) -> Self
pub fn with_mode_alpha<T: Into<f64>>( mode: Mode, v1: T, v2: T, v3: T, alpha: T, ) -> Self
Sourcepub const fn rgb(r: u8, g: u8, b: u8) -> Self
pub const fn rgb(r: u8, g: u8, b: u8) -> Self
Constructs a Color
with red
, green
, blue
and max alpha
.
Alias for Color::new.
§Example
let c = Color::rgb(128, 64, 0);
assert_eq!(c.channels(), [128, 64, 0, 255]);
Sourcepub const fn rgba(r: u8, g: u8, b: u8, a: u8) -> Self
pub const fn rgba(r: u8, g: u8, b: u8, a: u8) -> Self
Constructs a Color
with red
, green
, blue
and alpha
.
Alias for Color::new_alpha.
§Example
let c = Color::rgba(128, 64, 128, 128);
assert_eq!(c.channels(), [128, 64, 128, 128]);
Sourcepub fn hsb<T: Into<f64>>(h: T, s: T, b: T) -> Self
pub fn hsb<T: Into<f64>>(h: T, s: T, b: T) -> Self
Constructs a Color
with hue
, saturation
, brightness
and max alpha
.
§Example
let c = Color::hsb(126.0, 80.0, 50.0);
assert_eq!(c.channels(), [25, 128, 36, 255]);
Sourcepub fn hsba<T: Into<f64>>(h: T, s: T, b: T, a: T) -> Self
pub fn hsba<T: Into<f64>>(h: T, s: T, b: T, a: T) -> Self
Constructs a Color
with hue
, saturation
, brightness
and alpha
.
§Example
let c = Color::hsba(126.0, 80.0, 50.0, 0.5);
assert_eq!(c.channels(), [25, 128, 36, 128]);
Sourcepub fn hsl<T: Into<f64>>(h: T, s: T, l: T) -> Self
pub fn hsl<T: Into<f64>>(h: T, s: T, l: T) -> Self
Constructs a Color
with hue
, saturation
, lightness
and max alpha
.
§Example
let c = Color::hsl(126.0, 80.0, 50.0);
assert_eq!(c.channels(), [25, 230, 46, 255]);
Sourcepub fn hsla<T: Into<f64>>(h: T, s: T, l: T, a: T) -> Self
pub fn hsla<T: Into<f64>>(h: T, s: T, l: T, a: T) -> Self
Constructs a Color
with hue
, saturation
, lightness
and alpha
.
§Example
let c = Color::hsla(126.0, 80.0, 50.0, 0.5);
assert_eq!(c.channels(), [25, 230, 46, 128]);
Sourcepub fn from_levels<T: Into<f64>>(
mode: Mode,
v1: T,
v2: T,
v3: T,
alpha: T,
) -> Self
pub fn from_levels<T: Into<f64>>( mode: Mode, v1: T, v2: T, v3: T, alpha: T, ) -> Self
Sourcepub fn random() -> Self
pub fn random() -> Self
Constructs a random Color
with red
, green
, blue
and max alpha.
§Example
let c = Color::random();
// `c.channels()` will return something like:
// [207, 12, 217, 255]
Sourcepub fn random_alpha() -> Self
pub fn random_alpha() -> Self
Constructs a random Color
with red
, green
, blue
and alpha.
§Example
let c = Color::random_alpha();
// `c.channels()` will return something like:
// [132, 159, 233, 76]
Sourcepub const fn as_hex_alpha(&self) -> u32
pub const fn as_hex_alpha(&self) -> u32
Sourcepub const fn maxes(&self) -> [f64; 4]
pub const fn maxes(&self) -> [f64; 4]
Returns a list of max values for each color channel based on Mode.
§Examples
let c = Color::rgb(0, 0, 0);
assert_eq!(c.maxes(), [255.0, 255.0, 255.0, 255.0]);
let c = Color::hsb(0.0, 0.0, 0.0);
assert_eq!(c.maxes(), [360.0, 100.0, 100.0, 1.0]);
let c = Color::hsl(0.0, 0.0, 0.0);
assert_eq!(c.maxes(), [360.0, 100.0, 100.0, 1.0]);
Sourcepub fn levels(&self) -> [f64; 4]
pub fn levels(&self) -> [f64; 4]
Returns the Color
levels for the given Mode which range from 0.0..=1.0
.
Sourcepub fn set_levels(&mut self, levels: [f64; 4])
pub fn set_levels(&mut self, levels: [f64; 4])
Sourcepub const fn channels(&self) -> [u8; 4]
pub const fn channels(&self) -> [u8; 4]
Returns the Color
channels as [red, green, blue, alpha]
which range from 0..=255
.
§Example
let c = Color::rgba(128, 64, 128, 128);
assert_eq!(c.channels(), [128, 64, 128, 128]);
Sourcepub const fn red(&self) -> u8
pub const fn red(&self) -> u8
Returns the red Color
channel ranging from 0..=255
.
§Example
let c = Color::rgb(100, 0, 0);
assert_eq!(c.red(), 100);
Sourcepub fn set_red(&mut self, r: u8)
pub fn set_red(&mut self, r: u8)
Set the red Color
channel ranging from 0..=255
.
§Example
let mut c = Color::default();
assert_eq!(c.channels(), [0, 0, 0, 255]);
c.set_red(100);
assert_eq!(c.channels(), [100, 0, 0, 255]);
Sourcepub const fn green(&self) -> u8
pub const fn green(&self) -> u8
Returns the green Color
channel ranging from 0..=255
.
§Example
let c = Color::rgb(0, 100, 0);
assert_eq!(c.green(), 100);
Sourcepub fn set_green(&mut self, g: u8)
pub fn set_green(&mut self, g: u8)
Set the green Color
channel ranging from 0..=255
.
§Example
let mut c = Color::default();
assert_eq!(c.channels(), [0, 0, 0, 255]);
c.set_green(100);
assert_eq!(c.channels(), [0, 100, 0, 255]);
Sourcepub const fn blue(&self) -> u8
pub const fn blue(&self) -> u8
Returns the blue Color
channel ranging from 0..=255
.
§Example
let c = Color::rgb(0, 0, 100);
assert_eq!(c.blue(), 100);
Sourcepub fn set_blue(&mut self, b: u8)
pub fn set_blue(&mut self, b: u8)
Set the blue Color
channel ranging from 0..=255
.
§Example
let mut c = Color::default();
assert_eq!(c.channels(), [0, 0, 0, 255]);
c.set_blue(100);
assert_eq!(c.channels(), [0, 0, 100, 255]);
Sourcepub const fn alpha(&self) -> u8
pub const fn alpha(&self) -> u8
Returns the alpha Color
channel ranging from 0..=255
.
§Examples
let c = Color::rgba(0, 0, 0, 100);
assert_eq!(c.alpha(), 100);
Sourcepub fn set_alpha(&mut self, a: u8)
pub fn set_alpha(&mut self, a: u8)
Set the alpha Color
channel ranging from 0..=255
.
§Examples
let mut c = Color::default();
assert_eq!(c.channels(), [0, 0, 0, 255]);
c.set_alpha(100);
assert_eq!(c.channels(), [0, 0, 0, 100]);
Sourcepub fn hue(&self) -> f64
pub fn hue(&self) -> f64
Returns the hue ranging from 0.0..=360.0
.
§Example
let c = Color::rgb(0, 100, 0);
assert_eq!(c.hue(), 120.0);
Sourcepub fn set_hue<H: Into<f64>>(&mut self, h: H)
pub fn set_hue<H: Into<f64>>(&mut self, h: H)
Set the hue ranging from 0.0..=360.0
.
§Example
let mut c = Color::rgb(128, 0, 0);
assert_eq!(c.channels(), [128, 0, 0, 255]);
c.set_hue(100.0);
assert_eq!(c.channels(), [43, 128, 0, 255]);
Sourcepub fn saturation(&self) -> f64
pub fn saturation(&self) -> f64
Returns the saturation ranging from 0.0..=100.0
.
§Example
let c = Color::rgb(0, 100, 0);
assert_eq!(c.saturation(), 100.0);
Sourcepub fn set_saturation<S: Into<f64>>(&mut self, s: S)
pub fn set_saturation<S: Into<f64>>(&mut self, s: S)
Set the saturation ranging from 0.0..=100.0
. Defaults to Hsb if the
current mode is not Hsb or Hsl already.
§Examples
let mut c = Color::rgb(128, 0, 0);
assert_eq!(c.channels(), [128, 0, 0, 255]);
c.set_saturation(50.0);
assert_eq!(c.channels(), [128, 64, 64, 255]);
let mut c = Color::rgb(128, 0, 0);
c.set_mode(ColorMode::Hsl);
assert_eq!(c.channels(), [128, 0, 0, 255]);
c.set_saturation(50.0);
assert_eq!(c.channels(), [96, 32, 32, 255]);
Sourcepub fn brightness(&self) -> f64
pub fn brightness(&self) -> f64
Returns the brightness ranging from 0.0..=100.0
.
§Example
let c = Color::rgb(0, 102, 0);
assert_eq!(c.brightness(), 40.0);
Sourcepub fn set_brightness<B: Into<f64>>(&mut self, b: B)
pub fn set_brightness<B: Into<f64>>(&mut self, b: B)
Set the brightness ranging from 0.0..=100.0
.
§Example
let mut c = Color::rgb(128, 0, 0);
assert_eq!(c.channels(), [128, 0, 0, 255]);
c.set_brightness(90.0);
assert_eq!(c.channels(), [230, 0, 0, 255]);
Sourcepub fn lightness(&self) -> f64
pub fn lightness(&self) -> f64
Returns the lightness ranging from 0.0..=100.0
.
§Example
let c = Color::rgb(0, 102, 0);
assert_eq!(c.lightness(), 20.0);
Sourcepub fn set_lightness<L: Into<f64>>(&mut self, l: L)
pub fn set_lightness<L: Into<f64>>(&mut self, l: L)
Set the lightness ranging from 0.0..=100.0
.
§Example
let mut c = Color::rgb(128, 0, 0);
assert_eq!(c.channels(), [128, 0, 0, 255]);
c.set_lightness(90.0);
assert_eq!(c.channels(), [255, 204, 204, 255]);
Trait Implementations§
Source§impl AddAssign<u8> for Color
impl AddAssign<u8> for Color
Source§fn add_assign(&mut self, val: u8)
fn add_assign(&mut self, val: u8)
+=
operation. Read moreSource§impl AddAssign for Color
impl AddAssign for Color
Source§fn add_assign(&mut self, other: Color)
fn add_assign(&mut self, other: Color)
+=
operation. Read moreSource§impl<'de> Deserialize<'de> for Color
impl<'de> Deserialize<'de> for Color
Source§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>,
Source§impl DivAssign<f32> for Color
impl DivAssign<f32> for Color
Source§fn div_assign(&mut self, s: f32)
fn div_assign(&mut self, s: f32)
/=
operation. Read moreSource§impl DivAssign<f64> for Color
impl DivAssign<f64> for Color
Source§fn div_assign(&mut self, s: f64)
fn div_assign(&mut self, s: f64)
/=
operation. Read moreSource§impl DivAssign<i128> for Color
impl DivAssign<i128> for Color
Source§fn div_assign(&mut self, s: i128)
fn div_assign(&mut self, s: i128)
/=
operation. Read moreSource§impl DivAssign<i16> for Color
impl DivAssign<i16> for Color
Source§fn div_assign(&mut self, s: i16)
fn div_assign(&mut self, s: i16)
/=
operation. Read moreSource§impl DivAssign<i32> for Color
impl DivAssign<i32> for Color
Source§fn div_assign(&mut self, s: i32)
fn div_assign(&mut self, s: i32)
/=
operation. Read moreSource§impl DivAssign<i64> for Color
impl DivAssign<i64> for Color
Source§fn div_assign(&mut self, s: i64)
fn div_assign(&mut self, s: i64)
/=
operation. Read moreSource§impl DivAssign<i8> for Color
impl DivAssign<i8> for Color
Source§fn div_assign(&mut self, s: i8)
fn div_assign(&mut self, s: i8)
/=
operation. Read moreSource§impl DivAssign<isize> for Color
impl DivAssign<isize> for Color
Source§fn div_assign(&mut self, s: isize)
fn div_assign(&mut self, s: isize)
/=
operation. Read moreSource§impl DivAssign<u128> for Color
impl DivAssign<u128> for Color
Source§fn div_assign(&mut self, s: u128)
fn div_assign(&mut self, s: u128)
/=
operation. Read moreSource§impl DivAssign<u16> for Color
impl DivAssign<u16> for Color
Source§fn div_assign(&mut self, s: u16)
fn div_assign(&mut self, s: u16)
/=
operation. Read moreSource§impl DivAssign<u32> for Color
impl DivAssign<u32> for Color
Source§fn div_assign(&mut self, s: u32)
fn div_assign(&mut self, s: u32)
/=
operation. Read moreSource§impl DivAssign<u64> for Color
impl DivAssign<u64> for Color
Source§fn div_assign(&mut self, s: u64)
fn div_assign(&mut self, s: u64)
/=
operation. Read moreSource§impl DivAssign<u8> for Color
impl DivAssign<u8> for Color
Source§fn div_assign(&mut self, s: u8)
fn div_assign(&mut self, s: u8)
/=
operation. Read moreSource§impl DivAssign<usize> for Color
impl DivAssign<usize> for Color
Source§fn div_assign(&mut self, s: usize)
fn div_assign(&mut self, s: usize)
/=
operation. Read moreSource§impl FromStr for Color
impl FromStr for Color
Source§fn from_str(string: &str) -> Result<Self, Self::Err>
fn from_str(string: &str) -> Result<Self, Self::Err>
Converts to Color from a hexadecimal string.
§Examples
use std::str::FromStr;
let c = Color::from_str("#F0F")?; // 3-digit Hex string
assert_eq!(c.channels(), [255, 0, 255, 255]);
let c = Color::from_str("#F0F5")?; // 4-digit Hex string
assert_eq![c.channels(), [255, 0, 255, 85]];
let c = Color::from_str("#F0F5BF")?; // 6-digit Hex string
assert_eq!(c.channels(), [240, 245, 191, 255]);
let c = Color::from_str("#F0F5BF5F")?; // 8-digit Hex string
assert_eq!(c.channels(), [240, 245, 191, 95]);
Source§impl MulAssign<f32> for Color
impl MulAssign<f32> for Color
Source§fn mul_assign(&mut self, s: f32)
fn mul_assign(&mut self, s: f32)
*=
operation. Read moreSource§impl MulAssign<f64> for Color
impl MulAssign<f64> for Color
Source§fn mul_assign(&mut self, s: f64)
fn mul_assign(&mut self, s: f64)
*=
operation. Read moreSource§impl MulAssign<i128> for Color
impl MulAssign<i128> for Color
Source§fn mul_assign(&mut self, s: i128)
fn mul_assign(&mut self, s: i128)
*=
operation. Read moreSource§impl MulAssign<i16> for Color
impl MulAssign<i16> for Color
Source§fn mul_assign(&mut self, s: i16)
fn mul_assign(&mut self, s: i16)
*=
operation. Read moreSource§impl MulAssign<i32> for Color
impl MulAssign<i32> for Color
Source§fn mul_assign(&mut self, s: i32)
fn mul_assign(&mut self, s: i32)
*=
operation. Read moreSource§impl MulAssign<i64> for Color
impl MulAssign<i64> for Color
Source§fn mul_assign(&mut self, s: i64)
fn mul_assign(&mut self, s: i64)
*=
operation. Read moreSource§impl MulAssign<i8> for Color
impl MulAssign<i8> for Color
Source§fn mul_assign(&mut self, s: i8)
fn mul_assign(&mut self, s: i8)
*=
operation. Read moreSource§impl MulAssign<isize> for Color
impl MulAssign<isize> for Color
Source§fn mul_assign(&mut self, s: isize)
fn mul_assign(&mut self, s: isize)
*=
operation. Read moreSource§impl MulAssign<u128> for Color
impl MulAssign<u128> for Color
Source§fn mul_assign(&mut self, s: u128)
fn mul_assign(&mut self, s: u128)
*=
operation. Read moreSource§impl MulAssign<u16> for Color
impl MulAssign<u16> for Color
Source§fn mul_assign(&mut self, s: u16)
fn mul_assign(&mut self, s: u16)
*=
operation. Read moreSource§impl MulAssign<u32> for Color
impl MulAssign<u32> for Color
Source§fn mul_assign(&mut self, s: u32)
fn mul_assign(&mut self, s: u32)
*=
operation. Read moreSource§impl MulAssign<u64> for Color
impl MulAssign<u64> for Color
Source§fn mul_assign(&mut self, s: u64)
fn mul_assign(&mut self, s: u64)
*=
operation. Read moreSource§impl MulAssign<u8> for Color
impl MulAssign<u8> for Color
Source§fn mul_assign(&mut self, s: u8)
fn mul_assign(&mut self, s: u8)
*=
operation. Read moreSource§impl MulAssign<usize> for Color
impl MulAssign<usize> for Color
Source§fn mul_assign(&mut self, s: usize)
fn mul_assign(&mut self, s: usize)
*=
operation. Read moreSource§impl SubAssign<u8> for Color
impl SubAssign<u8> for Color
Source§fn sub_assign(&mut self, val: u8)
fn sub_assign(&mut self, val: u8)
-=
operation. Read moreSource§impl SubAssign for Color
impl SubAssign for Color
Source§fn sub_assign(&mut self, other: Color)
fn sub_assign(&mut self, other: Color)
-=
operation. Read moreimpl Copy for Color
impl Eq for Color
Auto Trait Implementations§
impl Freeze for Color
impl RefUnwindSafe for Color
impl Send for Color
impl Sync for Color
impl Unpin for Color
impl UnwindSafe for Color
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.