Class Color
- Namespace
- DotTiled
- Assembly
- DotTiled.dll
Represents a Tiled color.
public class Color : IParsable<Color>, IEquatable<Color>
- Inheritance
-
Color
- Implements
- Inherited Members
Properties
A
The alpha component of the color.
public byte A { get; set; }
Property Value
B
The blue component of the color.
public required byte B { get; set; }
Property Value
G
The green component of the color.
public required byte G { get; set; }
Property Value
R
The red component of the color.
public required byte R { get; set; }
Property Value
Methods
Equals(Color)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(Color other)
Parameters
other
ColorAn object to compare with this object.
Returns
Equals(object)
Determines whether the specified object is equal to the current object.
public override bool Equals(object obj)
Parameters
obj
objectThe object to compare with the current object.
Returns
GetHashCode()
Serves as the default hash function.
public override int GetHashCode()
Returns
- int
A hash code for the current object.
Parse(string, IFormatProvider)
Attempts to parse the specified string into a Color. Expects strings in the format #RRGGBB
or #AARRGGBB
.
The leading #
is optional.
public static Color Parse(string s, IFormatProvider provider)
Parameters
s
stringA string value to parse into a Color
provider
IFormatProviderAn object that supplies culture-specific information about the format of s.
Returns
Exceptions
- FormatException
Thrown in case the provided string
s
is not in a valid format.
ToString()
Returns a string that represents the current object.
public override string ToString()
Returns
- string
A string that represents the current object.
TryParse(string, IFormatProvider, out Color)
Attempts to parse the specified string into a Color. Expects strings in the format #RRGGBB
or #AARRGGBB
.
The leading #
is optional.
public static bool TryParse(string s, IFormatProvider provider, out Color result)
Parameters
s
stringA string value to parse into a Color
provider
IFormatProviderAn object that supplies culture-specific information about the format of s.
result
ColorWhen this method returns, contains the parsed Color or
null
on failure.
Returns
- bool
true
ifs
was successfully parsed; otherwise,false
.