Table of Contents

Struct ColorF

Namespace
SimulationFramework
Assembly
SimulationFramework.dll

A RGBA floating point color.

public readonly struct ColorF : IEquatable<ColorF>
Implements
Inherited Members

Constructors

ColorF()

Creates a new ColorF with default values.

public ColorF()

ColorF(Color)

Creates a new ColorF.

public ColorF(Color color)

Parameters

color Color

The values of the color.

ColorF(Vector3)

Creates a new ColorF.

public ColorF(Vector3 rgb)

Parameters

rgb Vector3

The RGB values of the color.

ColorF(Vector4)

Creates a new ColorF.

public ColorF(Vector4 rgba)

Parameters

rgba Vector4

The RGBA values of the color.

ColorF(float, float, float)

Creates a new ColorF.

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

Parameters

r float

The R component of the color.

g float

The G component of the color.

b float

The B component of the color.

ColorF(float, float, float, float)

Creates a new ColorF.

public ColorF(float r, float g, float b, float a)

Parameters

r float

The R component of the color.

g float

The G component of the color.

b float

The B component of the color.

a float

The A component of the color.

Fields

AliceBlue

An RGBA ColorF with the value #F0F8FFFF.

public static readonly ColorF AliceBlue

Field Value

ColorF

AntiqueWhite

An RGBA ColorF with the value #FAEBD7FF.

public static readonly ColorF AntiqueWhite

Field Value

ColorF

Aqua

An RGBA ColorF with the value #00FFFFFF.

public static readonly ColorF Aqua

Field Value

ColorF

Aquamarine

An RGBA ColorF with the value #7FFFD4FF.

public static readonly ColorF Aquamarine

Field Value

ColorF

Azure

An RGBA ColorF with the value #F0FFFFFF.

public static readonly ColorF Azure

Field Value

ColorF

Beige

An RGBA ColorF with the value #F5F5DCFF.

public static readonly ColorF Beige

Field Value

ColorF

Bisque

An RGBA ColorF with the value #FFE4C4FF.

public static readonly ColorF Bisque

Field Value

ColorF

Black

An RGBA ColorF with the value #000000FF.

public static readonly ColorF Black

Field Value

ColorF

BlanchedAlmond

An RGBA ColorF with the value #FFEBCDFF.

public static readonly ColorF BlanchedAlmond

Field Value

ColorF

Blue

An RGBA ColorF with the value #0000FFFF.

public static readonly ColorF Blue

Field Value

ColorF

BlueViolet

An RGBA ColorF with the value #8A2BE2FF.

public static readonly ColorF BlueViolet

Field Value

ColorF

Brown

An RGBA ColorF with the value #A52A2AFF.

public static readonly ColorF Brown

Field Value

ColorF

BurlyWood

An RGBA ColorF with the value #DEB887FF.

public static readonly ColorF BurlyWood

Field Value

ColorF

CadetBlue

An RGBA ColorF with the value #5F9EA0FF.

public static readonly ColorF CadetBlue

Field Value

ColorF

Chartreuse

An RGBA ColorF with the value #7FFF00FF.

public static readonly ColorF Chartreuse

Field Value

ColorF

Chocolate

An RGBA ColorF with the value #D2691EFF.

public static readonly ColorF Chocolate

Field Value

ColorF

Coral

An RGBA ColorF with the value #FF7F50FF.

public static readonly ColorF Coral

Field Value

ColorF

CornflowerBlue

An RGBA ColorF with the value #6495EDFF.

public static readonly ColorF CornflowerBlue

Field Value

ColorF

Cornsilk

An RGBA ColorF with the value #FFF8DCFF.

public static readonly ColorF Cornsilk

Field Value

ColorF

Crimson

An RGBA ColorF with the value #DC143CFF.

public static readonly ColorF Crimson

Field Value

ColorF

Cyan

An RGBA ColorF with the value #00FFFFFF.

public static readonly ColorF Cyan

Field Value

ColorF

DarkBlue

An RGBA ColorF with the value #00008BFF.

public static readonly ColorF DarkBlue

Field Value

ColorF

DarkCyan

An RGBA ColorF with the value #008B8BFF.

public static readonly ColorF DarkCyan

Field Value

ColorF

DarkGoldenrod

An RGBA ColorF with the value #B8860BFF.

public static readonly ColorF DarkGoldenrod

Field Value

ColorF

DarkGray

An RGBA ColorF with the value #A9A9A9FF.

public static readonly ColorF DarkGray

Field Value

ColorF

DarkGreen

An RGBA ColorF with the value #006400FF.

public static readonly ColorF DarkGreen

Field Value

ColorF

DarkKhaki

An RGBA ColorF with the value #BDB76BFF.

public static readonly ColorF DarkKhaki

Field Value

ColorF

DarkMagenta

An RGBA ColorF with the value #8B008BFF.

public static readonly ColorF DarkMagenta

Field Value

ColorF

DarkOliveGreen

An RGBA ColorF with the value #556B2FFF.

public static readonly ColorF DarkOliveGreen

Field Value

ColorF

DarkOrange

An RGBA ColorF with the value #FF8C00FF.

public static readonly ColorF DarkOrange

Field Value

ColorF

DarkOrchid

An RGBA ColorF with the value #9932CCFF.

public static readonly ColorF DarkOrchid

Field Value

ColorF

DarkRed

An RGBA ColorF with the value #8B0000FF.

public static readonly ColorF DarkRed

Field Value

ColorF

DarkSalmon

An RGBA ColorF with the value #E9967AFF.

public static readonly ColorF DarkSalmon

Field Value

ColorF

DarkSeaGreen

An RGBA ColorF with the value #8FBC8BFF.

public static readonly ColorF DarkSeaGreen

Field Value

ColorF

DarkSlateBlue

An RGBA ColorF with the value #483D8BFF.

public static readonly ColorF DarkSlateBlue

Field Value

ColorF

DarkSlateGray

An RGBA ColorF with the value #2F4F4FFF.

public static readonly ColorF DarkSlateGray

Field Value

ColorF

DarkTurquoise

An RGBA ColorF with the value #00CED1FF.

public static readonly ColorF DarkTurquoise

Field Value

ColorF

DarkViolet

An RGBA ColorF with the value #9400D3FF.

public static readonly ColorF DarkViolet

Field Value

ColorF

DeepPink

An RGBA ColorF with the value #FF1493FF.

public static readonly ColorF DeepPink

Field Value

ColorF

DeepSkyBlue

An RGBA ColorF with the value #00BFFFFF.

public static readonly ColorF DeepSkyBlue

Field Value

ColorF

DimGray

An RGBA ColorF with the value #696969FF.

public static readonly ColorF DimGray

Field Value

ColorF

DodgerBlue

An RGBA ColorF with the value #1E90FFFF.

public static readonly ColorF DodgerBlue

Field Value

ColorF

Firebrick

An RGBA ColorF with the value #B22222FF.

public static readonly ColorF Firebrick

Field Value

ColorF

FloralWhite

An RGBA ColorF with the value #FFFAF0FF.

public static readonly ColorF FloralWhite

Field Value

ColorF

ForestGreen

An RGBA ColorF with the value #228B22FF.

public static readonly ColorF ForestGreen

Field Value

ColorF

Fuchsia

An RGBA ColorF with the value #FF00FFFF.

public static readonly ColorF Fuchsia

Field Value

ColorF

Gainsboro

An RGBA ColorF with the value #DCDCDCFF.

public static readonly ColorF Gainsboro

Field Value

ColorF

GhostWhite

An RGBA ColorF with the value #F8F8FFFF.

public static readonly ColorF GhostWhite

Field Value

ColorF

Gold

An RGBA ColorF with the value #FFD700FF.

public static readonly ColorF Gold

Field Value

ColorF

Goldenrod

An RGBA ColorF with the value #DAA520FF.

public static readonly ColorF Goldenrod

Field Value

ColorF

Gray

An RGBA ColorF with the value #808080FF.

public static readonly ColorF Gray

Field Value

ColorF

Green

An RGBA ColorF with the value #008000FF.

public static readonly ColorF Green

Field Value

ColorF

GreenYellow

An RGBA ColorF with the value #ADFF2FFF.

public static readonly ColorF GreenYellow

Field Value

ColorF

Honeydew

An RGBA ColorF with the value #F0FFF0FF.

public static readonly ColorF Honeydew

Field Value

ColorF

HotPink

An RGBA ColorF with the value #FF69B4FF.

public static readonly ColorF HotPink

Field Value

ColorF

IndianRed

An RGBA ColorF with the value #CD5C5CFF.

public static readonly ColorF IndianRed

Field Value

ColorF

Indigo

An RGBA ColorF with the value #4B0082FF.

public static readonly ColorF Indigo

Field Value

ColorF

Ivory

An RGBA ColorF with the value #FFFFF0FF.

public static readonly ColorF Ivory

Field Value

ColorF

Khaki

An RGBA ColorF with the value #F0E68CFF.

public static readonly ColorF Khaki

Field Value

ColorF

Lavender

An RGBA ColorF with the value #E6E6FAFF.

public static readonly ColorF Lavender

Field Value

ColorF

LavenderBlush

An RGBA ColorF with the value #FFF0F5FF.

public static readonly ColorF LavenderBlush

Field Value

ColorF

LawnGreen

An RGBA ColorF with the value #7CFC00FF.

public static readonly ColorF LawnGreen

Field Value

ColorF

LemonChiffon

An RGBA ColorF with the value #FFFACDFF.

public static readonly ColorF LemonChiffon

Field Value

ColorF

LightBlue

An RGBA ColorF with the value #ADD8E6FF.

public static readonly ColorF LightBlue

Field Value

ColorF

LightCoral

An RGBA ColorF with the value #F08080FF.

public static readonly ColorF LightCoral

Field Value

ColorF

LightCyan

An RGBA ColorF with the value #E0FFFFFF.

public static readonly ColorF LightCyan

Field Value

ColorF

LightGoldenrodYellow

An RGBA ColorF with the value #FAFAD2FF.

public static readonly ColorF LightGoldenrodYellow

Field Value

ColorF

LightGray

An RGBA ColorF with the value #D3D3D3FF.

public static readonly ColorF LightGray

Field Value

ColorF

LightGreen

An RGBA ColorF with the value #90EE90FF.

public static readonly ColorF LightGreen

Field Value

ColorF

LightPink

An RGBA ColorF with the value #FFB6C1FF.

public static readonly ColorF LightPink

Field Value

ColorF

LightSalmon

An RGBA ColorF with the value #FFA07AFF.

public static readonly ColorF LightSalmon

Field Value

ColorF

LightSeaGreen

An RGBA ColorF with the value #20B2AAFF.

public static readonly ColorF LightSeaGreen

Field Value

ColorF

LightSkyBlue

An RGBA ColorF with the value #87CEFAFF.

public static readonly ColorF LightSkyBlue

Field Value

ColorF

LightSlateGray

An RGBA ColorF with the value #778899FF.

public static readonly ColorF LightSlateGray

Field Value

ColorF

LightSteelBlue

An RGBA ColorF with the value #B0C4DEFF.

public static readonly ColorF LightSteelBlue

Field Value

ColorF

LightYellow

An RGBA ColorF with the value #FFFFE0FF.

public static readonly ColorF LightYellow

Field Value

ColorF

Lime

An RGBA ColorF with the value #00FF00FF.

public static readonly ColorF Lime

Field Value

ColorF

LimeGreen

An RGBA ColorF with the value #32CD32FF.

public static readonly ColorF LimeGreen

Field Value

ColorF

Linen

An RGBA ColorF with the value #FAF0E6FF.

public static readonly ColorF Linen

Field Value

ColorF

Magenta

An RGBA ColorF with the value #FF00FFFF.

public static readonly ColorF Magenta

Field Value

ColorF

Maroon

An RGBA ColorF with the value #800000FF.

public static readonly ColorF Maroon

Field Value

ColorF

MediumAquamarine

An RGBA ColorF with the value #66CDAAFF.

public static readonly ColorF MediumAquamarine

Field Value

ColorF

MediumBlue

An RGBA ColorF with the value #0000CDFF.

public static readonly ColorF MediumBlue

Field Value

ColorF

MediumOrchid

An RGBA ColorF with the value #BA55D3FF.

public static readonly ColorF MediumOrchid

Field Value

ColorF

MediumPurple

An RGBA ColorF with the value #9370DBFF.

public static readonly ColorF MediumPurple

Field Value

ColorF

MediumSeaGreen

An RGBA ColorF with the value #3CB371FF.

public static readonly ColorF MediumSeaGreen

Field Value

ColorF

MediumSlateBlue

An RGBA ColorF with the value #7B68EEFF.

public static readonly ColorF MediumSlateBlue

Field Value

ColorF

MediumSpringGreen

An RGBA ColorF with the value #00FA9AFF.

public static readonly ColorF MediumSpringGreen

Field Value

ColorF

MediumTurquoise

An RGBA ColorF with the value #48D1CCFF.

public static readonly ColorF MediumTurquoise

Field Value

ColorF

MediumVioletRed

An RGBA ColorF with the value #C71585FF.

public static readonly ColorF MediumVioletRed

Field Value

ColorF

MidnightBlue

An RGBA ColorF with the value #191970FF.

public static readonly ColorF MidnightBlue

Field Value

ColorF

MintCream

An RGBA ColorF with the value #F5FFFAFF.

public static readonly ColorF MintCream

Field Value

ColorF

MistyRose

An RGBA ColorF with the value #FFE4E1FF.

public static readonly ColorF MistyRose

Field Value

ColorF

Moccasin

An RGBA ColorF with the value #FFE4B5FF.

public static readonly ColorF Moccasin

Field Value

ColorF

NavajoWhite

An RGBA ColorF with the value #FFDEADFF.

public static readonly ColorF NavajoWhite

Field Value

ColorF

Navy

An RGBA ColorF with the value #000080FF.

public static readonly ColorF Navy

Field Value

ColorF

OldLace

An RGBA ColorF with the value #FDF5E6FF.

public static readonly ColorF OldLace

Field Value

ColorF

Olive

An RGBA ColorF with the value #808000FF.

public static readonly ColorF Olive

Field Value

ColorF

OliveDrab

An RGBA ColorF with the value #6B8E23FF.

public static readonly ColorF OliveDrab

Field Value

ColorF

Orange

An RGBA ColorF with the value #FFA500FF.

public static readonly ColorF Orange

Field Value

ColorF

OrangeRed

An RGBA ColorF with the value #FF4500FF.

public static readonly ColorF OrangeRed

Field Value

ColorF

Orchid

An RGBA ColorF with the value #DA70D6FF.

public static readonly ColorF Orchid

Field Value

ColorF

PaleGoldenrod

An RGBA ColorF with the value #EEE8AAFF.

public static readonly ColorF PaleGoldenrod

Field Value

ColorF

PaleGreen

An RGBA ColorF with the value #98FB98FF.

public static readonly ColorF PaleGreen

Field Value

ColorF

PaleTurquoise

An RGBA ColorF with the value #AFEEEEFF.

public static readonly ColorF PaleTurquoise

Field Value

ColorF

PaleVioletRed

An RGBA ColorF with the value #DB7093FF.

public static readonly ColorF PaleVioletRed

Field Value

ColorF

PapayaWhip

An RGBA ColorF with the value #FFEFD5FF.

public static readonly ColorF PapayaWhip

Field Value

ColorF

PeachPuff

An RGBA ColorF with the value #FFDAB9FF.

public static readonly ColorF PeachPuff

Field Value

ColorF

Peru

An RGBA ColorF with the value #CD853FFF.

public static readonly ColorF Peru

Field Value

ColorF

Pink

An RGBA ColorF with the value #FFC0CBFF.

public static readonly ColorF Pink

Field Value

ColorF

Plum

An RGBA ColorF with the value #DDA0DDFF.

public static readonly ColorF Plum

Field Value

ColorF

PowderBlue

An RGBA ColorF with the value #B0E0E6FF.

public static readonly ColorF PowderBlue

Field Value

ColorF

Purple

An RGBA ColorF with the value #800080FF.

public static readonly ColorF Purple

Field Value

ColorF

RebeccaPurple

An RGBA ColorF with the value #663399FF.

public static readonly ColorF RebeccaPurple

Field Value

ColorF

Red

An RGBA ColorF with the value #FF0000FF.

public static readonly ColorF Red

Field Value

ColorF

RosyBrown

An RGBA ColorF with the value #BC8F8FFF.

public static readonly ColorF RosyBrown

Field Value

ColorF

RoyalBlue

An RGBA ColorF with the value #4169E1FF.

public static readonly ColorF RoyalBlue

Field Value

ColorF

SaddleBrown

An RGBA ColorF with the value #8B4513FF.

public static readonly ColorF SaddleBrown

Field Value

ColorF

Salmon

An RGBA ColorF with the value #FA8072FF.

public static readonly ColorF Salmon

Field Value

ColorF

SandyBrown

An RGBA ColorF with the value #F4A460FF.

public static readonly ColorF SandyBrown

Field Value

ColorF

SeaGreen

An RGBA ColorF with the value #2E8B57FF.

public static readonly ColorF SeaGreen

Field Value

ColorF

SeaShell

An RGBA ColorF with the value #FFF5EEFF.

public static readonly ColorF SeaShell

Field Value

ColorF

Sienna

An RGBA ColorF with the value #A0522DFF.

public static readonly ColorF Sienna

Field Value

ColorF

Silver

An RGBA ColorF with the value #C0C0C0FF.

public static readonly ColorF Silver

Field Value

ColorF

SkyBlue

An RGBA ColorF with the value #87CEEBFF.

public static readonly ColorF SkyBlue

Field Value

ColorF

SlateBlue

An RGBA ColorF with the value #6A5ACDFF.

public static readonly ColorF SlateBlue

Field Value

ColorF

SlateGray

An RGBA ColorF with the value #708090FF.

public static readonly ColorF SlateGray

Field Value

ColorF

Snow

An RGBA ColorF with the value #FFFAFAFF.

public static readonly ColorF Snow

Field Value

ColorF

SpringGreen

An RGBA ColorF with the value #00FF7FFF.

public static readonly ColorF SpringGreen

Field Value

ColorF

SteelBlue

An RGBA ColorF with the value #4682B4FF.

public static readonly ColorF SteelBlue

Field Value

ColorF

Tan

An RGBA ColorF with the value #D2B48CFF.

public static readonly ColorF Tan

Field Value

ColorF

Teal

An RGBA ColorF with the value #008080FF.

public static readonly ColorF Teal

Field Value

ColorF

Thistle

An RGBA ColorF with the value #D8BFD8FF.

public static readonly ColorF Thistle

Field Value

ColorF

Tomato

An RGBA ColorF with the value #FF6347FF.

public static readonly ColorF Tomato

Field Value

ColorF

Transparent

An RGBA ColorF with the value #00000000.

public static readonly ColorF Transparent

Field Value

ColorF

Turquoise

An RGBA ColorF with the value #40E0D0FF.

public static readonly ColorF Turquoise

Field Value

ColorF

Violet

An RGBA ColorF with the value #EE82EEFF.

public static readonly ColorF Violet

Field Value

ColorF

Wheat

An RGBA ColorF with the value #F5DEB3FF.

public static readonly ColorF Wheat

Field Value

ColorF

White

An RGBA ColorF with the value #FFFFFFFF.

public static readonly ColorF White

Field Value

ColorF

WhiteSmoke

An RGBA ColorF with the value #F5F5F5FF.

public static readonly ColorF WhiteSmoke

Field Value

ColorF

Yellow

An RGBA ColorF with the value #FFFF00FF.

public static readonly ColorF Yellow

Field Value

ColorF

YellowGreen

An RGBA ColorF with the value #9ACD32FF.

public static readonly ColorF YellowGreen

Field Value

ColorF

Properties

A

The A component of the color.

public float A { get; init; }

Property Value

float

B

The B component of the color.

public float B { get; init; }

Property Value

float

G

The G component of the color.

public float G { get; init; }

Property Value

float

R

The R component of the color.

public float R { get; init; }

Property Value

float

Methods

AsVector3()

Returns this Color as a Vector3, with its R, G, and B values as X, Y, and Z, respectively.

public Vector3 AsVector3()

Returns

Vector3

The converted Vector3.

AsVector4()

Converts this Color to Vector4, with its R, G, B, and A values as X, Y, Z, and W, respectively.

public Vector4 AsVector4()

Returns

Vector4

The converted Vector4.

Equals(ColorF)

Indicates whether the current object is equal to another object of the same type.

public bool Equals(ColorF other)

Parameters

other ColorF

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

Equals(object?)

Indicates whether this instance and a specified object are equal.

public override bool Equals(object? obj)

Parameters

obj object

The object to compare with the current instance.

Returns

bool

true if obj and this instance are the same type and represent the same value; otherwise, false.

FromHSV(float, float, float)

Creates a color given a hue, saturation, and value.

public static ColorF FromHSV(float hue, float saturation, float value)

Parameters

hue float

The hue of the color. This must be between 0 and 1.

saturation float

The saturation of the color. This must be between 0 and 1.

value float

The value (brightness) of the color. This must be between 0 and 1.

Returns

ColorF

The created color.

FromHSV(float, float, float, float)

Creates a color given a hue, saturation, value, and alpha.

public static ColorF FromHSV(float hue, float saturation, float value, float alpha)

Parameters

hue float

The hue of the color. This must be between 0 and 1.

saturation float

The saturation of the color. This must be between 0 and 1.

value float

The value (brightness) of the color. This must be between 0 and 1.

alpha float

The alpha of the color. This must be between 0 and 1.

Returns

ColorF

The created color.

GetHashCode()

Returns the hash code for this instance.

public override int GetHashCode()

Returns

int

A 32-bit signed integer that is the hash code for this instance.

Lerp(ColorF, ColorF, float)

Linearly interpolates between two ColorF values in RGBA space.

public static ColorF Lerp(ColorF color1, ColorF color2, float t)

Parameters

color1 ColorF

The first color.

color2 ColorF

The second color.

t float

The interpolation amount, from 0.0 to 1.0.

Returns

ColorF

The interpolated color.

LerpHSV(ColorF, ColorF, float)

Linearly interpolates between two ColorF values in HSV space.

public static ColorF LerpHSV(ColorF color1, ColorF color2, float t)

Parameters

color1 ColorF

The first color.

color2 ColorF

The second color.

t float

The interpolation amount, from 0.0 to 1.0.

Returns

ColorF

The interpolated color.

ToColor()

Converts this ColorF as a Color.

public Color ToColor()

Returns

Color

The converted Color.

ToHSV()

Computes the values of this ColorF in the HSV color space.

public Vector3 ToHSV()

Returns

Vector3

The computed values, where X is hue, Y is saturation, and Z is value.

ToHSVA()

Computes the values of this ColorF in the HSV color space.

public Vector4 ToHSVA()

Returns

Vector4

The computed values, where X is hue, Y is saturation, Z is value, W is alpha.

ToString()

Returns the fully qualified type name of this instance.

public override string? ToString()

Returns

string

The fully qualified type name.

Operators

operator ==(ColorF, ColorF)

Indicates if two ColorF objects are equal.

public static bool operator ==(ColorF left, ColorF right)

Parameters

left ColorF

The first color.

right ColorF

The second color.

Returns

bool

true if the ColorF objects are equal, otherwise false.

operator !=(ColorF, ColorF)

Indicates if two ColorF objects are not equal.

public static bool operator !=(ColorF left, ColorF right)

Parameters

left ColorF

The first color.

right ColorF

The second color.

Returns

bool

true if the ColorF objects are not equal, otherwise false.