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. The red component value. |
System. The green component value. |
System. The blue component value. |
System. The alpha component value. |
Fields
A
Alpha component of the color.
Declaration
public byte A
Field Value
System.
|
B
Blue component of the color.
Declaration
public byte B
Field Value
System.
|
Black
G
Green component of the color.
Declaration
public byte G
Field Value
System.
|
R
Red component of the color.
Declaration
public byte R
Field Value
System.
|
SizeInBytes
The size of the Color32 type, in bytes.
Declaration
public static readonly int SizeInBytes
Field Value
System.
|
Transparent
White
Properties
Item[Int32]
Gets or sets the component at the specified index.
Declaration
public byte this[int index] { get; set; }
Parameters
System. 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. The value of the red, green, blue, and alpha components, depending on the index. |
Exceptions
System. 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
Returns
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
ToString()
Returns a nicely formatted string of this color.
Declaration
public override string ToString()
Returns
System.
|
ToString(String)
Returns a nicely formatted string of this color.
Declaration
public string ToString(string format)
Parameters
System.
|
Returns
System.
|
Operators
Addition(Color32, Color32)
Adds two colors.
Declaration
public static Color32 operator +(Color32 a, Color32 b)
Parameters
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. 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
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. 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. 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
Returns
Color32
The result of the operator. |