pub enum ColorSpace {
Srgb,
ExtendedSrgb,
DisplayP3,
}Expand description
The color space describes the colors that are available to an Image.
This value can help decide which ImageByteFormat to use with
Image.toByteData. Images that are in the ColorSpace::ExtendedSrgb
color space should use something like ImageByteFormat.rawExtendedRgba128
so that colors outside of the sRGB gamut aren’t lost.
This is also the result of Image.colorSpace.
Variants§
Srgb
The sRGB color space.
You may know this as the standard color space for the web or the color space of non-wide-gamut Flutter apps.
See also: https://en.wikipedia.org/wiki/SRGB
ExtendedSrgb
A color space that is backwards compatible with sRGB but can represent
colors outside of that gamut with values outside of [0..1]. In order to
see the extended values an ImageByteFormat like
ImageByteFormat.rawExtendedRgba128 must be used.
DisplayP3
The Display P3 color space.
This is a wide gamut color space that has broad hardware support. It’s supported in cases like using Impeller on iOS. When used on a platform that doesn’t support Display P3, the colors will be clamped to sRGB.
See also: https://en.wikipedia.org/wiki/DCI-P3
Trait Implementations§
Source§impl Clone for ColorSpace
impl Clone for ColorSpace
Source§fn clone(&self) -> ColorSpace
fn clone(&self) -> ColorSpace
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for ColorSpace
Source§impl Debug for ColorSpace
impl Debug for ColorSpace
impl Eq for ColorSpace
Source§impl PartialEq for ColorSpace
impl PartialEq for ColorSpace
impl StructuralPartialEq for ColorSpace
Auto Trait Implementations§
impl Freeze for ColorSpace
impl RefUnwindSafe for ColorSpace
impl Send for ColorSpace
impl Sync for ColorSpace
impl Unpin for ColorSpace
impl UnsafeUnpin for ColorSpace
impl UnwindSafe for ColorSpace
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.