pub struct Color {
pub value: Vec3,
pub space: ColorSpace,
}Expand description
Color is a 3-component vector defined in a ColorSpace.
Fields§
§value: Vec3§space: ColorSpaceImplementations§
Source§impl Color
impl Color
pub const fn new(x: FType, y: FType, z: FType, space: ColorSpace) -> Self
pub const fn space(&self) -> ColorSpace
Sourcepub const fn srgb(x: FType, y: FType, z: FType) -> Self
pub const fn srgb(x: FType, y: FType, z: FType) -> Self
Equivalent to Color::new(x, y, z, kolor::spaces::ENCODED_SRGB)
Sourcepub fn to(&self, space: ColorSpace) -> Color
pub fn to(&self, space: ColorSpace) -> Color
Returns a Color with this color converted into the provided ColorSpace.
pub fn to_linear(&self) -> Color
Trait Implementations§
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
Mutably borrows from an owned value. Read more