Struct skia_safe::Color4f

source ·
#[repr(C)]
pub struct Color4f { pub r: f32, pub g: f32, pub b: f32, pub a: f32, }

Fields§

§r: f32§g: f32§b: f32§a: f32

Implementations§

source§

impl Color4f

source

pub const fn new(r: f32, g: f32, b: f32, a: f32) -> Color4f

source

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

source

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

source

pub fn is_opaque(&self) -> bool

source

pub fn fits_in_bytes(&self) -> bool

source

pub fn to_color(self) -> Color

source

pub fn to_bytes(self) -> u32

source

pub fn from_bytes_rgba(color: u32) -> Self

source

pub fn to_opaque(self) -> Self

Trait Implementations§

source§

impl AsRef<Color4f> for Color4f

source§

fn as_ref(&self) -> &Self

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl Clone for Color4f

source§

fn clone(&self) -> Color4f

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 Debug for Color4f

source§

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

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

impl From<Color> for Color4f

source§

fn from(color: Color) -> Self

Converts to this type from the input type.
source§

impl From<RGB> for Color4f

source§

fn from(rgb: RGB) -> Self

Converts to this type from the input type.
source§

impl From<u32> for Color4f

source§

fn from(color: u32) -> Self

Converts to this type from the input type.
source§

impl Index<usize> for Color4f

§

type Output = f32

The returned type after indexing.
source§

fn index(&self, index: usize) -> &f32

Performs the indexing (container[index]) operation. Read more
source§

impl IndexMut<usize> for Color4f

source§

fn index_mut(&mut self, index: usize) -> &mut f32

Performs the mutable indexing (container[index]) operation. Read more
source§

impl Mul<&Color4f> for Color4f

§

type Output = Color4f

The resulting type after applying the * operator.
source§

fn mul(self, scale: &Self) -> Self

Performs the * operation. Read more
source§

impl Mul<Color4f> for Color4f

§

type Output = Color4f

The resulting type after applying the * operator.
source§

fn mul(self, scale: Self) -> Self

Performs the * operation. Read more
source§

impl Mul<f32> for Color4f

§

type Output = Color4f

The resulting type after applying the * operator.
source§

fn mul(self, scale: f32) -> Self

Performs the * operation. Read more
source§

impl PartialEq<Color4f> for Color4f

source§

fn eq(&self, other: &Color4f) -> 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 Pixel for Color4f

source§

fn matches_color_type(ct: ColorType) -> bool

true if the type matches the color type’s format.
source§

impl Copy for Color4f

source§

impl StructuralPartialEq for Color4f

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere 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<N, T> NativeTransmutableWrapper<N> for Twhere T: NativeTransmutable<N>,

source§

fn wrap(native: N) -> T

source§

fn unwrap(self) -> N

source§

fn inner(&self) -> &N

source§

fn inner_mut(&mut self) -> &mut N

source§

impl<T> ToOwned for Twhere 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, U> TryFrom<U> for Twhere 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 Twhere 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.