pub enum ColorChannel {
Rotation(Rotation),
Integer(u8),
Percent(Numeric),
}Expand description
Describes a color channel in a unit appropriate to the surrounding color model.
Variants§
Rotation(Rotation)
Used, for example, to express hue in HSL or other rotational color models.
Integer(u8)
Integer color channel in the [0, 255] range.
Percent(Numeric)
Percent color channel in the [0.0, 100.0] range.
Implementations§
Source§impl ColorChannel
impl ColorChannel
Sourcepub fn to_float_0_1(&self) -> f64
pub fn to_float_0_1(&self) -> f64
Normalizes this color channel as a float in the [0.0, 1.0] range.
Trait Implementations§
Source§impl Clone for ColorChannel
impl Clone for ColorChannel
Source§fn clone(&self) -> ColorChannel
fn clone(&self) -> ColorChannel
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl CoercionRules for ColorChannel
impl CoercionRules for ColorChannel
Source§fn try_coerce(value: PaxValue) -> Result<ColorChannel, String>
fn try_coerce(value: PaxValue) -> Result<ColorChannel, String>
Attempts to coerce
value into Self.Source§fn allows_singleton_stack() -> bool
fn allows_singleton_stack() -> bool
Opts appearance layers into scalar-to-singleton stack conversion.
Ordinary vector values remain list-only.
Source§fn is_identity_roundtrip() -> bool
fn is_identity_roundtrip() -> bool
Whether cloning
Self preserves the semantics of converting that clone
through ToPaxValue and back with try_coerce. Read moreSource§impl Debug for ColorChannel
impl Debug for ColorChannel
Source§impl Default for ColorChannel
impl Default for ColorChannel
Source§fn default() -> ColorChannel
fn default() -> ColorChannel
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for ColorChannel
impl<'de> Deserialize<'de> for ColorChannel
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ColorChannel, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ColorChannel, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for ColorChannel
impl Display for ColorChannel
Source§impl From<Numeric> for ColorChannel
impl From<Numeric> for ColorChannel
Source§fn from(value: Numeric) -> ColorChannel
fn from(value: Numeric) -> ColorChannel
Converts to this type from the input type.
Source§impl From<f64> for ColorChannel
impl From<f64> for ColorChannel
Source§fn from(value: f64) -> ColorChannel
fn from(value: f64) -> ColorChannel
Converts to this type from the input type.
Source§impl From<i32> for ColorChannel
impl From<i32> for ColorChannel
Source§fn from(value: i32) -> ColorChannel
fn from(value: i32) -> ColorChannel
Converts to this type from the input type.
Source§impl HelperFunctions for ColorChannel
impl HelperFunctions for ColorChannel
Source§fn register_all_functions()
fn register_all_functions()
Registers all helper functions for this type.
Source§impl Into<ColorChannel> for Percent
impl Into<ColorChannel> for Percent
Source§fn into(self) -> ColorChannel
fn into(self) -> ColorChannel
Converts this type into the (usually inferred) input type.
Source§impl PartialEq for ColorChannel
impl PartialEq for ColorChannel
Source§impl Serialize for ColorChannel
impl Serialize for ColorChannel
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for ColorChannel
Source§impl ToPaxValue for ColorChannel
impl ToPaxValue for ColorChannel
Source§fn to_pax_value(self) -> PaxValue
fn to_pax_value(self) -> PaxValue
Converts this value into a
PaxValue.Source§fn nested_properties(&self) -> Vec<UntypedProperty>
fn nested_properties(&self) -> Vec<UntypedProperty>
Live properties read when snapshotting a compound value for PAXEL.
Adapters observe these as well as the containing property.
Source§fn to_pax_value_in_graph(self) -> PaxValuewhere
Self: Sized,
fn to_pax_value_in_graph(self) -> PaxValuewhere
Self: Sized,
Converts against owner-thread graph views, including nested generated
property fields. Requires an entered property graph for shared fields.
Ordinary
Self::to_pax_value reads published value snapshots.Auto Trait Implementations§
impl Freeze for ColorChannel
impl RefUnwindSafe for ColorChannel
impl Send for ColorChannel
impl Sync for ColorChannel
impl Unpin for ColorChannel
impl UnsafeUnpin for ColorChannel
impl UnwindSafe for ColorChannel
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
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T, U> RoundInto<U> for Twhere
U: RoundFrom<T>,
impl<T, U> RoundInto<U> for Twhere
U: RoundFrom<T>,
Source§fn round_into(self) -> U
fn round_into(self) -> U
Performs the conversion.