pub enum Color {
Show 16 variants
Black,
DarkBlue,
DarkGreen,
DarkAqua,
DarkRed,
DarkPurple,
Gold,
Gray,
DarkGray,
Blue,
Green,
Aqua,
Red,
LightPurple,
Yellow,
White,
}
Expand description
Various colors that a Span
can have.
See the wiki.vg docs for specific information.
Variants§
Black
DarkBlue
DarkGreen
DarkAqua
DarkRed
DarkPurple
Gold
Gray
DarkGray
Blue
Green
Aqua
Red
LightPurple
Yellow
White
Implementations§
Source§impl Color
impl Color
Sourcepub const fn foreground_hex_str(&self) -> &'static str
pub const fn foreground_hex_str(&self) -> &'static str
Get the correct foreground hex color string for a given color
§Examples
use mc_legacy_formatting::Color;
assert_eq!(Color::Aqua.foreground_hex_str(), "#55ffff");
Sourcepub const fn background_hex_str(&self) -> &'static str
pub const fn background_hex_str(&self) -> &'static str
Get the correct background hex color string for a given color
§Examples
use mc_legacy_formatting::Color;
assert_eq!(Color::Aqua.background_hex_str(), "#153f3f");
Trait Implementations§
Source§impl Ord for Color
impl Ord for Color
Source§impl PartialOrd for Color
impl PartialOrd for Color
impl Copy for Color
impl Eq 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