Table of Contents

Struct Color

Namespace
Microsoft.Xna.Framework
Assembly
MonoGame.Framework.dll

Describes a 32-bit packed color.

[DataContract]
public struct Color : IEquatable<Color>
Implements
Inherited Members

Constructors

Color(Color, int)

Constructs an RGBA color from a Color and an alpha value.

public Color(Color color, int alpha)

Parameters

color Color

A Color for RGB values of new Color instance.

alpha int

The alpha component value from 0 to 255.

Color(Color, float)

Constructs an RGBA color from color and alpha value.

public Color(Color color, float alpha)

Parameters

color Color

A Color for RGB values of new Color instance.

alpha float

Alpha component value from 0.0f to 1.0f.

Color(Vector3)

Constructs an RGBA color from the XYZ unit length components of a vector. Alpha value will be opaque.

public Color(Vector3 color)

Parameters

color Vector3

A Vector3 representing color.

Color(Vector4)

Constructs an RGBA color from the XYZW unit length components of a vector.

public Color(Vector4 color)

Parameters

color Vector4

A Vector4 representing color.

Color(byte, byte, byte, byte)

Constructs an RGBA color from scalars representing red, green, blue and alpha values.

public Color(byte r, byte g, byte b, byte alpha)

Parameters

r byte
g byte
b byte
alpha byte

Remarks

This overload sets the values directly without clamping, and may therefore be faster than the other overloads.

Color(int, int, int)

Constructs an RGBA color from scalars representing red, green and blue values. Alpha value will be opaque.

public Color(int r, int g, int b)

Parameters

r int

Red component value from 0 to 255.

g int

Green component value from 0 to 255.

b int

Blue component value from 0 to 255.

Color(int, int, int, int)

Constructs an RGBA color from scalars representing red, green, blue and alpha values.

public Color(int r, int g, int b, int alpha)

Parameters

r int

Red component value from 0 to 255.

g int

Green component value from 0 to 255.

b int

Blue component value from 0 to 255.

alpha int

Alpha component value from 0 to 255.

Color(float, float, float)

Constructs an RGBA color from scalars representing red, green and blue values. Alpha value will be opaque.

public Color(float r, float g, float b)

Parameters

r float

Red component value from 0.0f to 1.0f.

g float

Green component value from 0.0f to 1.0f.

b float

Blue component value from 0.0f to 1.0f.

Color(float, float, float, float)

Constructs an RGBA color from scalars representing red, green, blue and alpha values.

public Color(float r, float g, float b, float alpha)

Parameters

r float

Red component value from 0.0f to 1.0f.

g float

Green component value from 0.0f to 1.0f.

b float

Blue component value from 0.0f to 1.0f.

alpha float

Alpha component value from 0.0f to 1.0f.

Color(uint)

Constructs an RGBA color from a packed value. The value is a 32-bit unsigned integer, with R in the least significant octet.

public Color(uint packedValue)

Parameters

packedValue uint

The packed value.

Properties

A

Gets or sets the alpha component.

[DataMember]
public byte A { get; set; }

Property Value

byte

AliceBlue

AliceBlue color (R:240,G:248,B:255,A:255).

public static Color AliceBlue { get; }

Property Value

Color

AntiqueWhite

AntiqueWhite color (R:250,G:235,B:215,A:255).

public static Color AntiqueWhite { get; }

Property Value

Color

Aqua

Aqua color (R:0,G:255,B:255,A:255).

public static Color Aqua { get; }

Property Value

Color

Aquamarine

Aquamarine color (R:127,G:255,B:212,A:255).

public static Color Aquamarine { get; }

Property Value

Color

Azure

Azure color (R:240,G:255,B:255,A:255).

public static Color Azure { get; }

Property Value

Color

B

Gets or sets the blue component.

[DataMember]
public byte B { get; set; }

Property Value

byte

Beige

Beige color (R:245,G:245,B:220,A:255).

public static Color Beige { get; }

Property Value

Color

Bisque

Bisque color (R:255,G:228,B:196,A:255).

public static Color Bisque { get; }

Property Value

Color

Black

Black color (R:0,G:0,B:0,A:255).

public static Color Black { get; }

Property Value

Color

BlanchedAlmond

BlanchedAlmond color (R:255,G:235,B:205,A:255).

public static Color BlanchedAlmond { get; }

Property Value

Color

Blue

Blue color (R:0,G:0,B:255,A:255).

public static Color Blue { get; }

Property Value

Color

BlueViolet

BlueViolet color (R:138,G:43,B:226,A:255).

public static Color BlueViolet { get; }

Property Value

Color

Brown

Brown color (R:165,G:42,B:42,A:255).

public static Color Brown { get; }

Property Value

Color

BurlyWood

BurlyWood color (R:222,G:184,B:135,A:255).

public static Color BurlyWood { get; }

Property Value

Color

CadetBlue

CadetBlue color (R:95,G:158,B:160,A:255).

public static Color CadetBlue { get; }

Property Value

Color

Chartreuse

Chartreuse color (R:127,G:255,B:0,A:255).

public static Color Chartreuse { get; }

Property Value

Color

Chocolate

Chocolate color (R:210,G:105,B:30,A:255).

public static Color Chocolate { get; }

Property Value

Color

Coral

Coral color (R:255,G:127,B:80,A:255).

public static Color Coral { get; }

Property Value

Color

CornflowerBlue

CornflowerBlue color (R:100,G:149,B:237,A:255).

public static Color CornflowerBlue { get; }

Property Value

Color

Cornsilk

Cornsilk color (R:255,G:248,B:220,A:255).

public static Color Cornsilk { get; }

Property Value

Color

Crimson

Crimson color (R:220,G:20,B:60,A:255).

public static Color Crimson { get; }

Property Value

Color

Cyan

Cyan color (R:0,G:255,B:255,A:255).

public static Color Cyan { get; }

Property Value

Color

DarkBlue

DarkBlue color (R:0,G:0,B:139,A:255).

public static Color DarkBlue { get; }

Property Value

Color

DarkCyan

DarkCyan color (R:0,G:139,B:139,A:255).

public static Color DarkCyan { get; }

Property Value

Color

DarkGoldenrod

DarkGoldenrod color (R:184,G:134,B:11,A:255).

public static Color DarkGoldenrod { get; }

Property Value

Color

DarkGray

DarkGray color (R:169,G:169,B:169,A:255).

public static Color DarkGray { get; }

Property Value

Color

DarkGreen

DarkGreen color (R:0,G:100,B:0,A:255).

public static Color DarkGreen { get; }

Property Value

Color

DarkKhaki

DarkKhaki color (R:189,G:183,B:107,A:255).

public static Color DarkKhaki { get; }

Property Value

Color

DarkMagenta

DarkMagenta color (R:139,G:0,B:139,A:255).

public static Color DarkMagenta { get; }

Property Value

Color

DarkOliveGreen

DarkOliveGreen color (R:85,G:107,B:47,A:255).

public static Color DarkOliveGreen { get; }

Property Value

Color

DarkOrange

DarkOrange color (R:255,G:140,B:0,A:255).

public static Color DarkOrange { get; }

Property Value

Color

DarkOrchid

DarkOrchid color (R:153,G:50,B:204,A:255).

public static Color DarkOrchid { get; }

Property Value

Color

DarkRed

DarkRed color (R:139,G:0,B:0,A:255).

public static Color DarkRed { get; }

Property Value

Color

DarkSalmon

DarkSalmon color (R:233,G:150,B:122,A:255).

public static Color DarkSalmon { get; }

Property Value

Color

DarkSeaGreen

DarkSeaGreen color (R:143,G:188,B:139,A:255).

public static Color DarkSeaGreen { get; }

Property Value

Color

DarkSlateBlue

DarkSlateBlue color (R:72,G:61,B:139,A:255).

public static Color DarkSlateBlue { get; }

Property Value

Color

DarkSlateGray

DarkSlateGray color (R:47,G:79,B:79,A:255).

public static Color DarkSlateGray { get; }

Property Value

Color

DarkTurquoise

DarkTurquoise color (R:0,G:206,B:209,A:255).

public static Color DarkTurquoise { get; }

Property Value

Color

DarkViolet

DarkViolet color (R:148,G:0,B:211,A:255).

public static Color DarkViolet { get; }

Property Value

Color

DeepPink

DeepPink color (R:255,G:20,B:147,A:255).

public static Color DeepPink { get; }

Property Value

Color

DeepSkyBlue

DeepSkyBlue color (R:0,G:191,B:255,A:255).

public static Color DeepSkyBlue { get; }

Property Value

Color

DimGray

DimGray color (R:105,G:105,B:105,A:255).

public static Color DimGray { get; }

Property Value

Color

DodgerBlue

DodgerBlue color (R:30,G:144,B:255,A:255).

public static Color DodgerBlue { get; }

Property Value

Color

Firebrick

Firebrick color (R:178,G:34,B:34,A:255).

public static Color Firebrick { get; }

Property Value

Color

FloralWhite

FloralWhite color (R:255,G:250,B:240,A:255).

public static Color FloralWhite { get; }

Property Value

Color

ForestGreen

ForestGreen color (R:34,G:139,B:34,A:255).

public static Color ForestGreen { get; }

Property Value

Color

Fuchsia

Fuchsia color (R:255,G:0,B:255,A:255).

public static Color Fuchsia { get; }

Property Value

Color

G

Gets or sets the green component.

[DataMember]
public byte G { get; set; }

Property Value

byte

Gainsboro

Gainsboro color (R:220,G:220,B:220,A:255).

public static Color Gainsboro { get; }

Property Value

Color

GhostWhite

GhostWhite color (R:248,G:248,B:255,A:255).

public static Color GhostWhite { get; }

Property Value

Color

Gold

Gold color (R:255,G:215,B:0,A:255).

public static Color Gold { get; }

Property Value

Color

Goldenrod

Goldenrod color (R:218,G:165,B:32,A:255).

public static Color Goldenrod { get; }

Property Value

Color

Gray

Gray color (R:128,G:128,B:128,A:255).

public static Color Gray { get; }

Property Value

Color

Green

Green color (R:0,G:128,B:0,A:255).

public static Color Green { get; }

Property Value

Color

GreenYellow

GreenYellow color (R:173,G:255,B:47,A:255).

public static Color GreenYellow { get; }

Property Value

Color

Honeydew

Honeydew color (R:240,G:255,B:240,A:255).

public static Color Honeydew { get; }

Property Value

Color

HotPink

HotPink color (R:255,G:105,B:180,A:255).

public static Color HotPink { get; }

Property Value

Color

IndianRed

IndianRed color (R:205,G:92,B:92,A:255).

public static Color IndianRed { get; }

Property Value

Color

Indigo

Indigo color (R:75,G:0,B:130,A:255).

public static Color Indigo { get; }

Property Value

Color

Ivory

Ivory color (R:255,G:255,B:240,A:255).

public static Color Ivory { get; }

Property Value

Color

Khaki

Khaki color (R:240,G:230,B:140,A:255).

public static Color Khaki { get; }

Property Value

Color

Lavender

Lavender color (R:230,G:230,B:250,A:255).

public static Color Lavender { get; }

Property Value

Color

LavenderBlush

LavenderBlush color (R:255,G:240,B:245,A:255).

public static Color LavenderBlush { get; }

Property Value

Color

LawnGreen

LawnGreen color (R:124,G:252,B:0,A:255).

public static Color LawnGreen { get; }

Property Value

Color

LemonChiffon

LemonChiffon color (R:255,G:250,B:205,A:255).

public static Color LemonChiffon { get; }

Property Value

Color

LightBlue

LightBlue color (R:173,G:216,B:230,A:255).

public static Color LightBlue { get; }

Property Value

Color

LightCoral

LightCoral color (R:240,G:128,B:128,A:255).

public static Color LightCoral { get; }

Property Value

Color

LightCyan

LightCyan color (R:224,G:255,B:255,A:255).

public static Color LightCyan { get; }

Property Value

Color

LightGoldenrodYellow

LightGoldenrodYellow color (R:250,G:250,B:210,A:255).

public static Color LightGoldenrodYellow { get; }

Property Value

Color

LightGray

LightGray color (R:211,G:211,B:211,A:255).

public static Color LightGray { get; }

Property Value

Color

LightGreen

LightGreen color (R:144,G:238,B:144,A:255).

public static Color LightGreen { get; }

Property Value

Color

LightPink

LightPink color (R:255,G:182,B:193,A:255).

public static Color LightPink { get; }

Property Value

Color

LightSalmon

LightSalmon color (R:255,G:160,B:122,A:255).

public static Color LightSalmon { get; }

Property Value

Color

LightSeaGreen

LightSeaGreen color (R:32,G:178,B:170,A:255).

public static Color LightSeaGreen { get; }

Property Value

Color

LightSkyBlue

LightSkyBlue color (R:135,G:206,B:250,A:255).

public static Color LightSkyBlue { get; }

Property Value

Color

LightSlateGray

LightSlateGray color (R:119,G:136,B:153,A:255).

public static Color LightSlateGray { get; }

Property Value

Color

LightSteelBlue

LightSteelBlue color (R:176,G:196,B:222,A:255).

public static Color LightSteelBlue { get; }

Property Value

Color

LightYellow

LightYellow color (R:255,G:255,B:224,A:255).

public static Color LightYellow { get; }

Property Value

Color

Lime

Lime color (R:0,G:255,B:0,A:255).

public static Color Lime { get; }

Property Value

Color

LimeGreen

LimeGreen color (R:50,G:205,B:50,A:255).

public static Color LimeGreen { get; }

Property Value

Color

Linen

Linen color (R:250,G:240,B:230,A:255).

public static Color Linen { get; }

Property Value

Color

Magenta

Magenta color (R:255,G:0,B:255,A:255).

public static Color Magenta { get; }

Property Value

Color

Maroon

Maroon color (R:128,G:0,B:0,A:255).

public static Color Maroon { get; }

Property Value

Color

MediumAquamarine

MediumAquamarine color (R:102,G:205,B:170,A:255).

public static Color MediumAquamarine { get; }

Property Value

Color

MediumBlue

MediumBlue color (R:0,G:0,B:205,A:255).

public static Color MediumBlue { get; }

Property Value

Color

MediumOrchid

MediumOrchid color (R:186,G:85,B:211,A:255).

public static Color MediumOrchid { get; }

Property Value

Color

MediumPurple

MediumPurple color (R:147,G:112,B:219,A:255).

public static Color MediumPurple { get; }

Property Value

Color

MediumSeaGreen

MediumSeaGreen color (R:60,G:179,B:113,A:255).

public static Color MediumSeaGreen { get; }

Property Value

Color

MediumSlateBlue

MediumSlateBlue color (R:123,G:104,B:238,A:255).

public static Color MediumSlateBlue { get; }

Property Value

Color

MediumSpringGreen

MediumSpringGreen color (R:0,G:250,B:154,A:255).

public static Color MediumSpringGreen { get; }

Property Value

Color

MediumTurquoise

MediumTurquoise color (R:72,G:209,B:204,A:255).

public static Color MediumTurquoise { get; }

Property Value

Color

MediumVioletRed

MediumVioletRed color (R:199,G:21,B:133,A:255).

public static Color MediumVioletRed { get; }

Property Value

Color

MidnightBlue

MidnightBlue color (R:25,G:25,B:112,A:255).

public static Color MidnightBlue { get; }

Property Value

Color

MintCream

MintCream color (R:245,G:255,B:250,A:255).

public static Color MintCream { get; }

Property Value

Color

MistyRose

MistyRose color (R:255,G:228,B:225,A:255).

public static Color MistyRose { get; }

Property Value

Color

Moccasin

Moccasin color (R:255,G:228,B:181,A:255).

public static Color Moccasin { get; }

Property Value

Color

MonoGameOrange

MonoGame orange theme color (R:231,G:60,B:0,A:255).

public static Color MonoGameOrange { get; }

Property Value

Color

NavajoWhite

NavajoWhite color (R:255,G:222,B:173,A:255).

public static Color NavajoWhite { get; }

Property Value

Color

Navy

Navy color (R:0,G:0,B:128,A:255).

public static Color Navy { get; }

Property Value

Color

OldLace

OldLace color (R:253,G:245,B:230,A:255).

public static Color OldLace { get; }

Property Value

Color

Olive

Olive color (R:128,G:128,B:0,A:255).

public static Color Olive { get; }

Property Value

Color

OliveDrab

OliveDrab color (R:107,G:142,B:35,A:255).

public static Color OliveDrab { get; }

Property Value

Color

Orange

Orange color (R:255,G:165,B:0,A:255).

public static Color Orange { get; }

Property Value

Color

OrangeRed

OrangeRed color (R:255,G:69,B:0,A:255).

public static Color OrangeRed { get; }

Property Value

Color

Orchid

Orchid color (R:218,G:112,B:214,A:255).

public static Color Orchid { get; }

Property Value

Color

PackedValue

Gets or sets packed value of this Color.

public uint PackedValue { get; set; }

Property Value

uint

PaleGoldenrod

PaleGoldenrod color (R:238,G:232,B:170,A:255).

public static Color PaleGoldenrod { get; }

Property Value

Color

PaleGreen

PaleGreen color (R:152,G:251,B:152,A:255).

public static Color PaleGreen { get; }

Property Value

Color

PaleTurquoise

PaleTurquoise color (R:175,G:238,B:238,A:255).

public static Color PaleTurquoise { get; }

Property Value

Color

PaleVioletRed

PaleVioletRed color (R:219,G:112,B:147,A:255).

public static Color PaleVioletRed { get; }

Property Value

Color

PapayaWhip

PapayaWhip color (R:255,G:239,B:213,A:255).

public static Color PapayaWhip { get; }

Property Value

Color

PeachPuff

PeachPuff color (R:255,G:218,B:185,A:255).

public static Color PeachPuff { get; }

Property Value

Color

Peru

Peru color (R:205,G:133,B:63,A:255).

public static Color Peru { get; }

Property Value

Color

Pink

Pink color (R:255,G:192,B:203,A:255).

public static Color Pink { get; }

Property Value

Color

Plum

Plum color (R:221,G:160,B:221,A:255).

public static Color Plum { get; }

Property Value

Color

PowderBlue

PowderBlue color (R:176,G:224,B:230,A:255).

public static Color PowderBlue { get; }

Property Value

Color

Purple

Purple color (R:128,G:0,B:128,A:255).

public static Color Purple { get; }

Property Value

Color

R

Gets or sets the red component.

[DataMember]
public byte R { get; set; }

Property Value

byte

Red

Red color (R:255,G:0,B:0,A:255).

public static Color Red { get; }

Property Value

Color

RosyBrown

RosyBrown color (R:188,G:143,B:143,A:255).

public static Color RosyBrown { get; }

Property Value

Color

RoyalBlue

RoyalBlue color (R:65,G:105,B:225,A:255).

public static Color RoyalBlue { get; }

Property Value

Color

SaddleBrown

SaddleBrown color (R:139,G:69,B:19,A:255).

public static Color SaddleBrown { get; }

Property Value

Color

Salmon

Salmon color (R:250,G:128,B:114,A:255).

public static Color Salmon { get; }

Property Value

Color

SandyBrown

SandyBrown color (R:244,G:164,B:96,A:255).

public static Color SandyBrown { get; }

Property Value

Color

SeaGreen

SeaGreen color (R:46,G:139,B:87,A:255).

public static Color SeaGreen { get; }

Property Value

Color

SeaShell

SeaShell color (R:255,G:245,B:238,A:255).

public static Color SeaShell { get; }

Property Value

Color

Sienna

Sienna color (R:160,G:82,B:45,A:255).

public static Color Sienna { get; }

Property Value

Color

Silver

Silver color (R:192,G:192,B:192,A:255).

public static Color Silver { get; }

Property Value

Color

SkyBlue

SkyBlue color (R:135,G:206,B:235,A:255).

public static Color SkyBlue { get; }

Property Value

Color

SlateBlue

SlateBlue color (R:106,G:90,B:205,A:255).

public static Color SlateBlue { get; }

Property Value

Color

SlateGray

SlateGray color (R:112,G:128,B:144,A:255).

public static Color SlateGray { get; }

Property Value

Color

Snow

Snow color (R:255,G:250,B:250,A:255).

public static Color Snow { get; }

Property Value

Color

SpringGreen

SpringGreen color (R:0,G:255,B:127,A:255).

public static Color SpringGreen { get; }

Property Value

Color

SteelBlue

SteelBlue color (R:70,G:130,B:180,A:255).

public static Color SteelBlue { get; }

Property Value

Color

Tan

Tan color (R:210,G:180,B:140,A:255).

public static Color Tan { get; }

Property Value

Color

Teal

Teal color (R:0,G:128,B:128,A:255).

public static Color Teal { get; }

Property Value

Color

Thistle

Thistle color (R:216,G:191,B:216,A:255).

public static Color Thistle { get; }

Property Value

Color

Tomato

Tomato color (R:255,G:99,B:71,A:255).

public static Color Tomato { get; }

Property Value

Color

Transparent

Transparent color (R:0,G:0,B:0,A:0).

public static Color Transparent { get; }

Property Value

Color

Turquoise

Turquoise color (R:64,G:224,B:208,A:255).

public static Color Turquoise { get; }

Property Value

Color

Violet

Violet color (R:238,G:130,B:238,A:255).

public static Color Violet { get; }

Property Value

Color

Wheat

Wheat color (R:245,G:222,B:179,A:255).

public static Color Wheat { get; }

Property Value

Color

White

White color (R:255,G:255,B:255,A:255).

public static Color White { get; }

Property Value

Color

WhiteSmoke

WhiteSmoke color (R:245,G:245,B:245,A:255).

public static Color WhiteSmoke { get; }

Property Value

Color

Yellow

Yellow color (R:255,G:255,B:0,A:255).

public static Color Yellow { get; }

Property Value

Color

YellowGreen

YellowGreen color (R:154,G:205,B:50,A:255).

public static Color YellowGreen { get; }

Property Value

Color

Methods

Deconstruct(out byte, out byte, out byte)

Deconstruction method for Color.

public void Deconstruct(out byte r, out byte g, out byte b)

Parameters

r byte

Red component value from 0 to 255.

g byte

Green component value from 0 to 255.

b byte

Blue component value from 0 to 255.

Deconstruct(out byte, out byte, out byte, out byte)

Deconstruction method for Color with Alpha.

public void Deconstruct(out byte r, out byte g, out byte b, out byte a)

Parameters

r byte

Red component value from 0 to 255.

g byte

Green component value from 0 to 255.

b byte

Blue component value from 0 to 255.

a byte

Alpha component value from 0 to 255.

Deconstruct(out float, out float, out float)

Deconstruction method for Color.

public void Deconstruct(out float r, out float g, out float b)

Parameters

r float

Red component value from 0.0f to 1.0f.

g float

Green component value from 0.0f to 1.0f.

b float

Blue component value from 0.0f to 1.0f.

Deconstruct(out float, out float, out float, out float)

Deconstruction method for Color with Alpha.

public void Deconstruct(out float r, out float g, out float b, out float a)

Parameters

r float

Red component value from 0.0f to 1.0f.

g float

Green component value from 0.0f to 1.0f.

b float

Blue component value from 0.0f to 1.0f.

a float

Alpha component value from 0.0f to 1.0f.

Equals(Color)

Compares whether current instance is equal to specified Color.

public bool Equals(Color other)

Parameters

other Color

The Color to compare.

Returns

bool

true if the instances are equal; false otherwise.

Equals(object)

Compares whether current instance is equal to specified object.

public override bool Equals(object obj)

Parameters

obj object

The Color to compare.

Returns

bool

true if the instances are equal; false otherwise.

FromNonPremultiplied(Vector4)

Translate a non-premultipled alpha Color to a Color that contains premultiplied alpha.

public static Color FromNonPremultiplied(Vector4 vector)

Parameters

vector Vector4

A Vector4 representing color.

Returns

Color

A Color which contains premultiplied alpha data.

FromNonPremultiplied(int, int, int, int)

Translate a non-premultipled alpha Color to a Color that contains premultiplied alpha.

public static Color FromNonPremultiplied(int r, int g, int b, int a)

Parameters

r int

Red component value.

g int

Green component value.

b int

Blue component value.

a int

Alpha component value.

Returns

Color

A Color which contains premultiplied alpha data.

GetHashCode()

Gets the hash code of this Color.

public override int GetHashCode()

Returns

int

Hash code of this Color.

Lerp(Color, Color, float)

Performs linear interpolation of Color.

public static Color Lerp(Color value1, Color value2, float amount)

Parameters

value1 Color

Source Color.

value2 Color

Destination Color.

amount float

Interpolation factor.

Returns

Color

Interpolated Color.

LerpPrecise(Color, Color, float)

Lerp(Color, Color, float) should be used instead of this function.

[Obsolete("Color.Lerp should be used instead of this function.")]
public static Color LerpPrecise(Color value1, Color value2, float amount)

Parameters

value1 Color
value2 Color
amount float

Returns

Color

Interpolated Color.

Multiply(Color, float)

Multiplies the RGBA component values of a color by the specified value.

public static Color Multiply(Color value, float scale)

Parameters

value Color

The source color value to multiply.

scale float

The value to multiply the RGBA component values by.

Returns

Color

The new color value created as a result of the multiplication.

ToString()

Returns a string representation of this Color in the format: {R:[red] G:[green] B:[blue] A:[alpha]}

public override string ToString()

Returns

string

string representation of this Color.

ToVector3()

Gets a Vector3 representation for this object.

public Vector3 ToVector3()

Returns

Vector3

A Vector3 representation for this object.

ToVector4()

Gets a Vector4 representation for this object.

public Vector4 ToVector4()

Returns

Vector4

A Vector4 representation for this object.

Operators

operator ==(Color, Color)

Compares whether two Color instances are equal.

public static bool operator ==(Color a, Color b)

Parameters

a Color

Color instance on the left of the equal sign.

b Color

Color instance on the right of the equal sign.

Returns

bool

true if the instances are equal; false otherwise.

operator !=(Color, Color)

Compares whether two Color instances are not equal.

public static bool operator !=(Color a, Color b)

Parameters

a Color

Color instance on the left of the not equal sign.

b Color

Color instance on the right of the not equal sign.

Returns

bool

true if the instances are not equal; false otherwise.

operator *(Color, float)

Multiplies the RGBA component values of a color by the specified value.

public static Color operator *(Color value, float scale)

Parameters

value Color

The source color value to multiply.

scale float

The value to multiply the RGBA component values by.

Returns

Color

The new color value created as a result of the multiplication.

operator *(float, Color)

Multiplies the RGBA component values of a color by the specified value.

public static Color operator *(float scale, Color value)

Parameters

scale float

The value to multiply the RGBA component values by.

value Color

The source color value to multiply.

Returns

Color

The new color value created as a result of the multiplication.