Show / Hide Table of Contents

Struct Color4

Represents a color with 4 floating-point components (R, G, B, A).

Implements
IEquatable<Color4>
IFormattable
Inherited Members
object.Equals(object, object)
object.GetType()
object.ReferenceEquals(object, object)
Namespace: OpenTK.Mathematics
Assembly: OpenTK.Mathematics.dll
Syntax
[Serializable]
public struct Color4 : IEquatable<Color4>, IFormattable

Constructors

Color4(byte, byte, byte, byte)

Initializes a new instance of the Color4 struct.

Declaration
public Color4(byte r, byte g, byte b, byte a)
Parameters
Type Name Description
byte r

The red component of the new Color4 structure.

byte g

The green component of the new Color4 structure.

byte b

The blue component of the new Color4 structure.

byte a

The alpha component of the new Color4 structure.

Color4(float, float, float, float)

Initializes a new instance of the Color4 struct.

Declaration
public Color4(float r, float g, float b, float a)
Parameters
Type Name Description
float r

The red component of the new Color4 structure.

float g

The green component of the new Color4 structure.

float b

The blue component of the new Color4 structure.

float a

The alpha component of the new Color4 structure.

Fields

A

The alpha component of this Color4 structure.

Declaration
public float A
Field Value
Type Description
float

B

The blue component of this Color4 structure.

Declaration
public float B
Field Value
Type Description
float

G

The green component of this Color4 structure.

Declaration
public float G
Field Value
Type Description
float

R

The red component of this Color4 structure.

Declaration
public float R
Field Value
Type Description
float

Properties

AliceBlue

Gets the system color with (R, G, B, A) = (240, 248, 255, 255).

Declaration
public static Color4 AliceBlue { get; }
Property Value
Type Description
Color4

AntiqueWhite

Gets the system color with (R, G, B, A) = (250, 235, 215, 255).

Declaration
public static Color4 AntiqueWhite { get; }
Property Value
Type Description
Color4

Aqua

Gets the system color with (R, G, B, A) = (0, 255, 255, 255).

Declaration
public static Color4 Aqua { get; }
Property Value
Type Description
Color4

Aquamarine

Gets the system color with (R, G, B, A) = (127, 255, 212, 255).

Declaration
public static Color4 Aquamarine { get; }
Property Value
Type Description
Color4

Azure

Gets the system color with (R, G, B, A) = (240, 255, 255, 255).

Declaration
public static Color4 Azure { get; }
Property Value
Type Description
Color4

Beige

Gets the system color with (R, G, B, A) = (245, 245, 220, 255).

Declaration
public static Color4 Beige { get; }
Property Value
Type Description
Color4

Bisque

Gets the system color with (R, G, B, A) = (255, 228, 196, 255).

Declaration
public static Color4 Bisque { get; }
Property Value
Type Description
Color4

Black

Gets the system color with (R, G, B, A) = (0, 0, 0, 255).

Declaration
public static Color4 Black { get; }
Property Value
Type Description
Color4

BlanchedAlmond

Gets the system color with (R, G, B, A) = (255, 235, 205, 255).

Declaration
public static Color4 BlanchedAlmond { get; }
Property Value
Type Description
Color4

Blue

Gets the system color with (R, G, B, A) = (0, 0, 255, 255).

Declaration
public static Color4 Blue { get; }
Property Value
Type Description
Color4

BlueViolet

Gets the system color with (R, G, B, A) = (138, 43, 226, 255).

Declaration
public static Color4 BlueViolet { get; }
Property Value
Type Description
Color4

Brown

Gets the system color with (R, G, B, A) = (165, 42, 42, 255).

Declaration
public static Color4 Brown { get; }
Property Value
Type Description
Color4

BurlyWood

Gets the system color with (R, G, B, A) = (222, 184, 135, 255).

Declaration
public static Color4 BurlyWood { get; }
Property Value
Type Description
Color4

CadetBlue

Gets the system color with (R, G, B, A) = (95, 158, 160, 255).

Declaration
public static Color4 CadetBlue { get; }
Property Value
Type Description
Color4

Chartreuse

Gets the system color with (R, G, B, A) = (127, 255, 0, 255).

Declaration
public static Color4 Chartreuse { get; }
Property Value
Type Description
Color4

Chocolate

Gets the system color with (R, G, B, A) = (210, 105, 30, 255).

Declaration
public static Color4 Chocolate { get; }
Property Value
Type Description
Color4

Coral

Gets the system color with (R, G, B, A) = (255, 127, 80, 255).

Declaration
public static Color4 Coral { get; }
Property Value
Type Description
Color4

CornflowerBlue

Gets the system color with (R, G, B, A) = (100, 149, 237, 255).

Declaration
public static Color4 CornflowerBlue { get; }
Property Value
Type Description
Color4

Cornsilk

Gets the system color with (R, G, B, A) = (255, 248, 220, 255).

Declaration
public static Color4 Cornsilk { get; }
Property Value
Type Description
Color4

Crimson

Gets the system color with (R, G, B, A) = (220, 20, 60, 255).

Declaration
public static Color4 Crimson { get; }
Property Value
Type Description
Color4

Cyan

Gets the system color with (R, G, B, A) = (0, 255, 255, 255).

Declaration
public static Color4 Cyan { get; }
Property Value
Type Description
Color4

DarkBlue

Gets the system color with (R, G, B, A) = (0, 0, 139, 255).

Declaration
public static Color4 DarkBlue { get; }
Property Value
Type Description
Color4

DarkCyan

Gets the system color with (R, G, B, A) = (0, 139, 139, 255).

Declaration
public static Color4 DarkCyan { get; }
Property Value
Type Description
Color4

DarkGoldenrod

Gets the system color with (R, G, B, A) = (184, 134, 11, 255).

Declaration
public static Color4 DarkGoldenrod { get; }
Property Value
Type Description
Color4

DarkGray

Gets the system color with (R, G, B, A) = (169, 169, 169, 255).

Declaration
public static Color4 DarkGray { get; }
Property Value
Type Description
Color4

DarkGreen

Gets the system color with (R, G, B, A) = (0, 100, 0, 255).

Declaration
public static Color4 DarkGreen { get; }
Property Value
Type Description
Color4

DarkKhaki

Gets the system color with (R, G, B, A) = (189, 183, 107, 255).

Declaration
public static Color4 DarkKhaki { get; }
Property Value
Type Description
Color4

DarkMagenta

Gets the system color with (R, G, B, A) = (139, 0, 139, 255).

Declaration
public static Color4 DarkMagenta { get; }
Property Value
Type Description
Color4

DarkOliveGreen

Gets the system color with (R, G, B, A) = (85, 107, 47, 255).

Declaration
public static Color4 DarkOliveGreen { get; }
Property Value
Type Description
Color4

DarkOrange

Gets the system color with (R, G, B, A) = (255, 140, 0, 255).

Declaration
public static Color4 DarkOrange { get; }
Property Value
Type Description
Color4

DarkOrchid

Gets the system color with (R, G, B, A) = (153, 50, 204, 255).

Declaration
public static Color4 DarkOrchid { get; }
Property Value
Type Description
Color4

DarkRed

Gets the system color with (R, G, B, A) = (139, 0, 0, 255).

Declaration
public static Color4 DarkRed { get; }
Property Value
Type Description
Color4

DarkSalmon

Gets the system color with (R, G, B, A) = (233, 150, 122, 255).

Declaration
public static Color4 DarkSalmon { get; }
Property Value
Type Description
Color4

DarkSeaGreen

Gets the system color with (R, G, B, A) = (143, 188, 139, 255).

Declaration
public static Color4 DarkSeaGreen { get; }
Property Value
Type Description
Color4

DarkSlateBlue

Gets the system color with (R, G, B, A) = (72, 61, 139, 255).

Declaration
public static Color4 DarkSlateBlue { get; }
Property Value
Type Description
Color4

DarkSlateGray

Gets the system color with (R, G, B, A) = (47, 79, 79, 255).

Declaration
public static Color4 DarkSlateGray { get; }
Property Value
Type Description
Color4

DarkTurquoise

Gets the system color with (R, G, B, A) = (0, 206, 209, 255).

Declaration
public static Color4 DarkTurquoise { get; }
Property Value
Type Description
Color4

DarkViolet

Gets the system color with (R, G, B, A) = (148, 0, 211, 255).

Declaration
public static Color4 DarkViolet { get; }
Property Value
Type Description
Color4

DeepPink

Gets the system color with (R, G, B, A) = (255, 20, 147, 255).

Declaration
public static Color4 DeepPink { get; }
Property Value
Type Description
Color4

DeepSkyBlue

Gets the system color with (R, G, B, A) = (0, 191, 255, 255).

Declaration
public static Color4 DeepSkyBlue { get; }
Property Value
Type Description
Color4

DimGray

Gets the system color with (R, G, B, A) = (105, 105, 105, 255).

Declaration
public static Color4 DimGray { get; }
Property Value
Type Description
Color4

DodgerBlue

Gets the system color with (R, G, B, A) = (30, 144, 255, 255).

Declaration
public static Color4 DodgerBlue { get; }
Property Value
Type Description
Color4

Firebrick

Gets the system color with (R, G, B, A) = (178, 34, 34, 255).

Declaration
public static Color4 Firebrick { get; }
Property Value
Type Description
Color4

FloralWhite

Gets the system color with (R, G, B, A) = (255, 250, 240, 255).

Declaration
public static Color4 FloralWhite { get; }
Property Value
Type Description
Color4

ForestGreen

Gets the system color with (R, G, B, A) = (34, 139, 34, 255).

Declaration
public static Color4 ForestGreen { get; }
Property Value
Type Description
Color4

Fuchsia

Gets the system color with (R, G, B, A) = (255, 0, 255, 255).

Declaration
public static Color4 Fuchsia { get; }
Property Value
Type Description
Color4

Gainsboro

Gets the system color with (R, G, B, A) = (220, 220, 220, 255).

Declaration
public static Color4 Gainsboro { get; }
Property Value
Type Description
Color4

GhostWhite

Gets the system color with (R, G, B, A) = (248, 248, 255, 255).

Declaration
public static Color4 GhostWhite { get; }
Property Value
Type Description
Color4

Gold

Gets the system color with (R, G, B, A) = (255, 215, 0, 255).

Declaration
public static Color4 Gold { get; }
Property Value
Type Description
Color4

Goldenrod

Gets the system color with (R, G, B, A) = (218, 165, 32, 255).

Declaration
public static Color4 Goldenrod { get; }
Property Value
Type Description
Color4

Gray

Gets the system color with (R, G, B, A) = (128, 128, 128, 255).

Declaration
public static Color4 Gray { get; }
Property Value
Type Description
Color4

Green

Gets the system color with (R, G, B, A) = (0, 128, 0, 255).

Declaration
public static Color4 Green { get; }
Property Value
Type Description
Color4

GreenYellow

Gets the system color with (R, G, B, A) = (173, 255, 47, 255).

Declaration
public static Color4 GreenYellow { get; }
Property Value
Type Description
Color4

Honeydew

Gets the system color with (R, G, B, A) = (240, 255, 240, 255).

Declaration
public static Color4 Honeydew { get; }
Property Value
Type Description
Color4

HotPink

Gets the system color with (R, G, B, A) = (255, 105, 180, 255).

Declaration
public static Color4 HotPink { get; }
Property Value
Type Description
Color4

IndianRed

Gets the system color with (R, G, B, A) = (205, 92, 92, 255).

Declaration
public static Color4 IndianRed { get; }
Property Value
Type Description
Color4

Indigo

Gets the system color with (R, G, B, A) = (75, 0, 130, 255).

Declaration
public static Color4 Indigo { get; }
Property Value
Type Description
Color4

Ivory

Gets the system color with (R, G, B, A) = (255, 255, 240, 255).

Declaration
public static Color4 Ivory { get; }
Property Value
Type Description
Color4

Khaki

Gets the system color with (R, G, B, A) = (240, 230, 140, 255).

Declaration
public static Color4 Khaki { get; }
Property Value
Type Description
Color4

Lavender

Gets the system color with (R, G, B, A) = (230, 230, 250, 255).

Declaration
public static Color4 Lavender { get; }
Property Value
Type Description
Color4

LavenderBlush

Gets the system color with (R, G, B, A) = (255, 240, 245, 255).

Declaration
public static Color4 LavenderBlush { get; }
Property Value
Type Description
Color4

LawnGreen

Gets the system color with (R, G, B, A) = (124, 252, 0, 255).

Declaration
public static Color4 LawnGreen { get; }
Property Value
Type Description
Color4

LemonChiffon

Gets the system color with (R, G, B, A) = (255, 250, 205, 255).

Declaration
public static Color4 LemonChiffon { get; }
Property Value
Type Description
Color4

LightBlue

Gets the system color with (R, G, B, A) = (173, 216, 230, 255).

Declaration
public static Color4 LightBlue { get; }
Property Value
Type Description
Color4

LightCoral

Gets the system color with (R, G, B, A) = (240, 128, 128, 255).

Declaration
public static Color4 LightCoral { get; }
Property Value
Type Description
Color4

LightCyan

Gets the system color with (R, G, B, A) = (224, 255, 255, 255).

Declaration
public static Color4 LightCyan { get; }
Property Value
Type Description
Color4

LightGoldenrodYellow

Gets the system color with (R, G, B, A) = (250, 250, 210, 255).

Declaration
public static Color4 LightGoldenrodYellow { get; }
Property Value
Type Description
Color4

LightGray

Gets the system color with (R, G, B, A) = (211, 211, 211, 255).

Declaration
public static Color4 LightGray { get; }
Property Value
Type Description
Color4

LightGreen

Gets the system color with (R, G, B, A) = (144, 238, 144, 255).

Declaration
public static Color4 LightGreen { get; }
Property Value
Type Description
Color4

LightPink

Gets the system color with (R, G, B, A) = (255, 182, 193, 255).

Declaration
public static Color4 LightPink { get; }
Property Value
Type Description
Color4

LightSalmon

Gets the system color with (R, G, B, A) = (255, 160, 122, 255).

Declaration
public static Color4 LightSalmon { get; }
Property Value
Type Description
Color4

LightSeaGreen

Gets the system color with (R, G, B, A) = (32, 178, 170, 255).

Declaration
public static Color4 LightSeaGreen { get; }
Property Value
Type Description
Color4

LightSkyBlue

Gets the system color with (R, G, B, A) = (135, 206, 250, 255).

Declaration
public static Color4 LightSkyBlue { get; }
Property Value
Type Description
Color4

LightSlateGray

Gets the system color with (R, G, B, A) = (119, 136, 153, 255).

Declaration
public static Color4 LightSlateGray { get; }
Property Value
Type Description
Color4

LightSteelBlue

Gets the system color with (R, G, B, A) = (176, 196, 222, 255).

Declaration
public static Color4 LightSteelBlue { get; }
Property Value
Type Description
Color4

LightYellow

Gets the system color with (R, G, B, A) = (255, 255, 224, 255).

Declaration
public static Color4 LightYellow { get; }
Property Value
Type Description
Color4

Lime

Gets the system color with (R, G, B, A) = (0, 255, 0, 255).

Declaration
public static Color4 Lime { get; }
Property Value
Type Description
Color4

LimeGreen

Gets the system color with (R, G, B, A) = (50, 205, 50, 255).

Declaration
public static Color4 LimeGreen { get; }
Property Value
Type Description
Color4

Linen

Gets the system color with (R, G, B, A) = (250, 240, 230, 255).

Declaration
public static Color4 Linen { get; }
Property Value
Type Description
Color4

Magenta

Gets the system color with (R, G, B, A) = (255, 0, 255, 255).

Declaration
public static Color4 Magenta { get; }
Property Value
Type Description
Color4

Maroon

Gets the system color with (R, G, B, A) = (128, 0, 0, 255).

Declaration
public static Color4 Maroon { get; }
Property Value
Type Description
Color4

MediumAquamarine

Gets the system color with (R, G, B, A) = (102, 205, 170, 255).

Declaration
public static Color4 MediumAquamarine { get; }
Property Value
Type Description
Color4

MediumBlue

Gets the system color with (R, G, B, A) = (0, 0, 205, 255).

Declaration
public static Color4 MediumBlue { get; }
Property Value
Type Description
Color4

MediumOrchid

Gets the system color with (R, G, B, A) = (186, 85, 211, 255).

Declaration
public static Color4 MediumOrchid { get; }
Property Value
Type Description
Color4

MediumPurple

Gets the system color with (R, G, B, A) = (147, 112, 219, 255).

Declaration
public static Color4 MediumPurple { get; }
Property Value
Type Description
Color4

MediumSeaGreen

Gets the system color with (R, G, B, A) = (60, 179, 113, 255).

Declaration
public static Color4 MediumSeaGreen { get; }
Property Value
Type Description
Color4

MediumSlateBlue

Gets the system color with (R, G, B, A) = (123, 104, 238, 255).

Declaration
public static Color4 MediumSlateBlue { get; }
Property Value
Type Description
Color4

MediumSpringGreen

Gets the system color with (R, G, B, A) = (0, 250, 154, 255).

Declaration
public static Color4 MediumSpringGreen { get; }
Property Value
Type Description
Color4

MediumTurquoise

Gets the system color with (R, G, B, A) = (72, 209, 204, 255).

Declaration
public static Color4 MediumTurquoise { get; }
Property Value
Type Description
Color4

MediumVioletRed

Gets the system color with (R, G, B, A) = (199, 21, 133, 255).

Declaration
public static Color4 MediumVioletRed { get; }
Property Value
Type Description
Color4

MidnightBlue

Gets the system color with (R, G, B, A) = (25, 25, 112, 255).

Declaration
public static Color4 MidnightBlue { get; }
Property Value
Type Description
Color4

MintCream

Gets the system color with (R, G, B, A) = (245, 255, 250, 255).

Declaration
public static Color4 MintCream { get; }
Property Value
Type Description
Color4

MistyRose

Gets the system color with (R, G, B, A) = (255, 228, 225, 255).

Declaration
public static Color4 MistyRose { get; }
Property Value
Type Description
Color4

Moccasin

Gets the system color with (R, G, B, A) = (255, 228, 181, 255).

Declaration
public static Color4 Moccasin { get; }
Property Value
Type Description
Color4

NavajoWhite

Gets the system color with (R, G, B, A) = (255, 222, 173, 255).

Declaration
public static Color4 NavajoWhite { get; }
Property Value
Type Description
Color4

Navy

Gets the system color with (R, G, B, A) = (0, 0, 128, 255).

Declaration
public static Color4 Navy { get; }
Property Value
Type Description
Color4

OldLace

Gets the system color with (R, G, B, A) = (253, 245, 230, 255).

Declaration
public static Color4 OldLace { get; }
Property Value
Type Description
Color4

Olive

Gets the system color with (R, G, B, A) = (128, 128, 0, 255).

Declaration
public static Color4 Olive { get; }
Property Value
Type Description
Color4

OliveDrab

Gets the system color with (R, G, B, A) = (107, 142, 35, 255).

Declaration
public static Color4 OliveDrab { get; }
Property Value
Type Description
Color4

Orange

Gets the system color with (R, G, B, A) = (255, 165, 0, 255).

Declaration
public static Color4 Orange { get; }
Property Value
Type Description
Color4

OrangeRed

Gets the system color with (R, G, B, A) = (255, 69, 0, 255).

Declaration
public static Color4 OrangeRed { get; }
Property Value
Type Description
Color4

Orchid

Gets the system color with (R, G, B, A) = (218, 112, 214, 255).

Declaration
public static Color4 Orchid { get; }
Property Value
Type Description
Color4

PaleGoldenrod

Gets the system color with (R, G, B, A) = (238, 232, 170, 255).

Declaration
public static Color4 PaleGoldenrod { get; }
Property Value
Type Description
Color4

PaleGreen

Gets the system color with (R, G, B, A) = (152, 251, 152, 255).

Declaration
public static Color4 PaleGreen { get; }
Property Value
Type Description
Color4

PaleTurquoise

Gets the system color with (R, G, B, A) = (175, 238, 238, 255).

Declaration
public static Color4 PaleTurquoise { get; }
Property Value
Type Description
Color4

PaleVioletRed

Gets the system color with (R, G, B, A) = (219, 112, 147, 255).

Declaration
public static Color4 PaleVioletRed { get; }
Property Value
Type Description
Color4

PapayaWhip

Gets the system color with (R, G, B, A) = (255, 239, 213, 255).

Declaration
public static Color4 PapayaWhip { get; }
Property Value
Type Description
Color4

PeachPuff

Gets the system color with (R, G, B, A) = (255, 218, 185, 255).

Declaration
public static Color4 PeachPuff { get; }
Property Value
Type Description
Color4

Peru

Gets the system color with (R, G, B, A) = (205, 133, 63, 255).

Declaration
public static Color4 Peru { get; }
Property Value
Type Description
Color4

Pink

Gets the system color with (R, G, B, A) = (255, 192, 203, 255).

Declaration
public static Color4 Pink { get; }
Property Value
Type Description
Color4

Plum

Gets the system color with (R, G, B, A) = (221, 160, 221, 255).

Declaration
public static Color4 Plum { get; }
Property Value
Type Description
Color4

PowderBlue

Gets the system color with (R, G, B, A) = (176, 224, 230, 255).

Declaration
public static Color4 PowderBlue { get; }
Property Value
Type Description
Color4

Purple

Gets the system color with (R, G, B, A) = (128, 0, 128, 255).

Declaration
public static Color4 Purple { get; }
Property Value
Type Description
Color4

Red

Gets the system color with (R, G, B, A) = (255, 0, 0, 255).

Declaration
public static Color4 Red { get; }
Property Value
Type Description
Color4

RosyBrown

Gets the system color with (R, G, B, A) = (188, 143, 143, 255).

Declaration
public static Color4 RosyBrown { get; }
Property Value
Type Description
Color4

RoyalBlue

Gets the system color with (R, G, B, A) = (65, 105, 225, 255).

Declaration
public static Color4 RoyalBlue { get; }
Property Value
Type Description
Color4

SaddleBrown

Gets the system color with (R, G, B, A) = (139, 69, 19, 255).

Declaration
public static Color4 SaddleBrown { get; }
Property Value
Type Description
Color4

Salmon

Gets the system color with (R, G, B, A) = (250, 128, 114, 255).

Declaration
public static Color4 Salmon { get; }
Property Value
Type Description
Color4

SandyBrown

Gets the system color with (R, G, B, A) = (244, 164, 96, 255).

Declaration
public static Color4 SandyBrown { get; }
Property Value
Type Description
Color4

SeaGreen

Gets the system color with (R, G, B, A) = (46, 139, 87, 255).

Declaration
public static Color4 SeaGreen { get; }
Property Value
Type Description
Color4

SeaShell

Gets the system color with (R, G, B, A) = (255, 245, 238, 255).

Declaration
public static Color4 SeaShell { get; }
Property Value
Type Description
Color4

Sienna

Gets the system color with (R, G, B, A) = (160, 82, 45, 255).

Declaration
public static Color4 Sienna { get; }
Property Value
Type Description
Color4

Silver

Gets the system color with (R, G, B, A) = (192, 192, 192, 255).

Declaration
public static Color4 Silver { get; }
Property Value
Type Description
Color4

SkyBlue

Gets the system color with (R, G, B, A) = (135, 206, 235, 255).

Declaration
public static Color4 SkyBlue { get; }
Property Value
Type Description
Color4

SlateBlue

Gets the system color with (R, G, B, A) = (106, 90, 205, 255).

Declaration
public static Color4 SlateBlue { get; }
Property Value
Type Description
Color4

SlateGray

Gets the system color with (R, G, B, A) = (112, 128, 144, 255).

Declaration
public static Color4 SlateGray { get; }
Property Value
Type Description
Color4

Snow

Gets the system color with (R, G, B, A) = (255, 250, 250, 255).

Declaration
public static Color4 Snow { get; }
Property Value
Type Description
Color4

SpringGreen

Gets the system color with (R, G, B, A) = (0, 255, 127, 255).

Declaration
public static Color4 SpringGreen { get; }
Property Value
Type Description
Color4

SteelBlue

Gets the system color with (R, G, B, A) = (70, 130, 180, 255).

Declaration
public static Color4 SteelBlue { get; }
Property Value
Type Description
Color4

Tan

Gets the system color with (R, G, B, A) = (210, 180, 140, 255).

Declaration
public static Color4 Tan { get; }
Property Value
Type Description
Color4

Teal

Gets the system color with (R, G, B, A) = (0, 128, 128, 255).

Declaration
public static Color4 Teal { get; }
Property Value
Type Description
Color4

Thistle

Gets the system color with (R, G, B, A) = (216, 191, 216, 255).

Declaration
public static Color4 Thistle { get; }
Property Value
Type Description
Color4

Tomato

Gets the system color with (R, G, B, A) = (255, 99, 71, 255).

Declaration
public static Color4 Tomato { get; }
Property Value
Type Description
Color4

Transparent

Gets the system color with (R, G, B, A) = (255, 255, 255, 0).

Declaration
public static Color4 Transparent { get; }
Property Value
Type Description
Color4

Turquoise

Gets the system color with (R, G, B, A) = (64, 224, 208, 255).

Declaration
public static Color4 Turquoise { get; }
Property Value
Type Description
Color4

Violet

Gets the system color with (R, G, B, A) = (238, 130, 238, 255).

Declaration
public static Color4 Violet { get; }
Property Value
Type Description
Color4

Wheat

Gets the system color with (R, G, B, A) = (245, 222, 179, 255).

Declaration
public static Color4 Wheat { get; }
Property Value
Type Description
Color4

White

Gets the system color with (R, G, B, A) = (255, 255, 255, 255).

Declaration
public static Color4 White { get; }
Property Value
Type Description
Color4

WhiteSmoke

Gets the system color with (R, G, B, A) = (245, 245, 245, 255).

Declaration
public static Color4 WhiteSmoke { get; }
Property Value
Type Description
Color4

Yellow

Gets the system color with (R, G, B, A) = (255, 255, 0, 255).

Declaration
public static Color4 Yellow { get; }
Property Value
Type Description
Color4

YellowGreen

Gets the system color with (R, G, B, A) = (154, 205, 50, 255).

Declaration
public static Color4 YellowGreen { get; }
Property Value
Type Description
Color4

Methods

Equals(Color4)

Compares whether this Color4 structure is equal to the specified Color4.

Declaration
[Pure]
public readonly bool Equals(Color4 other)
Parameters
Type Name Description
Color4 other

The Color4 structure to compare to.

Returns
Type Description
bool

True if both Color4 structures contain the same components; false otherwise.

Equals(object)

Compares whether this Color4 structure is equal to the specified object.

Declaration
[Pure]
public override bool Equals(object obj)
Parameters
Type Name Description
object obj

An object to compare to.

Returns
Type Description
bool

True obj is a Color4 structure with the same components as this Color4; false otherwise.

Overrides
ValueType.Equals(object)

FromHcy(Vector4)

Converts HCY color values to RGB color values.

Declaration
[Pure]
public static Color4 FromHcy(Vector4 hcy)
Parameters
Type Name Description
Vector4 hcy

Color value to convert in hue, chroma, luminance (HCY). The X element is Hue (H), the Y element is Chroma (C), the Z element is luminance (Y), and the W element is Alpha (which is copied to the output's Alpha value). Each has a range of 0.0 to 1.0.

Returns
Type Description
Color4

Returns the converted color value.

FromHsl(Vector4)

Converts HSL color values to RGB color values.

Declaration
[Pure]
public static Color4 FromHsl(Vector4 hsl)
Parameters
Type Name Description
Vector4 hsl

Color value to convert in hue, saturation, lightness (HSL). The X element is Hue (H), the Y element is Saturation (S), the Z element is Lightness (L), and the W element is Alpha (which is copied to the output's Alpha value). Each has a range of 0.0 to 1.0.

Returns
Type Description
Color4

Returns the converted color value.

FromHsv(Vector4)

Converts HSV color values to RGB color values.

Declaration
[Pure]
public static Color4 FromHsv(Vector4 hsv)
Parameters
Type Name Description
Vector4 hsv

Color value to convert in hue, saturation, value (HSV). The X element is Hue (H), the Y element is Saturation (S), the Z element is Value (V), and the W element is Alpha (which is copied to the output's Alpha value). Each has a range of 0.0 to 1.0.

Returns
Type Description
Color4

Returns the converted color value.

FromSrgb(Color4)

Converts sRGB color values to RGB color values.

Declaration
[Pure]
public static Color4 FromSrgb(Color4 srgb)
Parameters
Type Name Description
Color4 srgb

Color value to convert in sRGB.

Returns
Type Description
Color4

Returns the converted color value.

FromXyz(Vector4)

Converts XYZ color values to RGB color values.

Declaration
[Pure]
public static Color4 FromXyz(Vector4 xyz)
Parameters
Type Name Description
Vector4 xyz

Color value to convert with the trisimulus values of X, Y, and Z in the corresponding element, and the W element with Alpha (which is copied to the output's Alpha value). Each has a range of 0.0 to 1.0.

Returns
Type Description
Color4

Returns the converted color value.

Remarks

Uses the CIE XYZ colorspace.

FromYcbcr(Vector4)

Converts YCbCr color values to RGB color values.

Declaration
[Pure]
public static Color4 FromYcbcr(Vector4 ycbcr)
Parameters
Type Name Description
Vector4 ycbcr

Color value to convert in Luma-Chrominance (YCbCr) aka YUV. The X element contains Luma (Y, 0.0 to 1.0), the Y element contains Blue-difference chroma (U, -0.5 to 0.5), the Z element contains the Red-difference chroma (V, -0.5 to 0.5), and the W element contains the Alpha (which is copied to the output's Alpha value).

Returns
Type Description
Color4

Returns the converted color value.

Remarks

Converts using ITU-R BT.601/CCIR 601 W(r) = 0.299 W(b) = 0.114 U(max) = 0.436 V(max) = 0.615.

GetHashCode()

Calculates the hash code for this Color4 structure.

Declaration
public override readonly int GetHashCode()
Returns
Type Description
int

A System.Int32 containing the hashcode of this Color4 structure.

Overrides
ValueType.GetHashCode()

ToArgb()

Converts this color to an integer representation with 8 bits per channel.

Declaration
public readonly int ToArgb()
Returns
Type Description
int

A int that represents this instance.

Remarks

This method is intended only for compatibility with System.Drawing. It compresses the color into 8 bits per channel, which means color information is lost.

ToHcy(Color4)

Converts RGB color values to HCY color values.

Declaration
[Pure]
public static Vector4 ToHcy(Color4 rgb)
Parameters
Type Name Description
Color4 rgb

Color value to convert.

Returns
Type Description
Vector4

Returns the converted color value. The X element is Hue (H), the Y element is Chroma (C), the Z element is luminance (Y), and the W element is Alpha (a copy of the input's Alpha value). Each has a range of 0.0 to 1.0.

ToHsl(Color4)

Converts RGB color values to HSL color values.

Declaration
[Pure]
public static Vector4 ToHsl(Color4 rgb)
Parameters
Type Name Description
Color4 rgb

Color value to convert.

Returns
Type Description
Vector4

Returns the converted color value. The X element is Hue (H), the Y element is Saturation (S), the Z element is Lightness (L), and the W element is Alpha (a copy of the input's Alpha value). Each has a range of 0.0 to 1.0.

ToHsv(Color4)

Converts RGB color values to HSV color values.

Declaration
[Pure]
public static Vector4 ToHsv(Color4 rgb)
Parameters
Type Name Description
Color4 rgb

Color value to convert.

Returns
Type Description
Vector4

Returns the converted color value. The X element is Hue (H), the Y element is Saturation (S), the Z element is Value (V), and the W element is Alpha (a copy of the input's Alpha value). Each has a range of 0.0 to 1.0.

ToSrgb(Color4)

Converts RGB color values to sRGB color values.

Declaration
[Pure]
public static Color4 ToSrgb(Color4 rgb)
Parameters
Type Name Description
Color4 rgb

Color value to convert.

Returns
Type Description
Color4

Returns the converted color value.

ToString()

Creates a System.String that describes this Color4 structure.

Declaration
public override string ToString()
Returns
Type Description
string

A System.String that describes this Color4 structure.

Overrides
ValueType.ToString()

ToString(IFormatProvider)

Declaration
public string ToString(IFormatProvider formatProvider)
Parameters
Type Name Description
IFormatProvider formatProvider
Returns
Type Description
string

ToString(string, IFormatProvider)

Declaration
public readonly string ToString(string format, IFormatProvider formatProvider)
Parameters
Type Name Description
string format
IFormatProvider formatProvider
Returns
Type Description
string

ToString(string)

Declaration
public string ToString(string format)
Parameters
Type Name Description
string format
Returns
Type Description
string

ToXyz(Color4)

Converts RGB color values to XYZ color values.

Declaration
[Pure]
public static Vector4 ToXyz(Color4 rgb)
Parameters
Type Name Description
Color4 rgb

Color value to convert.

Returns
Type Description
Vector4

Returns the converted color value with the trisimulus values of X, Y, and Z in the corresponding element, and the W element with Alpha (a copy of the input's Alpha value). Each has a range of 0.0 to 1.0.

Remarks

Uses the CIE XYZ colorspace.

ToYcbcr(Color4)

Converts RGB color values to YUV color values.

Declaration
[Pure]
public static Vector4 ToYcbcr(Color4 rgb)
Parameters
Type Name Description
Color4 rgb

Color value to convert.

Returns
Type Description
Vector4

Returns the converted color value in Luma-Chrominance (YCbCr) aka YUV. The X element contains Luma (Y, 0.0 to 1.0), the Y element contains Blue-difference chroma (U, -0.5 to 0.5), the Z element contains the Red-difference chroma (V, -0.5 to 0.5), and the W element contains the Alpha (a copy of the input's Alpha value). Each has a range of 0.0 to 1.0.

Remarks

Converts using ITU-R BT.601/CCIR 601 W(r) = 0.299 W(b) = 0.114 U(max) = 0.436 V(max) = 0.615.

Operators

operator ==(Color4, Color4)

Compares the specified Color4 structures for equality.

Declaration
[Pure]
public static bool operator ==(Color4 left, Color4 right)
Parameters
Type Name Description
Color4 left

The left-hand side of the comparison.

Color4 right

The right-hand side of the comparison.

Returns
Type Description
bool

True if left is equal to right; false otherwise.

explicit operator Vector4(Color4)

Returns this Color4 as a Vector4. The resulting struct will have XYZW mapped to RGBA, in that order.

Declaration
[Pure]
public static explicit operator Vector4(Color4 c)
Parameters
Type Name Description
Color4 c

The Color4 to convert.

Returns
Type Description
Vector4

The Color4, converted into a Vector4.

explicit operator Color(Color4)

Converts the specified Color4 to a System.Drawing.Color structure.

Declaration
[Pure]
public static explicit operator Color(Color4 color)
Parameters
Type Name Description
Color4 color

The Color4 to convert.

Returns
Type Description
Color

A new System.Drawing.Color structure containing the converted components.

implicit operator Color4(Color)

Converts the specified System.Drawing.Color to a Color4 structure.

Declaration
[Pure]
public static implicit operator Color4(Color color)
Parameters
Type Name Description
Color color

The System.Drawing.Color to convert.

Returns
Type Description
Color4

A new Color4 structure containing the converted components.

operator !=(Color4, Color4)

Compares the specified Color4 structures for inequality.

Declaration
[Pure]
public static bool operator !=(Color4 left, Color4 right)
Parameters
Type Name Description
Color4 left

The left-hand side of the comparison.

Color4 right

The right-hand side of the comparison.

Returns
Type Description
bool

True if left is not equal to right; false otherwise.

Implements

IEquatable<T>
IFormattable
In This Article
Back to top Generated by DocFX