[−][src]Struct xblend::RGBA
This struct represents a RGBA color
Implementations
impl<T: InnerType> RGBA<T>
[src]
pub fn new(r: T, g: T, b: T, a: T) -> RGBA<T>
[src]
Create a new RGBA color with 4 components.
pub fn from_rgb(color: &RGB<T>, a: T) -> RGBA<T>
[src]
Create a new RGBA color from another RGB color and the alpha component.
pub fn r(&self) -> T
[src]
Get the Red component.
pub fn g(&self) -> T
[src]
Get the Green component.
pub fn b(&self) -> T
[src]
Get the Blue component.
pub fn a(&self) -> T
[src]
Get the alpha component.
pub fn rgb(&self) -> RGB<T>
[src]
Get the RGB components.
impl RGBA<f32>
[src]
pub fn to_gray(&self) -> f32
[src]
Calculate the gray value
the result equals R*0.33+G*0.59+B*0.11
pub fn to_u8(&self) -> RGBA<u8>
[src]
Convert itself into RGBA<u8>
pub fn as_u32(&self) -> u32
[src]
Get the unsigned integer representation of itself.
impl RGBA<u8>
[src]
pub fn to_gray(&self) -> u8
[src]
Calculate the gray value
The result equals(R*28+G*151+B*77)>>8
pub fn to_f32(&self) -> RGBA<f32>
[src]
Convert itself into RGBA<f32>
pub fn as_u32(&self) -> u32
[src]
Get the unsigned integer representation of itself
Trait Implementations
impl Add<RGBA<f32>> for RGBA<f32>
[src]
type Output = RGBA<f32>
The resulting type after applying the +
operator.
pub fn add(self, rhs: Self) -> Self::Output
[src]
impl Add<RGBA<u8>> for RGBA<u8>
[src]
type Output = RGBA<u8>
The resulting type after applying the +
operator.
pub fn add(self, rhs: Self) -> Self::Output
[src]
impl Clear for RGBA<f32>
[src]
impl<T: Clone + InnerType> Clone for RGBA<T>
[src]
impl<T: Copy + InnerType> Copy for RGBA<T>
[src]
impl Darken for RGBA<f32>
[src]
impl<T: Debug + InnerType> Debug for RGBA<T>
[src]
impl<T: Default + InnerType> Default for RGBA<T>
[src]
impl Div<RGBA<f32>> for RGBA<f32>
[src]
type Output = RGBA<f32>
The resulting type after applying the /
operator.
pub fn div(self, rhs: Self) -> Self::Output
[src]
impl Div<RGBA<u8>> for RGBA<u8>
[src]
type Output = RGBA<u8>
The resulting type after applying the /
operator.
pub fn div(self, rhs: Self) -> Self::Output
[src]
impl Dst for RGBA<f32>
[src]
impl DstATop for RGBA<f32>
[src]
impl DstIn for RGBA<f32>
[src]
impl DstOut for RGBA<f32>
[src]
impl DstOver for RGBA<f32>
[src]
impl<T: Eq + InnerType> Eq for RGBA<T>
[src]
impl<T: InnerType> From<RGBA<T>> for RGB<T>
[src]
impl From<RGBA<f32>> for RGBA<u8>
[src]
impl From<RGBA<u8>> for RGBA<f32>
[src]
impl From<u32> for RGBA<u8>
[src]
impl<T: Hash + InnerType> Hash for RGBA<T>
[src]
pub fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl Into<u32> for RGBA<u8>
[src]
impl Lighten for RGBA<f32>
[src]
impl Mul<RGBA<f32>> for RGBA<f32>
[src]
type Output = RGBA<f32>
The resulting type after applying the *
operator.
pub fn mul(self, rhs: Self) -> Self::Output
[src]
impl Mul<RGBA<u8>> for RGBA<u8>
[src]
type Output = RGBA<u8>
The resulting type after applying the *
operator.
pub fn mul(self, rhs: Self) -> Self::Output
[src]
impl Multiply for RGBA<f32>
[src]
impl<T: Ord + InnerType> Ord for RGBA<T>
[src]
pub fn cmp(&self, other: &RGBA<T>) -> Ordering
[src]
#[must_use]pub fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn clamp(self, min: Self, max: Self) -> Self
1.50.0[src]
impl<T: PartialEq + InnerType> PartialEq<RGBA<T>> for RGBA<T>
[src]
impl<T: PartialOrd + InnerType> PartialOrd<RGBA<T>> for RGBA<T>
[src]
pub fn partial_cmp(&self, other: &RGBA<T>) -> Option<Ordering>
[src]
pub fn lt(&self, other: &RGBA<T>) -> bool
[src]
pub fn le(&self, other: &RGBA<T>) -> bool
[src]
pub fn gt(&self, other: &RGBA<T>) -> bool
[src]
pub fn ge(&self, other: &RGBA<T>) -> bool
[src]
impl Screen for RGBA<f32>
[src]
impl Src for RGBA<f32>
[src]
impl SrcATop for RGBA<f32>
[src]
impl SrcIn for RGBA<f32>
[src]
impl SrcOut for RGBA<f32>
[src]
impl SrcOver for RGBA<f32>
[src]
impl<T: InnerType> StructuralEq for RGBA<T>
[src]
impl<T: InnerType> StructuralPartialEq for RGBA<T>
[src]
impl Sub<RGBA<f32>> for RGBA<f32>
[src]
type Output = RGBA<f32>
The resulting type after applying the -
operator.
pub fn sub(self, rhs: Self) -> Self::Output
[src]
impl Sub<RGBA<u8>> for RGBA<u8>
[src]
type Output = RGBA<u8>
The resulting type after applying the -
operator.
pub fn sub(self, rhs: Self) -> Self::Output
[src]
impl Xor for RGBA<f32>
[src]
Auto Trait Implementations
impl<T> RefUnwindSafe for RGBA<T> where
T: RefUnwindSafe,
[src]
T: RefUnwindSafe,
impl<T> Send for RGBA<T> where
T: Send,
[src]
T: Send,
impl<T> Sync for RGBA<T> where
T: Sync,
[src]
T: Sync,
impl<T> Unpin for RGBA<T> where
T: Unpin,
[src]
T: Unpin,
impl<T> UnwindSafe for RGBA<T> where
T: UnwindSafe,
[src]
T: UnwindSafe,
Blanket Implementations
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> 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>,