Color
Namespace: Murder.Core.Graphics
Assembly: Murder.dll
public sealed struct Color : IEquatable<T>
The color type as described by the engine. Values are represented as float from 0 to 1. To create a color using 0-255, use [Color.CreateFrom256(System.Int32,System.Int32,System.Int32)](../../../Murder/Core/Graphics/Color.html#createfrom256(int,).
Implements: IEquatable<T>
⭐ Constructors
public Color(float r, float g, float b, float a)
Creates a color with the specified values. If the fourth argument is omitted, the value used for the alpha will be 1, meaning a completely opaque color. Do note colors in Murder use 0-1 as their range. To initialize a color using 0-255, please refer to [Color.CreateFrom256(System.Int32,System.Int32,System.Int32)](../../../Murder/Core/Graphics/Color.html#createfrom256(int,).
Parameters
r
float
g
float
b
float
a
float
⭐ Properties
A
public readonly float A;
Transparency of this color.
Returns
float
B
public readonly float B;
Amount of blue in this color.
Returns
float
Black
public static Color Black { get; }
Returns
Color
Blue
public static Color Blue { get; }
Returns
Color
BrightGray
public static Color BrightGray { get; }
Returns
Color
ColdGray
public static Color ColdGray { get; }
Returns
Color
G
public readonly float G;
Amount of green in this color.
Returns
float
Gray
public static Color Gray { get; }
Returns
Color
Green
public static Color Green { get; }
Returns
Color
Magenta
public static Color Magenta { get; }
Returns
Color
Orange
public static Color Orange { get; }
Returns
Color
R
public readonly float R;
Amount of red in this color.
Returns
float
Red
public static Color Red { get; }
Returns
Color
Transparent
public static Color Transparent { get; }
Returns
Color
WarmGray
public static Color WarmGray { get; }
Returns
Color
White
public static Color White { get; }
Returns
Color
⭐ Methods
CreateFrom256(int, int, int)
public Color CreateFrom256(int r, int g, int b)
Returns
Color
Darken(float)
public Color Darken(float r)
Parameters
r
float
Returns
Color
FadeAlpha(float)
public Color FadeAlpha(float alpha)
Parameters
alpha
float
Returns
Color
FromHex(string)
public Color FromHex(string hex)
Parses a string
Parameters
hex
string
Returns
Color
Lerp(Color, Color, float)
public Color Lerp(Color a, Color b, float factor)
Parameters
a
Color
b
Color
factor
float
Returns
Color
Parse(string)
public Color Parse(string str)
Parameters
str
string
Returns
Color
Premultiply()
public Color Premultiply()
Returns
Color
ToUint(Vector4)
public uint ToUint(Vector4 Color)
Parameters
Color
Vector4
Returns
uint
ToSysVector4()
public Vector4 ToSysVector4()
Returns
Vector4
Equals(Color)
public virtual bool Equals(Color other)
Parameters
other
Color
Returns
bool
Equals(Object)
public virtual bool Equals(Object obj)
Parameters
obj
Object
Returns
bool
GetHashCode()
public virtual int GetHashCode()
Returns
int
ToString()
public virtual string ToString()
Returns
string
⚡