[−][src]Struct polyhorn_ui::color::Color
A color in a color-space with an associated alpha channel.
Implementations
impl Color
[src]
pub fn rgba(red: u8, green: u8, blue: u8, alpha: f32) -> Color
[src]
This function returns a new translucent color in the sRGB color space with the given coordinates and alpha channel.
pub fn rgb(red: u8, green: u8, blue: u8) -> Color
[src]
This function returns a new opaque color in the sRGB color space with the given coordinates.
pub fn hexa(hex: u32, alpha: f32) -> Color
[src]
This function returns a new translucent color in the sRGB color space with the given hex-encoded coordinates.
pub fn hex(hex: u32) -> Color
[src]
This function returns a new opaque color in the sRGB color space with the given hex-encoded coordinates.
pub fn hsla(hue: f32, saturation: f32, lightness: f32, alpha: f32) -> Color
[src]
This function returns a new translucent color in the sRGB color space with the given coordinates after converting from the alternative HSL representation to RGB.
pub fn hsl(hue: f32, saturation: f32, lightness: f32) -> Color
[src]
This function returns a new opaque color in the sRGB color space with the given coordinates after converting from the alternative HSL representation to RGB.
pub fn display_p3_rgba(red: u8, green: u8, blue: u8, alpha: f32) -> Color
[src]
This function returns a new translucent color in the Display-P3 color space with the given coordinates and alpha channel.
pub fn display_p3_rgb(red: u8, green: u8, blue: u8) -> Color
[src]
This functions returns a new opaque color in the Display-P3 color space with the given coordinates.
pub fn transparent() -> Color
[src]
This function returns an unbiased transparent color. Specifically, when blending a non-transparent color with a transparent color, the resulting color will have the same color space and coordinate as the non-transparent color, and only the alpha channel will be blended.
pub fn alpha(&self) -> f32
[src]
This function returns the additional alpha-component of this color.
pub fn mix(self, other: Color, factor: f32) -> Color
[src]
Blends the given color with another color using the given factor (between 0.0 and 1.0).
pub fn to_display_p3(&self) -> DisplayP3a
[src]
This function converts the color to the Display-P3 color space (if necessary) and returns the result.
pub fn to_srgb(&self) -> Srgba
[src]
This function converts the color to the sRGB color space (if necessary) and returns the result.
pub fn to_hex(&self) -> u32
[src]
Converts this color to sRGB and returns the resulting hex code.
Trait Implementations
impl Clone for Color
[src]
impl Copy for Color
[src]
impl Debug for Color
[src]
impl Default for Color
[src]
impl FromStr for Color
[src]
type Err = Error
The associated error which can be returned from parsing.
pub fn from_str(s: &str) -> Result<Self, Self::Err>
[src]
impl NamedColor for Color
[src]
pub fn aliceblue() -> Color
[src]
pub fn antiquewhite() -> Color
[src]
pub fn aqua() -> Color
[src]
pub fn aquamarine() -> Color
[src]
pub fn azure() -> Color
[src]
pub fn beige() -> Color
[src]
pub fn bisque() -> Color
[src]
pub fn black() -> Color
[src]
pub fn blanchedalmond() -> Color
[src]
pub fn blue() -> Color
[src]
pub fn blueviolet() -> Color
[src]
pub fn brown() -> Color
[src]
pub fn burlywood() -> Color
[src]
pub fn cadetblue() -> Color
[src]
pub fn chartreuse() -> Color
[src]
pub fn chocolate() -> Color
[src]
pub fn coral() -> Color
[src]
pub fn cornflowerblue() -> Color
[src]
pub fn cornsilk() -> Color
[src]
pub fn crimson() -> Color
[src]
pub fn cyan() -> Color
[src]
pub fn darkblue() -> Color
[src]
pub fn darkcyan() -> Color
[src]
pub fn darkgoldenrod() -> Color
[src]
pub fn darkgray() -> Color
[src]
pub fn darkgreen() -> Color
[src]
pub fn darkgrey() -> Color
[src]
pub fn darkkhaki() -> Color
[src]
pub fn darkmagenta() -> Color
[src]
pub fn darkolivegreen() -> Color
[src]
pub fn darkorange() -> Color
[src]
pub fn darkorchid() -> Color
[src]
pub fn darkred() -> Color
[src]
pub fn darksalmon() -> Color
[src]
pub fn darkseagreen() -> Color
[src]
pub fn darkslateblue() -> Color
[src]
pub fn darkslategray() -> Color
[src]
pub fn darkslategrey() -> Color
[src]
pub fn darkturquoise() -> Color
[src]
pub fn darkviolet() -> Color
[src]
pub fn deeppink() -> Color
[src]
pub fn deepskyblue() -> Color
[src]
pub fn dimgray() -> Color
[src]
pub fn dimgrey() -> Color
[src]
pub fn dodgerblue() -> Color
[src]
pub fn firebrick() -> Color
[src]
pub fn floralwhite() -> Color
[src]
pub fn forestgreen() -> Color
[src]
pub fn fuchsia() -> Color
[src]
pub fn gainsboro() -> Color
[src]
pub fn ghostwhite() -> Color
[src]
pub fn gold() -> Color
[src]
pub fn goldenrod() -> Color
[src]
pub fn gray() -> Color
[src]
pub fn green() -> Color
[src]
pub fn greenyellow() -> Color
[src]
pub fn grey() -> Color
[src]
pub fn honeydew() -> Color
[src]
pub fn hotpink() -> Color
[src]
pub fn indianred() -> Color
[src]
pub fn indigo() -> Color
[src]
pub fn ivory() -> Color
[src]
pub fn khaki() -> Color
[src]
pub fn lavender() -> Color
[src]
pub fn lavenderblush() -> Color
[src]
pub fn lawngreen() -> Color
[src]
pub fn lemonchiffon() -> Color
[src]
pub fn lightblue() -> Color
[src]
pub fn lightcoral() -> Color
[src]
pub fn lightcyan() -> Color
[src]
pub fn lightgoldenrodyellow() -> Color
[src]
pub fn lightgray() -> Color
[src]
pub fn lightgreen() -> Color
[src]
pub fn lightgrey() -> Color
[src]
pub fn lightpink() -> Color
[src]
pub fn lightsalmon() -> Color
[src]
pub fn lightseagreen() -> Color
[src]
pub fn lightskyblue() -> Color
[src]
pub fn lightslategray() -> Color
[src]
pub fn lightslategrey() -> Color
[src]
pub fn lightsteelblue() -> Color
[src]
pub fn lightyellow() -> Color
[src]
pub fn lime() -> Color
[src]
pub fn limegreen() -> Color
[src]
pub fn linen() -> Color
[src]
pub fn magenta() -> Color
[src]
pub fn maroon() -> Color
[src]
pub fn mediumaquamarine() -> Color
[src]
pub fn mediumblue() -> Color
[src]
pub fn mediumorchid() -> Color
[src]
pub fn mediumpurple() -> Color
[src]
pub fn mediumseagreen() -> Color
[src]
pub fn mediumslateblue() -> Color
[src]
pub fn mediumspringgreen() -> Color
[src]
pub fn mediumturquoise() -> Color
[src]
pub fn mediumvioletred() -> Color
[src]
pub fn midnightblue() -> Color
[src]
pub fn mintcream() -> Color
[src]
pub fn mistyrose() -> Color
[src]
pub fn moccasin() -> Color
[src]
pub fn navajowhite() -> Color
[src]
pub fn navy() -> Color
[src]
pub fn oldlace() -> Color
[src]
pub fn olive() -> Color
[src]
pub fn olivedrab() -> Color
[src]
pub fn orange() -> Color
[src]
pub fn orangered() -> Color
[src]
pub fn orchid() -> Color
[src]
pub fn palegoldenrod() -> Color
[src]
pub fn palegreen() -> Color
[src]
pub fn paleturquoise() -> Color
[src]
pub fn palevioletred() -> Color
[src]
pub fn papayawhip() -> Color
[src]
pub fn peachpuff() -> Color
[src]
pub fn peru() -> Color
[src]
pub fn pink() -> Color
[src]
pub fn plum() -> Color
[src]
pub fn powderblue() -> Color
[src]
pub fn purple() -> Color
[src]
pub fn rebeccapurple() -> Color
[src]
pub fn red() -> Color
[src]
pub fn rosybrown() -> Color
[src]
pub fn royalblue() -> Color
[src]
pub fn saddlebrown() -> Color
[src]
pub fn salmon() -> Color
[src]
pub fn sandybrown() -> Color
[src]
pub fn seagreen() -> Color
[src]
pub fn seashell() -> Color
[src]
pub fn sienna() -> Color
[src]
pub fn silver() -> Color
[src]
pub fn skyblue() -> Color
[src]
pub fn slateblue() -> Color
[src]
pub fn slategray() -> Color
[src]
pub fn slategrey() -> Color
[src]
pub fn snow() -> Color
[src]
pub fn springgreen() -> Color
[src]
pub fn steelblue() -> Color
[src]
pub fn tan() -> Color
[src]
pub fn teal() -> Color
[src]
pub fn thistle() -> Color
[src]
pub fn tomato() -> Color
[src]
pub fn turquoise() -> Color
[src]
pub fn violet() -> Color
[src]
pub fn wheat() -> Color
[src]
pub fn white() -> Color
[src]
pub fn whitesmoke() -> Color
[src]
pub fn yellow() -> Color
[src]
pub fn yellowgreen() -> Color
[src]
impl PartialEq<Color> for Color
[src]
impl StructuralPartialEq for Color
[src]
Auto Trait Implementations
impl RefUnwindSafe for Color
impl Send for Color
impl Sync for Color
impl Unpin for Color
impl UnwindSafe for Color
Blanket Implementations
impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S where
D: AdaptFrom<S, Swp, Dwp, T>,
Dwp: WhitePoint,
Swp: WhitePoint,
T: Component + Float,
[src]
D: AdaptFrom<S, Swp, Dwp, T>,
Dwp: WhitePoint,
Swp: WhitePoint,
T: Component + Float,
pub fn adapt_into_using<M>(self, method: M) -> D where
M: TransformMatrix<Swp, Dwp, T>,
[src]
M: TransformMatrix<Swp, Dwp, T>,
pub fn adapt_into(self) -> D
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> ConvertInto<U> for T where
U: ConvertFrom<T>,
[src]
U: ConvertFrom<T>,
pub fn convert_into(self) -> U
[src]
pub fn convert_unclamped_into(self) -> U
[src]
pub fn try_convert_into(self) -> Result<U, OutOfBounds<U>>
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,