[][src]Struct bracket_lib::prelude::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[src]

pub const BLACK: XpColor[src]

deepest black

pub const TRANSPARENT: XpColor[src]

color 0xff00ff (hot pink) is regarded as transparent

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

Construct a new color from r,g,b values

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

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, 
[src]

Read a RGB color from a ReadBytesExt

Errors

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

Write a RGB color to a WriteBytesExt

Errors

Trait Implementations

impl Clone for XpColor[src]

impl Copy for XpColor[src]

impl Debug for XpColor[src]

impl Eq for XpColor[src]

impl From<RGB> for XpColor[src]

impl From<XpColor> for RGB[src]

impl PartialEq<XpColor> for XpColor[src]

impl StructuralEq for XpColor[src]

impl StructuralPartialEq for XpColor[src]

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>,