pub struct Color {
pub r: u8,
pub g: u8,
pub b: u8,
pub a: f64,
}Expand description
RGB color representation
Fields§
§r: u8§g: u8§b: u8§a: f64Implementations§
Source§impl Color
impl Color
pub const BLACK: Color
pub const WHITE: Color
pub const RED: Color
pub const GREEN: Color
pub const BLUE: Color
pub const YELLOW: Color
pub const CYAN: Color
pub const MAGENTA: Color
pub const ORANGE: Color
pub const PURPLE: Color
pub const GRAY: Color
pub const LIGHTGRAY: Color
pub const DARKGRAY: Color
Sourcepub fn from_hex(hex: &str) -> Result<Self, &'static str>
pub fn from_hex(hex: &str) -> Result<Self, &'static str>
Create color from hex string (e.g., “#FF0000” for red)
Sourcepub fn to_svg_string(&self) -> String
pub fn to_svg_string(&self) -> String
Convert to SVG color string
Trait Implementations§
impl Copy for Color
impl StructuralPartialEq for Color
Auto Trait Implementations§
impl Freeze for Color
impl RefUnwindSafe for Color
impl Send for Color
impl Sync for Color
impl Unpin for Color
impl UnwindSafe for Color
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