Represents an RGBA color as four floats between 0.0 and 1.0.
More...
|
| Color (float r, float g, float b, float a=1f) |
| Constructs a color from the given red, green, blue and (optionally) alpha components as floats between 0.0 and 1.0. More...
|
|
| Color (int r, int g, int b, int a=255) |
| Constructs a color from the given red, green, blue and (optionally) alpha components as integers between 0 and 255. More...
|
|
Color | ScaleRgb (float scale) |
|
int | ToRgb () |
| Converts the color to an integer, with the R, G, and B components stored as the first, second, and third bytes respectively in order of significance. More...
|
|
int | ToRgba () |
| Converts the color to an integer, with the R, G, B, and A components stored as the first, second, third, and fourth bytes respectively in order of significance. More...
|
|
override int | GetHashCode () |
| Returns the hash code for this color. More...
|
|
bool | Equals (Color other) |
| Tests for equality with another color. More...
|
|
override bool | Equals (object obj) |
| Indicates whether this instance and a specified object are equal. More...
|
|
override string | ToString () |
| Returns a string representation of this color. More...
|
|
|
static Color | Parse (string str) |
| Parses a color from a string with the format #RRGGBB[AA] More...
|
|
static bool | TryParse (string str, out Color color) |
| Attempts to parse a color from a string with the format #RRGGBB[AA], returning true if the parse was successful. More...
|
|
static Color | FromRgb (int rgb) |
| Converts an integer representation of an RGB color to a Color, with the least significant byte storing the red component. More...
|
|
static Color | FromRgba (int rgba) |
| Converts an integer representation of an RGBA color to a Color, with the least significant byte storing the red component. More...
|
|
static Color | Lerp (Color a, Color b, float t) |
| Linearly interpolates between two colors. More...
|
|
static Color | operator+ (Color a, Color b) |
| Adds two colors together. More...
|
|
static Color | operator- (Color a, Color b) |
| Subtracts a color from another. More...
|
|
static Color | operator* (Color a, Color b) |
| Multiplies two colors together. More...
|
|
static Color | operator* (Color clr, float mul) |
| Multiplies a color by a scalar. More...
|
|
static Color | operator* (float mul, Color clr) |
| Multiplies a color by a scalar. More...
|
|
static Color | operator/ (Color clr, float div) |
| Divides a color by a scalar. More...
|
|
static bool | operator== (Color a, Color b) |
| Tests for equality with another color. More...
|
|
static bool | operator!= (Color a, Color b) |
| Tests for inequality with another color. More...
|
|
Represents an RGBA color as four floats between 0.0 and 1.0.
Chunks.Graphics.Color.Color |
( |
float |
r, |
|
|
float |
g, |
|
|
float |
b, |
|
|
float |
a = 1f |
|
) |
| |
Constructs a color from the given red, green, blue and (optionally) alpha components as floats between 0.0 and 1.0.
- Parameters
-
r | Red component |
g | Greem component |
b | Blue component |
a | Alpha component |
Chunks.Graphics.Color.Color |
( |
int |
r, |
|
|
int |
g, |
|
|
int |
b, |
|
|
int |
a = 255 |
|
) |
| |
Constructs a color from the given red, green, blue and (optionally) alpha components as integers between 0 and 255.
- Parameters
-
r | Red component |
g | Greem component |
b | Blue component |
a | Alpha component |
bool Chunks.Graphics.Color.Equals |
( |
Color |
other | ) |
|
Tests for equality with another color.
- Parameters
-
other | Color to test for equality with |
override bool Chunks.Graphics.Color.Equals |
( |
object |
obj | ) |
|
Indicates whether this instance and a specified object are equal.
- Parameters
-
obj | Another object to compare to. |
static Color Chunks.Graphics.Color.FromRgb |
( |
int |
rgb | ) |
|
|
static |
Converts an integer representation of an RGB color to a Color, with the least significant byte storing the red component.
- Parameters
-
rgb | Integer representation of an RGB color |
static Color Chunks.Graphics.Color.FromRgba |
( |
int |
rgba | ) |
|
|
static |
Converts an integer representation of an RGBA color to a Color, with the least significant byte storing the red component.
- Parameters
-
rgba | Integer representation of an RGBA color |
override int Chunks.Graphics.Color.GetHashCode |
( |
| ) |
|
Returns the hash code for this color.
Linearly interpolates between two colors.
- Parameters
-
a | Starting color |
b | Ending color |
t | Interpolation parameter between 0.0 and 1.0 |
static bool Chunks.Graphics.Color.operator!= |
( |
Color |
a, |
|
|
Color |
b |
|
) |
| |
|
static |
Tests for inequality with another color.
- Parameters
-
a | First color to test for inequality with |
b | Second color to test for inequality with |
Multiplies two colors together.
- Parameters
-
a | First color to multiply |
b | Second color to multiply |
static Color Chunks.Graphics.Color.operator* |
( |
Color |
clr, |
|
|
float |
mul |
|
) |
| |
|
static |
Multiplies a color by a scalar.
- Parameters
-
clr | Color to multiply |
mul | Scalar value to multiply by |
static Color Chunks.Graphics.Color.operator* |
( |
float |
mul, |
|
|
Color |
clr |
|
) |
| |
|
static |
Multiplies a color by a scalar.
- Parameters
-
clr | Color to multiply |
mul | Scalar value to multiply by |
Adds two colors together.
- Parameters
-
a | First color to add |
b | Second color to add |
Subtracts a color from another.
- Parameters
-
static Color Chunks.Graphics.Color.operator/ |
( |
Color |
clr, |
|
|
float |
div |
|
) |
| |
|
static |
Divides a color by a scalar.
- Parameters
-
clr | Color to divide |
div | Scalar value to divide by |
static bool Chunks.Graphics.Color.operator== |
( |
Color |
a, |
|
|
Color |
b |
|
) |
| |
|
static |
Tests for equality with another color.
- Parameters
-
a | First color to test for equality with |
b | Second color to test for equality with |
static Color Chunks.Graphics.Color.Parse |
( |
string |
str | ) |
|
|
static |
Parses a color from a string with the format #RRGGBB[AA]
- Parameters
-
Color Chunks.Graphics.Color.ScaleRgb |
( |
float |
scale | ) |
|
int Chunks.Graphics.Color.ToRgb |
( |
| ) |
|
Converts the color to an integer, with the R, G, and B components stored as the first, second, and third bytes respectively in order of significance.
int Chunks.Graphics.Color.ToRgba |
( |
| ) |
|
Converts the color to an integer, with the R, G, B, and A components stored as the first, second, third, and fourth bytes respectively in order of significance.
override string Chunks.Graphics.Color.ToString |
( |
| ) |
|
Returns a string representation of this color.
static bool Chunks.Graphics.Color.TryParse |
( |
string |
str, |
|
|
out Color |
color |
|
) |
| |
|
static |
Attempts to parse a color from a string with the format #RRGGBB[AA], returning true if the parse was successful.
- Parameters
-
str | String to parse |
color | If true is returned, contains the parsed color |
float Chunks.Graphics.Color.A |
float Chunks.Graphics.Color.B |
readonly Color Chunks.Graphics.Color.Black = new Color(0, 0, 0) |
|
static |
float Chunks.Graphics.Color.G |
float Chunks.Graphics.Color.R |
readonly Color Chunks.Graphics.Color.White = new Color(255, 255, 255) |
|
static |
The documentation for this struct was generated from the following file: