Quantum 3 3.0.14

Classes | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Properties | List of all members
Quantum.ColorRGBA Struct Reference

Quantum representation of a color with 4 channels (R, G, B, A) each represented by a byte. More...

Inherits IEquatable< ColorRGBA >.

Classes

class  EqualityComparer
 The equality comparer for ColorRGBA instances. More...
 

Public Member Functions

 ColorRGBA (Byte r, Byte g, Byte b)
 Create a color with defining each channel. Alpha is set to 255. More...
 
 ColorRGBA (Byte r, Byte g, Byte b, Byte a)
 Create a color with defining each channel. Alpha is set to 255. More...
 
 ColorRGBA (String hex)
 Create a color from a string that encode a color with hex values. E.g. FF0000 for red or FF0000FF for red with full alpha. The leading '#' sign is optional. More...
 
readonly Boolean Equals (ColorRGBA other)
 Override Equals method. More...
 
readonly override Boolean Equals (Object obj)
 Override Equals method. More...
 
readonly override Int32 GetHashCode ()
 Override GetHashCode. More...
 
readonly ColorRGBA SetA (byte a)
 Create a copy of the color and set the alpha channel. More...
 
readonly override String ToString ()
 Override ToString method to debug output readable class members. More...
 

Static Public Member Functions

static ColorRGBA Lerp (ColorRGBA a, ColorRGBA b, FP t)
 Linearly interpolates between a and b by t. The parameter t is clamped to the range [0, 1]. More...
 
static ColorRGBA LerpUnclamped (ColorRGBA a, ColorRGBA b, FP t)
 Linearly interpolates between a and b by t. More...
 
static void Serialize (void *ptr, FrameSerializer serializer)
 Serializes a ColorRGBA into a FrameSerializer to write or read from a frame snapshot. More...
 

Public Attributes

Byte A
 The alpha channel of the color. More...
 
Byte B
 The blue channel of the color. More...
 
Byte G
 The green channel of the color. More...
 
Byte R
 The red channel of the color. More...
 

Static Public Attributes

static ColorRGBA ColliderBlue => new ColorRGBA(153, 217, 234)
 Create the default collider color blue. More...
 
static ColorRGBA ColliderGreen => new ColorRGBA(181, 230, 29)
 Create the default collider color green. More...
 
const int SIZE = 4
 The size of the component (or struct/type) in-memory inside the Frame data-buffers or stack (when passed as value parameter). Not related to the snapshot payload this occupies, which is bit-packed and compressed. More...
 

Properties

static ColorRGBA Black [get]
 Create the color black. More...
 
static ColorRGBA Blue [get]
 Create the color blue. More...
 
static ColorRGBA Cyan [get]
 Create the color cyan. More...
 
static ColorRGBA Gray [get]
 Create the color grey. More...
 
static ColorRGBA Green [get]
 Create the color green. More...
 
static ColorRGBA Lightgray [get]
 Create the color light grey. More...
 
static ColorRGBA Magenta [get]
 Create the color magenta. More...
 
static ColorRGBA Red [get]
 Create the color red. More...
 
static ColorRGBA White [get]
 Create the color white. More...
 
static ColorRGBA Yellow [get]
 Create the color yellow. More...
 

Detailed Description

Quantum representation of a color with 4 channels (R, G, B, A) each represented by a byte.

Constructor & Destructor Documentation

◆ ColorRGBA() [1/3]

Quantum.ColorRGBA.ColorRGBA ( String  hex)
inline

Create a color from a string that encode a color with hex values. E.g. FF0000 for red or FF0000FF for red with full alpha. The leading '#' sign is optional.

Parameters
hexString representing the hex color

◆ ColorRGBA() [2/3]

Quantum.ColorRGBA.ColorRGBA ( Byte  r,
Byte  g,
Byte  b 
)
inline

Create a color with defining each channel. Alpha is set to 255.

Parameters
rByte representing the red color
gByte representing the green color
bByte representing the blue color

◆ ColorRGBA() [3/3]

Quantum.ColorRGBA.ColorRGBA ( Byte  r,
Byte  g,
Byte  b,
Byte  a 
)
inline

Create a color with defining each channel. Alpha is set to 255.

Parameters
rByte representing the red color
gByte representing the green color
bByte representing the blue color
aByte representing the alpha channel

Member Function Documentation

◆ Lerp()

static ColorRGBA Quantum.ColorRGBA.Lerp ( ColorRGBA  a,
ColorRGBA  b,
FP  t 
)
inlinestatic

Linearly interpolates between a and b by t. The parameter t is clamped to the range [0, 1].

Parameters
aStart color
bEnd color
tThe interpolation value between the two floats.
Returns
Lerped color

◆ LerpUnclamped()

static ColorRGBA Quantum.ColorRGBA.LerpUnclamped ( ColorRGBA  a,
ColorRGBA  b,
FP  t 
)
inlinestatic

Linearly interpolates between a and b by t.

Parameters
aStart color
bEnd color
tThe interpolation value between the two floats.
Returns
Lerped color

◆ GetHashCode()

readonly override Int32 Quantum.ColorRGBA.GetHashCode ( )
inline

Override GetHashCode.

Returns
Unique hashcode

◆ Equals() [1/2]

readonly override Boolean Quantum.ColorRGBA.Equals ( Object  obj)
inline

Override Equals method.

Parameters
objOther color
Returns
true when both colors are equal

◆ ToString()

readonly override String Quantum.ColorRGBA.ToString ( )
inline

Override ToString method to debug output readable class members.

Returns
Debug string

◆ Equals() [2/2]

readonly Boolean Quantum.ColorRGBA.Equals ( ColorRGBA  other)
inline

Override Equals method.

Parameters
otherOther color
Returns
true when both colors are equal

◆ Serialize()

static void Quantum.ColorRGBA.Serialize ( void *  ptr,
FrameSerializer  serializer 
)
inlinestatic

Serializes a ColorRGBA into a FrameSerializer to write or read from a frame snapshot.

Parameters
ptrThe pointer to the ColorRGBA.
serializerThe FrameSerializer instance into which the struct will be serialized.

◆ SetA()

readonly ColorRGBA Quantum.ColorRGBA.SetA ( byte  a)
inline

Create a copy of the color and set the alpha channel.

Parameters
aNew alpha value
Returns
A copy of the color

Member Data Documentation

◆ ColliderGreen

ColorRGBA Quantum.ColorRGBA.ColliderGreen => new ColorRGBA(181, 230, 29)
static

Create the default collider color green.

◆ ColliderBlue

ColorRGBA Quantum.ColorRGBA.ColliderBlue => new ColorRGBA(153, 217, 234)
static

Create the default collider color blue.

◆ R

Byte Quantum.ColorRGBA.R

The red channel of the color.

◆ G

Byte Quantum.ColorRGBA.G

The green channel of the color.

◆ B

Byte Quantum.ColorRGBA.B

The blue channel of the color.

◆ A

Byte Quantum.ColorRGBA.A

The alpha channel of the color.

◆ SIZE

const int Quantum.ColorRGBA.SIZE = 4
static

The size of the component (or struct/type) in-memory inside the Frame data-buffers or stack (when passed as value parameter). Not related to the snapshot payload this occupies, which is bit-packed and compressed.

Property Documentation

◆ Red

ColorRGBA Quantum.ColorRGBA.Red
staticget

Create the color red.

◆ Blue

ColorRGBA Quantum.ColorRGBA.Blue
staticget

Create the color blue.

◆ Gray

ColorRGBA Quantum.ColorRGBA.Gray
staticget

Create the color grey.

◆ Cyan

ColorRGBA Quantum.ColorRGBA.Cyan
staticget

Create the color cyan.

◆ White

ColorRGBA Quantum.ColorRGBA.White
staticget

Create the color white.

◆ Green

ColorRGBA Quantum.ColorRGBA.Green
staticget

Create the color green.

◆ Yellow

ColorRGBA Quantum.ColorRGBA.Yellow
staticget

Create the color yellow.

◆ Magenta

ColorRGBA Quantum.ColorRGBA.Magenta
staticget

Create the color magenta.

◆ Black

ColorRGBA Quantum.ColorRGBA.Black
staticget

Create the color black.

◆ Lightgray

ColorRGBA Quantum.ColorRGBA.Lightgray
staticget

Create the color light grey.