[]Struct rltk::XpColor

pub struct XpColor {
    pub r: u8,
    pub g: u8,
    pub b: u8,
}

Structure representing the components of one color

Fields

r: u8

Red component 0..255

g: u8

Green component 0..255

b: u8

Blue component 0..255

Methods

impl XpColor

pub const BLACK: XpColor

deepest black

pub const TRANSPARENT: XpColor

color 0xff00ff (hot pink) is regarded as transparent

#[must_use]pub const fn new(r: u8, g: u8, b: u8) -> XpColor

Construct a new color from r,g,b values

#[must_use]pub fn is_transparent(self) -> bool

Return whether this color is considered transparent (if this is the background color of a cell, the layer below it will see through)

pub fn read<T>(rdr: &mut T) -> Result<XpColor, Error> where
    T: ReadBytesExt, 

Read a RGB color from a ReadBytesExt

Errors

pub fn write<T>(self, wr: &mut T) -> Result<(), Error> where
    T: WriteBytesExt, 

Write a RGB color to a WriteBytesExt

Errors

Trait Implementations

impl Clone for XpColor

impl Copy for XpColor

impl Debug for XpColor

impl Eq for XpColor

impl From<RGB> for XpColor

impl From<XpColor> for RGB

impl PartialEq<XpColor> for XpColor

impl StructuralEq for XpColor

impl StructuralPartialEq for XpColor

Auto Trait Implementations

impl RefUnwindSafe for XpColor

impl Send for XpColor

impl Sync for XpColor

impl Unpin for XpColor

impl UnwindSafe for XpColor

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,