Struct base16_color_scheme::scheme::RgbColor
source · pub struct RgbColor(pub [u8; 3]);
Expand description
type representing a hex rgb color, which implements Serialize
/Deserialze
it uses hex
for the implementation so it’s deserialization is case insensitive and it’s
serialization is lower case by default.
Examples
use base16_color_scheme::scheme::RgbColor;
let color: RgbColor = serde_yaml::from_str("7CaFc2").unwrap();
assert_eq!(color, RgbColor([0x7c, 0xaf, 0xc2]));
assert_eq!(serde_yaml::to_string(&color).unwrap(), "7cafc2\n");
Tuple Fields§
§0: [u8; 3]
Trait Implementations§
source§impl<'de> Deserialize<'de> for RgbColor
impl<'de> Deserialize<'de> for RgbColor
source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Ord for RgbColor
impl Ord for RgbColor
source§impl PartialEq<RgbColor> for RgbColor
impl PartialEq<RgbColor> for RgbColor
source§impl PartialOrd<RgbColor> for RgbColor
impl PartialOrd<RgbColor> for RgbColor
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read more