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
ColorThe values of the color.
ColorF(Vector3)
Creates a new ColorF.
public ColorF(Vector3 rgb)
Parameters
rgb
Vector3The RGB values of the color.
ColorF(Vector4)
Creates a new ColorF.
public ColorF(Vector4 rgba)
Parameters
rgba
Vector4The RGBA values of the color.
ColorF(float, float, float)
Creates a new ColorF.
public ColorF(float r, float g, float b)
Parameters
r
floatThe R component of the color.
g
floatThe G component of the color.
b
floatThe 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
floatThe R component of the color.
g
floatThe G component of the color.
b
floatThe B component of the color.
a
floatThe A component of the color.
Fields
AliceBlue
An RGBA ColorF with the value #F0F8FFFF.
public static readonly ColorF AliceBlue
Field Value
AntiqueWhite
An RGBA ColorF with the value #FAEBD7FF.
public static readonly ColorF AntiqueWhite
Field Value
Aqua
An RGBA ColorF with the value #00FFFFFF.
public static readonly ColorF Aqua
Field Value
Aquamarine
An RGBA ColorF with the value #7FFFD4FF.
public static readonly ColorF Aquamarine
Field Value
Azure
An RGBA ColorF with the value #F0FFFFFF.
public static readonly ColorF Azure
Field Value
Beige
An RGBA ColorF with the value #F5F5DCFF.
public static readonly ColorF Beige
Field Value
Bisque
An RGBA ColorF with the value #FFE4C4FF.
public static readonly ColorF Bisque
Field Value
Black
An RGBA ColorF with the value #000000FF.
public static readonly ColorF Black
Field Value
BlanchedAlmond
An RGBA ColorF with the value #FFEBCDFF.
public static readonly ColorF BlanchedAlmond
Field Value
Blue
An RGBA ColorF with the value #0000FFFF.
public static readonly ColorF Blue
Field Value
BlueViolet
An RGBA ColorF with the value #8A2BE2FF.
public static readonly ColorF BlueViolet
Field Value
Brown
An RGBA ColorF with the value #A52A2AFF.
public static readonly ColorF Brown
Field Value
BurlyWood
An RGBA ColorF with the value #DEB887FF.
public static readonly ColorF BurlyWood
Field Value
CadetBlue
An RGBA ColorF with the value #5F9EA0FF.
public static readonly ColorF CadetBlue
Field Value
Chartreuse
An RGBA ColorF with the value #7FFF00FF.
public static readonly ColorF Chartreuse
Field Value
Chocolate
An RGBA ColorF with the value #D2691EFF.
public static readonly ColorF Chocolate
Field Value
Coral
An RGBA ColorF with the value #FF7F50FF.
public static readonly ColorF Coral
Field Value
CornflowerBlue
An RGBA ColorF with the value #6495EDFF.
public static readonly ColorF CornflowerBlue
Field Value
Cornsilk
An RGBA ColorF with the value #FFF8DCFF.
public static readonly ColorF Cornsilk
Field Value
Crimson
An RGBA ColorF with the value #DC143CFF.
public static readonly ColorF Crimson
Field Value
Cyan
An RGBA ColorF with the value #00FFFFFF.
public static readonly ColorF Cyan
Field Value
DarkBlue
An RGBA ColorF with the value #00008BFF.
public static readonly ColorF DarkBlue
Field Value
DarkCyan
An RGBA ColorF with the value #008B8BFF.
public static readonly ColorF DarkCyan
Field Value
DarkGoldenrod
An RGBA ColorF with the value #B8860BFF.
public static readonly ColorF DarkGoldenrod
Field Value
DarkGray
An RGBA ColorF with the value #A9A9A9FF.
public static readonly ColorF DarkGray
Field Value
DarkGreen
An RGBA ColorF with the value #006400FF.
public static readonly ColorF DarkGreen
Field Value
DarkKhaki
An RGBA ColorF with the value #BDB76BFF.
public static readonly ColorF DarkKhaki
Field Value
DarkMagenta
An RGBA ColorF with the value #8B008BFF.
public static readonly ColorF DarkMagenta
Field Value
DarkOliveGreen
An RGBA ColorF with the value #556B2FFF.
public static readonly ColorF DarkOliveGreen
Field Value
DarkOrange
An RGBA ColorF with the value #FF8C00FF.
public static readonly ColorF DarkOrange
Field Value
DarkOrchid
An RGBA ColorF with the value #9932CCFF.
public static readonly ColorF DarkOrchid
Field Value
DarkRed
An RGBA ColorF with the value #8B0000FF.
public static readonly ColorF DarkRed
Field Value
DarkSalmon
An RGBA ColorF with the value #E9967AFF.
public static readonly ColorF DarkSalmon
Field Value
DarkSeaGreen
An RGBA ColorF with the value #8FBC8BFF.
public static readonly ColorF DarkSeaGreen
Field Value
DarkSlateBlue
An RGBA ColorF with the value #483D8BFF.
public static readonly ColorF DarkSlateBlue
Field Value
DarkSlateGray
An RGBA ColorF with the value #2F4F4FFF.
public static readonly ColorF DarkSlateGray
Field Value
DarkTurquoise
An RGBA ColorF with the value #00CED1FF.
public static readonly ColorF DarkTurquoise
Field Value
DarkViolet
An RGBA ColorF with the value #9400D3FF.
public static readonly ColorF DarkViolet
Field Value
DeepPink
An RGBA ColorF with the value #FF1493FF.
public static readonly ColorF DeepPink
Field Value
DeepSkyBlue
An RGBA ColorF with the value #00BFFFFF.
public static readonly ColorF DeepSkyBlue
Field Value
DimGray
An RGBA ColorF with the value #696969FF.
public static readonly ColorF DimGray
Field Value
DodgerBlue
An RGBA ColorF with the value #1E90FFFF.
public static readonly ColorF DodgerBlue
Field Value
Firebrick
An RGBA ColorF with the value #B22222FF.
public static readonly ColorF Firebrick
Field Value
FloralWhite
An RGBA ColorF with the value #FFFAF0FF.
public static readonly ColorF FloralWhite
Field Value
ForestGreen
An RGBA ColorF with the value #228B22FF.
public static readonly ColorF ForestGreen
Field Value
Fuchsia
An RGBA ColorF with the value #FF00FFFF.
public static readonly ColorF Fuchsia
Field Value
Gainsboro
An RGBA ColorF with the value #DCDCDCFF.
public static readonly ColorF Gainsboro
Field Value
GhostWhite
An RGBA ColorF with the value #F8F8FFFF.
public static readonly ColorF GhostWhite
Field Value
Gold
An RGBA ColorF with the value #FFD700FF.
public static readonly ColorF Gold
Field Value
Goldenrod
An RGBA ColorF with the value #DAA520FF.
public static readonly ColorF Goldenrod
Field Value
Gray
An RGBA ColorF with the value #808080FF.
public static readonly ColorF Gray
Field Value
Green
An RGBA ColorF with the value #008000FF.
public static readonly ColorF Green
Field Value
GreenYellow
An RGBA ColorF with the value #ADFF2FFF.
public static readonly ColorF GreenYellow
Field Value
Honeydew
An RGBA ColorF with the value #F0FFF0FF.
public static readonly ColorF Honeydew
Field Value
HotPink
An RGBA ColorF with the value #FF69B4FF.
public static readonly ColorF HotPink
Field Value
IndianRed
An RGBA ColorF with the value #CD5C5CFF.
public static readonly ColorF IndianRed
Field Value
Indigo
An RGBA ColorF with the value #4B0082FF.
public static readonly ColorF Indigo
Field Value
Ivory
An RGBA ColorF with the value #FFFFF0FF.
public static readonly ColorF Ivory
Field Value
Khaki
An RGBA ColorF with the value #F0E68CFF.
public static readonly ColorF Khaki
Field Value
Lavender
An RGBA ColorF with the value #E6E6FAFF.
public static readonly ColorF Lavender
Field Value
LavenderBlush
An RGBA ColorF with the value #FFF0F5FF.
public static readonly ColorF LavenderBlush
Field Value
LawnGreen
An RGBA ColorF with the value #7CFC00FF.
public static readonly ColorF LawnGreen
Field Value
LemonChiffon
An RGBA ColorF with the value #FFFACDFF.
public static readonly ColorF LemonChiffon
Field Value
LightBlue
An RGBA ColorF with the value #ADD8E6FF.
public static readonly ColorF LightBlue
Field Value
LightCoral
An RGBA ColorF with the value #F08080FF.
public static readonly ColorF LightCoral
Field Value
LightCyan
An RGBA ColorF with the value #E0FFFFFF.
public static readonly ColorF LightCyan
Field Value
LightGoldenrodYellow
An RGBA ColorF with the value #FAFAD2FF.
public static readonly ColorF LightGoldenrodYellow
Field Value
LightGray
An RGBA ColorF with the value #D3D3D3FF.
public static readonly ColorF LightGray
Field Value
LightGreen
An RGBA ColorF with the value #90EE90FF.
public static readonly ColorF LightGreen
Field Value
LightPink
An RGBA ColorF with the value #FFB6C1FF.
public static readonly ColorF LightPink
Field Value
LightSalmon
An RGBA ColorF with the value #FFA07AFF.
public static readonly ColorF LightSalmon
Field Value
LightSeaGreen
An RGBA ColorF with the value #20B2AAFF.
public static readonly ColorF LightSeaGreen
Field Value
LightSkyBlue
An RGBA ColorF with the value #87CEFAFF.
public static readonly ColorF LightSkyBlue
Field Value
LightSlateGray
An RGBA ColorF with the value #778899FF.
public static readonly ColorF LightSlateGray
Field Value
LightSteelBlue
An RGBA ColorF with the value #B0C4DEFF.
public static readonly ColorF LightSteelBlue
Field Value
LightYellow
An RGBA ColorF with the value #FFFFE0FF.
public static readonly ColorF LightYellow
Field Value
Lime
An RGBA ColorF with the value #00FF00FF.
public static readonly ColorF Lime
Field Value
LimeGreen
An RGBA ColorF with the value #32CD32FF.
public static readonly ColorF LimeGreen
Field Value
Linen
An RGBA ColorF with the value #FAF0E6FF.
public static readonly ColorF Linen
Field Value
Magenta
An RGBA ColorF with the value #FF00FFFF.
public static readonly ColorF Magenta
Field Value
Maroon
An RGBA ColorF with the value #800000FF.
public static readonly ColorF Maroon
Field Value
MediumAquamarine
An RGBA ColorF with the value #66CDAAFF.
public static readonly ColorF MediumAquamarine
Field Value
MediumBlue
An RGBA ColorF with the value #0000CDFF.
public static readonly ColorF MediumBlue
Field Value
MediumOrchid
An RGBA ColorF with the value #BA55D3FF.
public static readonly ColorF MediumOrchid
Field Value
MediumPurple
An RGBA ColorF with the value #9370DBFF.
public static readonly ColorF MediumPurple
Field Value
MediumSeaGreen
An RGBA ColorF with the value #3CB371FF.
public static readonly ColorF MediumSeaGreen
Field Value
MediumSlateBlue
An RGBA ColorF with the value #7B68EEFF.
public static readonly ColorF MediumSlateBlue
Field Value
MediumSpringGreen
An RGBA ColorF with the value #00FA9AFF.
public static readonly ColorF MediumSpringGreen
Field Value
MediumTurquoise
An RGBA ColorF with the value #48D1CCFF.
public static readonly ColorF MediumTurquoise
Field Value
MediumVioletRed
An RGBA ColorF with the value #C71585FF.
public static readonly ColorF MediumVioletRed
Field Value
MidnightBlue
An RGBA ColorF with the value #191970FF.
public static readonly ColorF MidnightBlue
Field Value
MintCream
An RGBA ColorF with the value #F5FFFAFF.
public static readonly ColorF MintCream
Field Value
MistyRose
An RGBA ColorF with the value #FFE4E1FF.
public static readonly ColorF MistyRose
Field Value
Moccasin
An RGBA ColorF with the value #FFE4B5FF.
public static readonly ColorF Moccasin
Field Value
NavajoWhite
An RGBA ColorF with the value #FFDEADFF.
public static readonly ColorF NavajoWhite
Field Value
Navy
An RGBA ColorF with the value #000080FF.
public static readonly ColorF Navy
Field Value
OldLace
An RGBA ColorF with the value #FDF5E6FF.
public static readonly ColorF OldLace
Field Value
Olive
An RGBA ColorF with the value #808000FF.
public static readonly ColorF Olive
Field Value
OliveDrab
An RGBA ColorF with the value #6B8E23FF.
public static readonly ColorF OliveDrab
Field Value
Orange
An RGBA ColorF with the value #FFA500FF.
public static readonly ColorF Orange
Field Value
OrangeRed
An RGBA ColorF with the value #FF4500FF.
public static readonly ColorF OrangeRed
Field Value
Orchid
An RGBA ColorF with the value #DA70D6FF.
public static readonly ColorF Orchid
Field Value
PaleGoldenrod
An RGBA ColorF with the value #EEE8AAFF.
public static readonly ColorF PaleGoldenrod
Field Value
PaleGreen
An RGBA ColorF with the value #98FB98FF.
public static readonly ColorF PaleGreen
Field Value
PaleTurquoise
An RGBA ColorF with the value #AFEEEEFF.
public static readonly ColorF PaleTurquoise
Field Value
PaleVioletRed
An RGBA ColorF with the value #DB7093FF.
public static readonly ColorF PaleVioletRed
Field Value
PapayaWhip
An RGBA ColorF with the value #FFEFD5FF.
public static readonly ColorF PapayaWhip
Field Value
PeachPuff
An RGBA ColorF with the value #FFDAB9FF.
public static readonly ColorF PeachPuff
Field Value
Peru
An RGBA ColorF with the value #CD853FFF.
public static readonly ColorF Peru
Field Value
Pink
An RGBA ColorF with the value #FFC0CBFF.
public static readonly ColorF Pink
Field Value
Plum
An RGBA ColorF with the value #DDA0DDFF.
public static readonly ColorF Plum
Field Value
PowderBlue
An RGBA ColorF with the value #B0E0E6FF.
public static readonly ColorF PowderBlue
Field Value
Purple
An RGBA ColorF with the value #800080FF.
public static readonly ColorF Purple
Field Value
RebeccaPurple
An RGBA ColorF with the value #663399FF.
public static readonly ColorF RebeccaPurple
Field Value
Red
An RGBA ColorF with the value #FF0000FF.
public static readonly ColorF Red
Field Value
RosyBrown
An RGBA ColorF with the value #BC8F8FFF.
public static readonly ColorF RosyBrown
Field Value
RoyalBlue
An RGBA ColorF with the value #4169E1FF.
public static readonly ColorF RoyalBlue
Field Value
SaddleBrown
An RGBA ColorF with the value #8B4513FF.
public static readonly ColorF SaddleBrown
Field Value
Salmon
An RGBA ColorF with the value #FA8072FF.
public static readonly ColorF Salmon
Field Value
SandyBrown
An RGBA ColorF with the value #F4A460FF.
public static readonly ColorF SandyBrown
Field Value
SeaGreen
An RGBA ColorF with the value #2E8B57FF.
public static readonly ColorF SeaGreen
Field Value
SeaShell
An RGBA ColorF with the value #FFF5EEFF.
public static readonly ColorF SeaShell
Field Value
Sienna
An RGBA ColorF with the value #A0522DFF.
public static readonly ColorF Sienna
Field Value
Silver
An RGBA ColorF with the value #C0C0C0FF.
public static readonly ColorF Silver
Field Value
SkyBlue
An RGBA ColorF with the value #87CEEBFF.
public static readonly ColorF SkyBlue
Field Value
SlateBlue
An RGBA ColorF with the value #6A5ACDFF.
public static readonly ColorF SlateBlue
Field Value
SlateGray
An RGBA ColorF with the value #708090FF.
public static readonly ColorF SlateGray
Field Value
Snow
An RGBA ColorF with the value #FFFAFAFF.
public static readonly ColorF Snow
Field Value
SpringGreen
An RGBA ColorF with the value #00FF7FFF.
public static readonly ColorF SpringGreen
Field Value
SteelBlue
An RGBA ColorF with the value #4682B4FF.
public static readonly ColorF SteelBlue
Field Value
Tan
An RGBA ColorF with the value #D2B48CFF.
public static readonly ColorF Tan
Field Value
Teal
An RGBA ColorF with the value #008080FF.
public static readonly ColorF Teal
Field Value
Thistle
An RGBA ColorF with the value #D8BFD8FF.
public static readonly ColorF Thistle
Field Value
Tomato
An RGBA ColorF with the value #FF6347FF.
public static readonly ColorF Tomato
Field Value
Transparent
An RGBA ColorF with the value #00000000.
public static readonly ColorF Transparent
Field Value
Turquoise
An RGBA ColorF with the value #40E0D0FF.
public static readonly ColorF Turquoise
Field Value
Violet
An RGBA ColorF with the value #EE82EEFF.
public static readonly ColorF Violet
Field Value
Wheat
An RGBA ColorF with the value #F5DEB3FF.
public static readonly ColorF Wheat
Field Value
White
An RGBA ColorF with the value #FFFFFFFF.
public static readonly ColorF White
Field Value
WhiteSmoke
An RGBA ColorF with the value #F5F5F5FF.
public static readonly ColorF WhiteSmoke
Field Value
Yellow
An RGBA ColorF with the value #FFFF00FF.
public static readonly ColorF Yellow
Field Value
YellowGreen
An RGBA ColorF with the value #9ACD32FF.
public static readonly ColorF YellowGreen
Field Value
Properties
A
The A component of the color.
public float A { get; init; }
Property Value
B
The B component of the color.
public float B { get; init; }
Property Value
G
The G component of the color.
public float G { get; init; }
Property Value
R
The R component of the color.
public float R { get; init; }
Property Value
Methods
AsVector3()
public Vector3 AsVector3()
Returns
AsVector4()
public Vector4 AsVector4()
Returns
Equals(ColorF)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(ColorF other)
Parameters
other
ColorFAn object to compare with this object.
Returns
Equals(object?)
Indicates whether this instance and a specified object are equal.
public override bool Equals(object? obj)
Parameters
obj
objectThe 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
floatThe hue of the color. This must be between 0 and 1.
saturation
floatThe saturation of the color. This must be between 0 and 1.
value
floatThe 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
floatThe hue of the color. This must be between 0 and 1.
saturation
floatThe saturation of the color. This must be between 0 and 1.
value
floatThe value (brightness) of the color. This must be between 0 and 1.
alpha
floatThe 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
ColorFThe first color.
color2
ColorFThe second color.
t
floatThe 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
ColorFThe first color.
color2
ColorFThe second color.
t
floatThe interpolation amount, from 0.0 to 1.0.
Returns
- ColorF
The interpolated color.
ToColor()
public Color ToColor()
Returns
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
Returns
operator !=(ColorF, ColorF)
Indicates if two ColorF objects are not equal.
public static bool operator !=(ColorF left, ColorF right)