Struct vga_rs::Color

source ·
pub struct Color(/* private fields */);
Expand description

Contains 8 bit color.

Implementations§

source§

impl Color

source

pub const BLACK: Color = _

source

pub const BLUE: Color = _

source

pub const GREEN: Color = _

source

pub const CYAN: Color = _

source

pub const RED: Color = _

source

pub const MAGENTA: Color = _

source

pub const BROWN: Color = _

source

pub const LIGHTGRAY: Color = _

source

pub const DARKGRAY: Color = _

source

pub const LIGHTBLUE: Color = _

source

pub const LIGHTGREEN: Color = _

source

pub const LIGHTCYAN: Color = _

source

pub const LIGHTRED: Color = _

source

pub const PINK: Color = _

source

pub const YELLOW: Color = _

source

pub const WHITE: Color = _

source

pub const EXTRA: Color = _

source§

impl Color

source

pub const fn new(b: bool, g: bool, r: bool, extra: bool) -> Self

Construct Color from (blue | green | red | extra bit).

source

pub const fn from_u8(bit: u8) -> Self

Construct Color from u8.

source

pub const fn from_u8_checked(bit: u8) -> Option<Self>

Construct Color from u8. Check bit 4-7.

source

pub const fn as_u8(self) -> u8

Extract Color to u8.

Trait Implementations§

source§

impl BitOr for Color

§

type Output = Color

The resulting type after applying the | operator.
source§

fn bitor(self, rhs: Self) -> Self::Output

Performs the | operation. Read more
source§

impl Clone for Color

source§

fn clone(&self) -> Color

Returns a copy 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 Color

source§

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

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

impl Hash for Color

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 Color

source§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Copy for Color

source§

impl Eq for Color

source§

impl StructuralEq for Color

source§

impl StructuralPartialEq for Color

Auto Trait Implementations§

§

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> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. 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 Twhere 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, U> TryFrom<U> for Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.