[−]Struct rltk::XpColor
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,
T: ReadBytesExt,
Read a RGB color from a ReadBytesExt
Errors
pub fn write<T>(self, wr: &mut T) -> Result<(), Error> where
T: WriteBytesExt,
T: WriteBytesExt,
Write a RGB color to a WriteBytesExt
Errors
Trait Implementations
impl Clone for XpColor
fn clone(&self) -> XpColor
fn clone_from(&mut self, source: &Self)
1.0.0[src]
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,