pub struct Rgb(pub u8, pub u8, pub u8);Expand description
A structure representing an RGB color with red, green, and blue components.
§Example
use plotlars::{Axis, BarPlot, Legend, Orientation, Plot, Rgb};
let dataset = df![
"label" => &["", "", ""],
"color" => &["red", "green", "blue"],
"value" => &[1, 1, 1],
]
.unwrap();
let axis = Axis::new()
.show_axis(false);
let legend = Legend::new()
.orientation(Orientation::Horizontal)
.x(0.3);
BarPlot::builder()
.data(&dataset)
.labels("label")
.values("value")
.group("color")
.colors(vec![
Rgb(255, 0, 0),
Rgb(0, 255, 0),
Rgb(0, 0, 255),
])
.x_axis(&axis)
.y_axis(&axis)
.legend(&legend)
.build()
.plot();
Tuple Fields§
§0: u8Red component
1: u8Green component
2: u8Blue component
Trait Implementations§
impl Color for Rgb
impl Copy for Rgb
Auto Trait Implementations§
impl Freeze for Rgb
impl RefUnwindSafe for Rgb
impl Send for Rgb
impl Sync for Rgb
impl Unpin for Rgb
impl UnwindSafe for Rgb
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().