pub struct ColorValue {
pub rgb: Option<String>,
pub theme_color: Option<String>,
pub theme_tint: Option<String>,
pub theme_shade: Option<String>,
pub auto: Option<bool>,
pub transforms: Vec<ColorTransform>,
pub luminance_modulation: Option<f64>,
pub luminance_offset: Option<f64>,
pub saturation_modulation: Option<f64>,
pub alpha: Option<f64>,
}Fields§
§rgb: Option<String>§theme_color: Option<String>§theme_tint: Option<String>§theme_shade: Option<String>§auto: Option<bool>§transforms: Vec<ColorTransform>Overrides legacy colour modifiers; legacy alpha applies without an alpha step.
luminance_modulation: Option<f64>a:lumMod, as a fraction of the colour’s own luminance.
luminance_offset: Option<f64>a:lumOff, added to luminance after a:lumMod.
saturation_modulation: Option<f64>a:satMod, as a fraction of the colour’s own saturation.
alpha: Option<f64>a:alpha, as a fraction. Opaque hex output drops it; use
resolve_color_value_to_rgba_hex to keep it.
Implementations§
Source§impl ColorValue
impl ColorValue
Sourcepub fn drawingml_transforms(&self) -> impl Iterator<Item = ColorTransform>
pub fn drawingml_transforms(&self) -> impl Iterator<Item = ColorTransform>
Ordered transforms with legacy alpha as a fallback.
Sourcepub fn from_attribute(value: &str) -> ColorValue
pub fn from_attribute(value: &str) -> ColorValue
A plain w:val/w:fill attribute, where auto defers to the consumer.
Trait Implementations§
Source§impl Clone for ColorValue
impl Clone for ColorValue
Source§fn clone(&self) -> ColorValue
fn clone(&self) -> ColorValue
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 Debug for ColorValue
impl Debug for ColorValue
Source§impl Default for ColorValue
impl Default for ColorValue
Source§fn default() -> ColorValue
fn default() -> ColorValue
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for ColorValue
impl<'de> Deserialize<'de> for ColorValue
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ColorValue, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ColorValue, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for ColorValue
impl PartialEq for ColorValue
Source§impl Serialize for ColorValue
impl Serialize for ColorValue
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 ColorValue
Auto Trait Implementations§
impl Freeze for ColorValue
impl RefUnwindSafe for ColorValue
impl Send for ColorValue
impl Sync for ColorValue
impl Unpin for ColorValue
impl UnsafeUnpin for ColorValue
impl UnwindSafe for ColorValue
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