Class TiledColor
- Namespace
- DotTiled
- Assembly
- DotTiled.dll
Represents a Tiled color.
public class TiledColor : IParsable<TiledColor>, IEquatable<TiledColor>
- Inheritance
-
TiledColor
- 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(TiledColor)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(TiledColor other)
Parameters
otherTiledColorAn 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
objobjectThe 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 TiledColor. Expects strings in the format #RRGGBB or #AARRGGBB.
The leading # is optional.
public static TiledColor Parse(string s, IFormatProvider provider)
Parameters
sstringA string value to parse into a TiledColor
providerIFormatProviderAn object that supplies culture-specific information about the format of s.
Returns
- TiledColor
The parsed TiledColor
Exceptions
- FormatException
Thrown in case the provided string
sis 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 TiledColor)
Attempts to parse the specified string into a TiledColor. Expects strings in the format #RRGGBB or #AARRGGBB.
The leading # is optional.
public static bool TryParse(string s, IFormatProvider provider, out TiledColor result)
Parameters
sstringA string value to parse into a TiledColor
providerIFormatProviderAn object that supplies culture-specific information about the format of s.
resultTiledColorWhen this method returns, contains the parsed TiledColor or
nullon failure.
Returns
- bool
trueifswas successfully parsed; otherwise,false.