Table of Contents

Struct Color

Namespace
Sccg
Assembly
Sccg.dll

Represents a hex color.

public readonly struct Color : IEquatable<Color>
Implements
Inherited Members

Constructors

Color(byte, byte, byte)

Initialize a new instance of Color with the specified RGB values.

Color(byte, byte, byte, byte)

Initialize a new instance of Color with the specified RGB values and terminal color code.

Color(string)

Initialize a new instance of Color with the specified hex code.

Color(string, byte)

Initialize a new instance of Color with the specified hex code and terminal color code.

Properties

Default

Represents the default color.

HexCode

The hex code of the color which starts with '#' and followed by 6 hex digits (lower character).

None

Represents the no color.

TerminalColorCode

The terminal color code. the default is null.

Methods

AlphaBlend(Color, Color, float)

Blend two colors.

Equals(Color)

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

Equals(object?)

Tests whether the specified object is a Color structure and is equivalent to this Color structure.

GetHashCode()

Returns the hash code for this instance.

HasHexCode()

Check if the color has hex code. (not IsDefault() and not IsNone())

IsDefault()

Check if the color is Default.

IsNone()

Check if the color is None.

ToString()

Converts this Color structure to a human-readable string.

Operators

operator ==(in Color, in Color)

Tests whether two specified Color structures are equivalent.

implicit operator Color(string)

Initialize a new instance of Color with the specified hex code.

implicit operator Color((byte, byte, byte))

Initialize a new instance of Color with the specified RGB values.

operator !=(in Color, in Color)

Tests whether two specified Color structures are different.