Class Color
Color represented in RGB format.
Assembly: Robocode.TankRoyale.BotApi.dll
Syntax
Constructors
|
Edit this page
View Source
Color(int, int, int)
Creates a Color from RGB values.
Declaration
public Color(int redValue, int greenValue, int blueValue)
Parameters
Type |
Name |
Description |
int |
redValue |
The red color component of the RGB color in the range [0 - 255]
|
int |
greenValue |
The green color component of the RGB color in the range [0 - 255]
|
int |
blueValue |
The red blue component of the RGB color in the range [0 - 255]
|
Exceptions
Fields
|
Edit this page
View Source
Black
Declaration
public static readonly Color Black
Field Value
|
Edit this page
View Source
Blue
Declaration
public static readonly Color Blue
Field Value
|
Edit this page
View Source
Cyan
Declaration
public static readonly Color Cyan
Field Value
|
Edit this page
View Source
Fuchsia
Declaration
public static readonly Color Fuchsia
Field Value
|
Edit this page
View Source
Gray
Declaration
public static readonly Color Gray
Field Value
|
Edit this page
View Source
Green
Declaration
public static readonly Color Green
Field Value
|
Edit this page
View Source
Lime
Declaration
public static readonly Color Lime
Field Value
|
Edit this page
View Source
Maroon
Declaration
public static readonly Color Maroon
Field Value
|
Edit this page
View Source
Navy
Declaration
public static readonly Color Navy
Field Value
|
Edit this page
View Source
Olive
Declaration
public static readonly Color Olive
Field Value
|
Edit this page
View Source
Orange
Declaration
public static readonly Color Orange
Field Value
|
Edit this page
View Source
Purple
Declaration
public static readonly Color Purple
Field Value
|
Edit this page
View Source
Red
Declaration
public static readonly Color Red
Field Value
|
Edit this page
View Source
Silver
Declaration
public static readonly Color Silver
Field Value
|
Edit this page
View Source
Teal
Declaration
public static readonly Color Teal
Field Value
|
Edit this page
View Source
White
Declaration
public static readonly Color White
Field Value
|
Edit this page
View Source
Yellow
Declaration
public static readonly Color Yellow
Field Value
Properties
|
Edit this page
View Source
BlueValue
The green color component of the color.
Declaration
public int BlueValue { get; }
Property Value
Type |
Description |
int |
The green color component of the RGB color in the range [0 - 255]
|
|
Edit this page
View Source
GreenValue
The blue color component of the color.
Declaration
public int GreenValue { get; }
Property Value
Type |
Description |
int |
The blue color component of the RGB color in the range [0 - 255]
|
|
Edit this page
View Source
RedValue
The red color component of the color.
Declaration
public int RedValue { get; }
Property Value
Type |
Description |
int |
The red color component of the RGB color in the range [0 - 255]
|
Methods
|
Edit this page
View Source
Equals(object)
Determines whether the specified object is equal to the current object.
Declaration
public override bool Equals(object obj)
Parameters
Type |
Name |
Description |
object |
obj |
The object to compare with the current object.
|
Returns
Type |
Description |
bool |
true if the specified object is equal to the current object; otherwise, false.
|
Overrides
|
Edit this page
View Source
FromHex(string)
Creates a color from a hex triplet. A hex triplet is either three or six hexadecimal digits that represents an
RGB Color.
An example of a hex triplet is "09C" or "0099CC", which both represents the same color.
Declaration
public static Color FromHex(string hex)
Parameters
Type |
Name |
Description |
string |
hex |
A string containing either a three or six hexadecimal numbers like "09C" or "0099CC".
|
Returns
Type |
Description |
Color |
The created Color.
|
Exceptions
|
Edit this page
View Source
FromString(string)
Creates a color from a string. Currently, only numeric RGB values are supported.
This method works the same was as FromHex(string) except that is required as hash sign before the hex value.
An example of a numeric RGB value is "#09C" or "#0099CC", which both represents the same color.
Declaration
public static Color FromString(string str)
Parameters
Type |
Name |
Description |
string |
str |
A string containing either a three or six hexadecimal RGB values like "#09C" or "#0099CC".
|
Returns
Type |
Description |
Color |
The created Color; null if the input parameter is null .
|
Exceptions
|
Edit this page
View Source
GetHashCode()
Serves as the default hash function.
Declaration
public override int GetHashCode()
Returns
Type |
Description |
int |
A hash code for the current object.
|
Overrides
|
Edit this page
View Source
ToHex()
Returns the color as a hex triplet of six hexadecimal digits representing an RGB color, e.g. "0099CC".
Declaration
Returns
Type |
Description |
string |
The color as a hex triplet of six hexadecimal digits representing an RGB color, e.g. "0099CC".
|
|
Edit this page
View Source
ToString()
Returns a string that represents the current object.
Declaration
public override string ToString()
Returns
Type |
Description |
string |
A string that represents the current object.
|
Overrides