Class Color32
Representation of RGBA colors in 32 bit format.
Inheritance
Namespace: FlaxEngine
Assembly: FlaxEngine.CSharp.dll
Syntax
public sealed class Color32 : ValueType
Constructors
Color32(Byte, Byte, Byte, Byte)
Constructs a new Color32 with given r, g, b, a components.
Declaration
public Color32(byte r, byte g, byte b, byte a)
Parameters
System.Byte
r
The red component value. |
System.Byte
g
The green component value. |
System.Byte
b
The blue component value. |
System.Byte
a
The alpha component value. |
Fields
A
Alpha component of the color.
Declaration
public byte A
Field Value
System.Byte
|
B
Blue component of the color.
Declaration
public byte B
Field Value
System.Byte
|
Black
G
Green component of the color.
Declaration
public byte G
Field Value
System.Byte
|
R
Red component of the color.
Declaration
public byte R
Field Value
System.Byte
|
SizeInBytes
The size of the Color32 type, in bytes.
Declaration
public static readonly int SizeInBytes
Field Value
System.Int32
|
Transparent
White
Properties
Item[Int32]
Gets or sets the component at the specified index.
Declaration
public byte this[int index] { get; set; }
Parameters
System.Int32
index
The index of the component to access. Use 0 for the alpha component, 1 for the red component, 2 for the green component, and 3 for the blue component. |
Property Value
System.Byte
The value of the red, green, blue, and alpha components, depending on the index. |
Exceptions
System.IndexOutOfRangeException
Thrown when the |
Methods
Lerp(Color32, Color32, Single)
Linearly interpolates between colors a and b by t.
Declaration
public static Color32 Lerp(Color32 a, Color32 b, float t)
Parameters
Color32
a
Color a |
Color32
b
Color b |
System.Single
t
Float for combining a and b |
Returns
Color32
|
Lerp(ref Color32, ref Color32, Single, out Color32)
Linearly interpolates between colors a and b by t.
Declaration
public static void Lerp(ref Color32 a, ref Color32 b, float t, out Color32 result)
Parameters
Color32
a
Color a |
Color32
b
Color b |
System.Single
t
Float for combining a and b |
Color32
result
Result |
ToString()
Returns a nicely formatted string of this color.
Declaration
public override string ToString()
Returns
System.String
|
ToString(String)
Returns a nicely formatted string of this color.
Declaration
public string ToString(string format)
Parameters
System.String
format
|
Returns
System.String
|
Operators
Addition(Color32, Color32)
Adds two colors.
Declaration
public static Color32 operator +(Color32 a, Color32 b)
Parameters
Color32
a
The first color. |
Color32
b
The second color. |
Returns
Color32
The result of the operator. |
Division(Color32, Single)
Divides color by the scale factor.
Declaration
public static Color32 operator /(Color32 a, float b)
Parameters
Color32
a
The first color. |
System.Single
b
The division factor. |
Returns
Color32
The result of the operator. |
Explicit(Color32 to Int4)
Declaration
public static explicit operator Int4(Color32 value)
Parameters
Color32
value
The value. |
Returns
Int4
The result of the conversion. |
Explicit(Color32 to Vector4)
Declaration
public static explicit operator Vector4(Color32 c)
Parameters
Color32
c
The color. |
Returns
Vector4
The result of the conversion. |
Implicit(Color to Color32)
Declaration
public static implicit operator Color32(Color c)
Parameters
Color
c
The color. |
Returns
Color32
The result of the conversion. |
Implicit(Color32 to Color)
Declaration
public static implicit operator Color(Color32 c)
Parameters
Color32
c
The color. |
Returns
Color
The result of the conversion. |
Multiply(Color32, Color32)
Multiplies color components by the other color components.
Declaration
public static Color32 operator *(Color32 a, Color32 b)
Parameters
Color32
a
The first color. |
Color32
b
The second color. |
Returns
Color32
The result of the operator. |
Multiply(Color32, Single)
Multiplies color components by the scale factor.
Declaration
public static Color32 operator *(Color32 a, float b)
Parameters
Color32
a
The color. |
System.Single
b
The scale. |
Returns
Color32
The result of the operator. |
Multiply(Single, Color32)
Multiplies color components by the scale factor.
Declaration
public static Color32 operator *(float b, Color32 a)
Parameters
System.Single
b
The scale. |
Color32
a
The color. |
Returns
Color32
The result of the operator. |
Subtraction(Color32, Color32)
Subtracts one color from the another.
Declaration
public static Color32 operator -(Color32 a, Color32 b)
Parameters
Color32
a
The first color. |
Color32
b
The second color. |
Returns
Color32
The result of the operator. |