Quantum representation of a color with 4 channels (R, G, B, A) each represented by a byte.
More...
Inherits IEquatable< ColorRGBA >.
|
| | 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...
|
| |
|
| 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 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...
|
| |
Quantum representation of a color with 4 channels (R, G, B, A) each represented by a byte.
◆ 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
-
| hex | String 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
-
| r | Byte representing the red color |
| g | Byte representing the green color |
| b | Byte 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
-
| r | Byte representing the red color |
| g | Byte representing the green color |
| b | Byte representing the blue color |
| a | Byte representing the alpha channel |
◆ Lerp()
Linearly interpolates between a and b by t. The parameter t is clamped to the range [0, 1].
- Parameters
-
| a | Start color |
| b | End color |
| t | The interpolation value between the two floats. |
- Returns
- Lerped color
◆ LerpUnclamped()
Linearly interpolates between a and b by t.
- Parameters
-
| a | Start color |
| b | End color |
| t | The 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
-
- 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
-
- 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
-
| ptr | The pointer to the ColorRGBA. |
| serializer | The 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
-
- Returns
- A copy of the color
◆ ColliderGreen
Create the default collider color green.
◆ ColliderBlue
Create the default collider color blue.
The red channel of the color.
The green channel of the color.
The blue channel of the color.
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.
◆ Red
◆ Blue
◆ Gray
◆ Cyan
◆ White
◆ Green
◆ Yellow
◆ Magenta
Create the color magenta.
◆ Black
◆ Lightgray
Create the color light grey.