Struct RGB

Source
pub struct RGB {
    pub r: u8,
    pub g: u8,
    pub b: u8,
}
Expand description

A color in the RGB color space.

Fields§

§r: u8

The red channel of color in [0u8, 255u8].

§g: u8

The green channel of color in [0u8, 255u8].

§b: u8

The blue channel of color in [0u8, 255u8].

Implementations§

Source§

impl RGB

Source

pub const ALICEBLUE: Self

aliceblue: #F0F8FF

Source

pub const ANTIQUEWHITE: Self

antiquewhite: #FAEBD7

Source

pub const AQUA: Self

aqua: #00FFFF

Source

pub const AQUAMARINE: Self

aquamarine: #7FFFD4

Source

pub const AZURE: Self

azure: #F0FFFF

Source

pub const BEIGE: Self

beige: #F5F5DC

Source

pub const BISQUE: Self

bisque: #FFE4C4

Source

pub const BLACK: Self

black: #000000

Source

pub const BLANCHEDALMOND: Self

blanchedalmond: #FFEBCD

Source

pub const BLUE: Self

blue: #0000FF

Source

pub const BLUEVIOLET: Self

blueviolet: #8A2BE2

Source

pub const BROWN: Self

brown: #A52A2A

Source

pub const BURLYWOOD: Self

burlywood: #DEB887

Source

pub const CADETBLUE: Self

cadetblue: #5F9EA0

Source

pub const CHARTREUSE: Self

chartreuse: #7FFF00

Source

pub const CHOCOLATE: Self

chocolate: #D2691E

Source

pub const CORAL: Self

coral: #FF7F50

Source

pub const CORNFLOWERBLUE: Self

cornflowerblue: #6495ED

Source

pub const CORNSILK: Self

cornsilk: #FFF8DC

Source

pub const CRIMSON: Self

crimson: #DC143C

Source

pub const CYAN: Self

cyan: #00FFFF

Source

pub const DARKBLUE: Self

darkblue: #00008B

Source

pub const DARKCYAN: Self

darkcyan: #008B8B

Source

pub const DARKGOLDENROD: Self

darkgoldenrod: #B8860B

Source

pub const DARKGRAY: Self

darkgray: #A9A9A9

Source

pub const DARKGREEN: Self

darkgreen: #006400

Source

pub const DARKGREY: Self

darkgrey: #A9A9A9

Source

pub const DARKKHAKI: Self

darkkhaki: #BDB76B

Source

pub const DARKMAGENTA: Self

darkmagenta: #8B008B

Source

pub const DARKOLIVEGREEN: Self

darkolivegreen: #556B2F

Source

pub const DARKORANGE: Self

darkorange: #FF8C00

Source

pub const DARKORCHID: Self

darkorchid: #9932CC

Source

pub const DARKRED: Self

darkred: #8B0000

Source

pub const DARKSALMON: Self

darksalmon: #E9967A

Source

pub const DARKSEAGREEN: Self

darkseagreen: #8FBC8F

Source

pub const DARKSLATEBLUE: Self

darkslateblue: #483D8B

Source

pub const DARKSLATEGRAY: Self

darkslategray: #2F4F4F

Source

pub const DARKSLATEGREY: Self

darkslategrey: #2F4F4F

Source

pub const DARKTURQUOISE: Self

darkturquoise: #00CED1

Source

pub const DARKVIOLET: Self

darkviolet: #9400D3

Source

pub const DEEPPINK: Self

deeppink: #FF1493

Source

pub const DEEPSKYBLUE: Self

deepskyblue: #00BFFF

Source

pub const DIMGRAY: Self

dimgray: #696969

Source

pub const DIMGREY: Self

dimgrey: #696969

Source

pub const DODGERBLUE: Self

dodgerblue: #1E90FF

Source

pub const FIREBRICK: Self

firebrick: #B22222

Source

pub const FLORALWHITE: Self

floralwhite: #FFFAF0

Source

pub const FORESTGREEN: Self

forestgreen: #228B22

Source

pub const FUCHSIA: Self

fuchsia: #FF00FF

Source

pub const GAINSBORO: Self

gainsboro: #DCDCDC

Source

pub const GHOSTWHITE: Self

ghostwhite: #F8F8FF

Source

pub const GOLDENROD: Self

goldenrod: #DAA520

Source

pub const GOLD: Self

gold: #FFD700

Source

pub const GRAY: Self

gray: #808080

Source

pub const GREEN: Self

green: #008000

Source

pub const GREENYELLOW: Self

greenyellow: #ADFF2F

Source

pub const GREY: Self

grey: #808080

Source

pub const HONEYDEW: Self

honeydew: #F0FFF0

Source

pub const HOTPINK: Self

hotpink: #FF69B4

Source

pub const INDIANRED: Self

indianred: #CD5C5C

Source

pub const INDIGO: Self

indigo: #4B0082

Source

pub const IVORY: Self

ivory: #FFFFF0

Source

pub const KHAKI: Self

khaki: #F0E68C

Source

pub const LAVENDERBLUSH: Self

lavenderblush: #FFF0F5

Source

pub const LAVENDER: Self

lavender: #E6E6FA

Source

pub const LAWNGREEN: Self

lawngreen: #7CFC00

Source

pub const LEMONCHIFFON: Self

lemonchiffon: #FFFACD

Source

pub const LIGHTBLUE: Self

lightblue: #ADD8E6

Source

pub const LIGHTCORAL: Self

lightcoral: #F08080

Source

pub const LIGHTCYAN: Self

lightcyan: #E0FFFF

Source

pub const LIGHTGOLDENRODYELLOW: Self

lightgoldenrodyellow: #FAFAD2

Source

pub const LIGHTGRAY: Self

lightgray: #D3D3D3

Source

pub const LIGHTGREEN: Self

lightgreen: #90EE90

Source

pub const LIGHTGREY: Self

lightgrey: #D3D3D3

Source

pub const LIGHTPINK: Self

lightpink: #FFB6C1

Source

pub const LIGHTSALMON: Self

lightsalmon: #FFA07A

Source

pub const LIGHTSEAGREEN: Self

lightseagreen: #20B2AA

Source

pub const LIGHTSKYBLUE: Self

lightskyblue: #87CEFA

Source

pub const LIGHTSLATEGRAY: Self

lightslategray: #778899

Source

pub const LIGHTSLATEGREY: Self

lightslategrey: #778899

Source

pub const LIGHTSTEELBLUE: Self

lightsteelblue: #B0C4DE

Source

pub const LIGHTYELLOW: Self

lightyellow: #FFFFE0

Source

pub const LIME: Self

lime: #00FF00

Source

pub const LIMEGREEN: Self

limegreen: #32CD32

Source

pub const LINEN: Self

linen: #FAF0E6

Source

pub const MAGENTA: Self

magenta: #FF00FF

Source

pub const MAROON: Self

maroon: #800000

Source

pub const MEDIUMAQUAMARINE: Self

mediumaquamarine: #66CDAA

Source

pub const MEDIUMBLUE: Self

mediumblue: #0000CD

Source

pub const MEDIUMORCHID: Self

mediumorchid: #BA55D3

Source

pub const MEDIUMPURPLE: Self

mediumpurple: #9370DB

Source

pub const MEDIUMSEAGREEN: Self

mediumseagreen: #3CB371

Source

pub const MEDIUMSLATEBLUE: Self

mediumslateblue: #7B68EE

Source

pub const MEDIUMSPRINGGREEN: Self

mediumspringgreen: #00FA9A

Source

pub const MEDIUMTURQUOISE: Self

mediumturquoise: #48D1CC

Source

pub const MEDIUMVIOLETRED: Self

mediumvioletred: #C71585

Source

pub const MIDNIGHTBLUE: Self

midnightblue: #191970

Source

pub const MINTCREAM: Self

mintcream: #F5FFFA

Source

pub const MISTYROSE: Self

mistyrose: #FFE4E1

Source

pub const MOCCASIN: Self

moccasin: #FFE4B5

Source

pub const NAVAJOWHITE: Self

navajowhite: #FFDEAD

Source

pub const NAVY: Self

navy: #000080

Source

pub const OLDLACE: Self

oldlace: #FDF5E6

Source

pub const OLIVE: Self

olive: #808000

Source

pub const OLIVEDRAB: Self

olivedrab: #6B8E23

Source

pub const ORANGE: Self

orange: #FFA500

Source

pub const ORANGERED: Self

orangered: #FF4500

Source

pub const ORCHID: Self

orchid: #DA70D6

Source

pub const PALEGOLDENROD: Self

palegoldenrod: #EEE8AA

Source

pub const PALEGREEN: Self

palegreen: #98FB98

Source

pub const PALETURQUOISE: Self

paleturquoise: #AFEEEE

Source

pub const PALEVIOLETRED: Self

palevioletred: #DB7093

Source

pub const PAPAYAWHIP: Self

papayawhip: #FFEFD5

Source

pub const PEACHPUFF: Self

peachpuff: #FFDAB9

Source

pub const PERU: Self

peru: #CD853F

Source

pub const PINK: Self

pink: #FFC0CB

Source

pub const PLUM: Self

plum: #DDA0DD

Source

pub const POWDERBLUE: Self

powderblue: #B0E0E6

Source

pub const PURPLE: Self

purple: #800080

Source

pub const REBECCAPURPLE: Self

rebeccapurple: #663399

Source

pub const RED: Self

red: #FF0000

Source

pub const ROSYBROWN: Self

rosybrown: #BC8F8F

Source

pub const ROYALBLUE: Self

royalblue: #4169E1

Source

pub const SADDLEBROWN: Self

saddlebrown: #8B4513

Source

pub const SALMON: Self

salmon: #FA8072

Source

pub const SANDYBROWN: Self

sandybrown: #F4A460

Source

pub const SEAGREEN: Self

seagreen: #2E8B57

Source

pub const SEASHELL: Self

seashell: #FFF5EE

Source

pub const SIENNA: Self

sienna: #A0522D

Source

pub const SILVER: Self

silver: #C0C0C0

Source

pub const SKYBLUE: Self

skyblue: #87CEEB

Source

pub const SLATEBLUE: Self

slateblue: #6A5ACD

Source

pub const SLATEGRAY: Self

slategray: #708090

Source

pub const SLATEGREY: Self

slategrey: #708090

Source

pub const SNOW: Self

snow: #FFFAFA

Source

pub const SPRINGGREEN: Self

springgreen: #00FF7F

Source

pub const STEELBLUE: Self

steelblue: #4682B4

Source

pub const TAN: Self

tan: #D2B48C

Source

pub const TEAL: Self

teal: #008080

Source

pub const THISTLE: Self

thistle: #D8BFD8

Source

pub const TOMATO: Self

tomato: #FF6347

Source

pub const TURQUOISE: Self

turquoise: #40E0D0

Source

pub const VIOLET: Self

violet: #EE82EE

Source

pub const WHEAT: Self

wheat: #F5DEB3

Source

pub const WHITE: Self

white: #FFFFFF

Source

pub const WHITESMOKE: Self

whitesmoke: #F5F5F5

Source

pub const YELLOW: Self

yellow: #FFFF00

Source

pub const YELLOWGREEN: Self

yellowgreen: #9ACD32

Trait Implementations§

Source§

impl Clone for RGB

Source§

fn clone(&self) -> RGB

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 RGB

Source§

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

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

impl Default for RGB

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl From<RGB> for RGBA32

Source§

fn from(rgb: RGB) -> Self

Converts to this type from the input type.
Source§

impl From<RGBA32> for RGB

Source§

fn from(rgba: RGBA32) -> Self

Converts to this type from the input type.
Source§

impl LowerHex for RGB

Source§

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

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

impl PartialEq for RGB

Source§

fn eq(&self, other: &RGB) -> 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 PartialOrd for RGB

Source§

fn partial_cmp(&self, other: &RGB) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

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

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

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

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

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

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

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

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl UpperHex for RGB

Source§

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

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

impl Copy for RGB

Source§

impl StructuralPartialEq for RGB

Auto Trait Implementations§

§

impl Freeze for RGB

§

impl RefUnwindSafe for RGB

§

impl Send for RGB

§

impl Sync for RGB

§

impl Unpin for RGB

§

impl UnwindSafe for RGB

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