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: ColorSpace
Implementations§
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 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