Table of Contents

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

byte

B

The blue component of the color.

public required byte B { get; set; }

Property Value

byte

G

The green component of the color.

public required byte G { get; set; }

Property Value

byte

R

The red component of the color.

public required byte R { get; set; }

Property Value

byte

Methods

Equals(Color)

Indicates whether the current object is equal to another object of the same type.

public bool Equals(Color other)

Parameters

other Color

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

Equals(object)

Determines whether the specified object is equal to the current object.

public override bool Equals(object obj)

Parameters

obj object

The object to compare with the current object.

Returns

bool

true if the specified object is equal to the current object; otherwise, false.

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 string

A string value to parse into a Color

provider IFormatProvider

An object that supplies culture-specific information about the format of s.

Returns

Color

The parsed Color

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 string

A string value to parse into a Color

provider IFormatProvider

An object that supplies culture-specific information about the format of s.

result Color

When this method returns, contains the parsed Color or null on failure.

Returns

bool

true if s was successfully parsed; otherwise, false.