Enum MapColor

Source
#[repr(u32)]
pub enum MapColor {
Show 59 variants None = 0, Clay = 10_791_096, ColorBlack = 1_644_825, ColorBlue = 3_361_970, ColorBrown = 6_704_179, ColorCyan = 5_013_401, ColorGray = 5_000_268, ColorGreen = 6_717_235, ColorLightBlue = 6_724_056, ColorLightGray = 10_066_329, ColorLightGreen = 8_375_321, ColorMagenta = 11_685_080, ColorOrange = 14_188_339, ColorPink = 15_892_389, ColorPurple = 8_339_378, ColorRed = 10_040_115, ColorYellow = 15_066_419, CrimsonHyphae = 6_035_741, CrimsonNylium = 12_398_641, CrimsonStem = 9_715_553, Diamond = 6_085_589, Dirt = 9_923_917, Emerald = 55_610, Fire = 16_711_680, Gold = 16_445_005, Grass = 8_368_696, Ice = 10_526_975, Lapis = 4_882_687, Metal = 10_987_431, Nether = 7_340_544, Plant = 31_744, Podzol = 8_476_209, Quartz = 16_776_437, Sand = 16_247_203, Snow = 16_777_215, Stone = 7_368_816, TerracottaBlack = 2_430_480, TerracottaBlue = 4_996_700, TerracottaBrown = 4_993_571, TerracottaCyan = 5_725_276, TerracottaGray = 3_746_083, TerracottaGreen = 5_001_770, TerracottaLightBlue = 7_367_818, TerracottaLightGray = 8_874_850, TerracottaLightGreen = 6_780_213, TerracottaMagenta = 9_787_244, TerracottaOrange = 10_441_252, TerracottaPink = 10_505_550, TerracottaPurple = 8_014_168, TerracottaRed = 9_321_518, TerracottaWhite = 13_742_497, TerracottaYellow = 12_223_780, WarpedHyphae = 5_647_422, WarpedNylium = 1_474_182, WarpedStem = 3_837_580, WarpedWartBlock = 1_356_933, Water = 4_210_943, Wood = 9_402_184, Wool = 13_092_807,
}
Available on crate features 1.16 and block-states only.
Expand description

The possible colors on Minecraft maps.

Variants§

§

None = 0

No map color, fully transparent.

§

Clay = 10_791_096

§

ColorBlack = 1_644_825

§

ColorBlue = 3_361_970

§

ColorBrown = 6_704_179

§

ColorCyan = 5_013_401

§

ColorGray = 5_000_268

§

ColorGreen = 6_717_235

§

ColorLightBlue = 6_724_056

§

ColorLightGray = 10_066_329

§

ColorLightGreen = 8_375_321

§

ColorMagenta = 11_685_080

§

ColorOrange = 14_188_339

§

ColorPink = 15_892_389

§

ColorPurple = 8_339_378

§

ColorRed = 10_040_115

§

ColorYellow = 15_066_419

§

CrimsonHyphae = 6_035_741

§

CrimsonNylium = 12_398_641

§

CrimsonStem = 9_715_553

§

Diamond = 6_085_589

§

Dirt = 9_923_917

§

Emerald = 55_610

§

Fire = 16_711_680

§

Gold = 16_445_005

§

Grass = 8_368_696

§

Ice = 10_526_975

§

Lapis = 4_882_687

§

Metal = 10_987_431

§

Nether = 7_340_544

§

Plant = 31_744

§

Podzol = 8_476_209

§

Quartz = 16_776_437

§

Sand = 16_247_203

§

Snow = 16_777_215

§

Stone = 7_368_816

§

TerracottaBlack = 2_430_480

§

TerracottaBlue = 4_996_700

§

TerracottaBrown = 4_993_571

§

TerracottaCyan = 5_725_276

§

TerracottaGray = 3_746_083

§

TerracottaGreen = 5_001_770

§

TerracottaLightBlue = 7_367_818

§

TerracottaLightGray = 8_874_850

§

TerracottaLightGreen = 6_780_213

§

TerracottaMagenta = 9_787_244

§

TerracottaOrange = 10_441_252

§

TerracottaPink = 10_505_550

§

TerracottaPurple = 8_014_168

§

TerracottaRed = 9_321_518

§

TerracottaWhite = 13_742_497

§

TerracottaYellow = 12_223_780

§

WarpedHyphae = 5_647_422

§

WarpedNylium = 1_474_182

§

WarpedStem = 3_837_580

§

WarpedWartBlock = 1_356_933

§

Water = 4_210_943

§

Wood = 9_402_184

§

Wool = 13_092_807

Implementations§

Source§

impl MapColor

Source

pub const fn packed_argb(&self) -> u32

Returns a packed ARGB representation of this color as a u32.

The alpha channel will always be 0xff, except for MapColor::None.

Source

pub const fn rgba(&self) -> [u8; 4]

Returns an RGBA array of this color.

The alpha channel will always be 0xff, except for MapColor::None.

Source

pub const fn calc_rgba(&self, brightness: u8) -> [u8; 4]

Calculate the RGBA color for this map color with the given brightness.

The alpha channel will always be 0xff, except for MapColor::None.

Trait Implementations§

Source§

impl Clone for MapColor

Source§

fn clone(&self) -> MapColor

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for MapColor

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Hash for MapColor

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for MapColor

Source§

fn eq(&self, other: &MapColor) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for MapColor

Source§

impl Eq for MapColor

Source§

impl StructuralPartialEq for MapColor

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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 more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.