A 8 bit Color structure.
More...
|
| | Color (byte red, byte green, byte blue, byte alpha=255) |
| | Constructs a new Color from the given rgba values.
|
| |
| | Color (float red, float green, float blue, float alpha=1.0f) |
| | Constructs a new Color from the given rgba values.
|
| |
|
bool | Equals (Color other) |
| |
|
override bool | Equals (object? obj) |
| |
|
override int | GetHashCode () |
| |
| string | ToColorToken () |
| | Returns the 3 character sequence token for this color, used in coloring text.
This is mostly for internal use. Use StringExtensions.ColorString for formatting text with a certain color.
|
| |
| int | ToRGBA () |
| | Gets the 32-bit RGBA value of this Color structure.
|
| |
|
override string | ToString () |
| |
| uint | ToUnsignedRGBA () |
| | Gets the unsigned 32-bit RGBA value of this Color structure.
|
| |
|
| static unsafe Color | FromRGBA (int rgba) |
| | Creates a Color structure from a 32-bit RGBA value.
|
| |
| static Color | FromRGBA (string rgbaHexString) |
| | Creates a Color structure from a 32-bit RGBA hex string.
|
| |
| static unsafe Color | FromRGBA (uint rgba) |
| | Creates a Color structure from an unsigned 32-bit RGBA value.
|
| |
|
static bool | operator!= (Color left, Color right) |
| |
|
static bool | operator== (Color left, Color right) |
| |
|
|
readonly byte | Alpha |
| | Gets the alpha value of this color as a byte (0-255).
|
| |
|
readonly byte | Blue |
| | Gets the blue value of this color as a byte (0-255).
|
| |
|
readonly byte | Green |
| | Gets the green value of this color as a byte (0-255).
|
| |
|
readonly byte | Red |
| | Gets the red value of this color as a byte (0-255).
|
| |
|
|
float | AlphaF [get] |
| | Gets the alpha value of this color as a float (0-1).
|
| |
|
float | BlueF [get] |
| | Gets the blue value of this color as a float (0-1).
|
| |
|
float | GreenF [get] |
| | Gets the green value of this color as a float (0-1).
|
| |
|
float | RedF [get] |
| | Gets the red value of this color as a float (0-1).
|
| |
◆ Color() [1/2]
| Anvil.API.Color.Color |
( |
byte | red, |
|
|
byte | green, |
|
|
byte | blue, |
|
|
byte | alpha = 255 ) |
|
inline |
Constructs a new Color from the given rgba values.
- Parameters
-
| red | The red value. |
| green | The green value. |
| blue | The blue value. |
| alpha | The alpha value. |
◆ Color() [2/2]
| Anvil.API.Color.Color |
( |
float | red, |
|
|
float | green, |
|
|
float | blue, |
|
|
float | alpha = 1::0f ) |
|
inline |
Constructs a new Color from the given rgba values.
- Parameters
-
| red | The red value. |
| green | The green value. |
| blue | The blue value. |
| alpha | The alpha value. |
◆ FromRGBA() [1/3]
| static unsafe Color Anvil.API.Color.FromRGBA |
( |
int | rgba | ) |
|
|
inlinestatic |
Creates a Color structure from a 32-bit RGBA value.
- Parameters
-
| rgba | The 32-bit RGBA value. |
- Returns
- A Color structure representing the RGBA value.
◆ FromRGBA() [2/3]
| static Color Anvil.API.Color.FromRGBA |
( |
string | rgbaHexString | ) |
|
|
inlinestatic |
Creates a Color structure from a 32-bit RGBA hex string.
- Parameters
-
| rgbaHexString | The 32-bit RGBA hex string. |
- Returns
- A Color structure representing the RGBA value.
◆ FromRGBA() [3/3]
| static unsafe Color Anvil.API.Color.FromRGBA |
( |
uint | rgba | ) |
|
|
inlinestatic |
Creates a Color structure from an unsigned 32-bit RGBA value.
- Parameters
-
| rgba | The 32-bit RGBA value. |
- Returns
- A Color structure representing the RGBA value.
◆ ToColorToken()
| string Anvil.API.Color.ToColorToken |
( |
| ) |
|
|
inline |
Returns the 3 character sequence token for this color, used in coloring text.
This is mostly for internal use. Use StringExtensions.ColorString for formatting text with a certain color.
- Returns
- The 3 character sequence token representing this color.
◆ ToRGBA()
| int Anvil.API.Color.ToRGBA |
( |
| ) |
|
|
inline |
Gets the 32-bit RGBA value of this Color structure.
- Returns
- The 32-bit RGBA value of this Color.
◆ ToUnsignedRGBA()
| uint Anvil.API.Color.ToUnsignedRGBA |
( |
| ) |
|
|
inline |
Gets the unsigned 32-bit RGBA value of this Color structure.
- Returns
- The 32-bit RGBA value of this Color.
The documentation for this struct was generated from the following file:
- NWN.Anvil/src/main/API/Color.cs