Skip to content

Class TextShadowColor

Namespace: Void.Minecraft.Components.Text.Colors
Assembly: Void.Minecraft.dll

Represents the ARGB shadow color of a Minecraft text component.

public record TextShadowColor : IEquatable<TextShadowColor>

Inheritance

objectTextShadowColor

Implements

IEquatable<TextShadowColor>

Inherited Members

object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.MemberwiseClone(), object.ReferenceEquals(object?, object?), object.ToString()

Constructors

TextShadowColor(byte, byte, byte, byte)

Represents the ARGB shadow color of a Minecraft text component.

public TextShadowColor(byte Alpha, byte Red, byte Green, byte Blue)

Parameters

Alpha byte

The alpha channel.

Red byte

The red channel.

Green byte

The green channel.

Blue byte

The blue channel.

Properties

Alpha

The alpha channel.

public byte Alpha { get; init; }

Property Value

byte

Blue

The blue channel.

public byte Blue { get; init; }

Property Value

byte

Green

The green channel.

public byte Green { get; init; }

Property Value

byte

Name

Gets the color as an uppercase #RRGGBBAA string.

public string Name { get; }

Property Value

string

Red

The red channel.

public byte Red { get; init; }

Property Value

byte

Methods

FromString(string)

Parses a hexadecimal RGBA shadow color.

public static TextShadowColor FromString(string value)

Parameters

value string

A #RRGGBBAA value.

Returns

TextShadowColor

The parsed shadow color.

Exceptions

ArgumentException

value is not a valid hexadecimal shadow color.

ToString()

Returns the uppercase #RRGGBBAA representation of this color.

public override string ToString()

Returns

string

The value of .

Operators

implicit operator TextShadowColor((byte Alpha, byte Red, byte Green, byte Blue))

Creates a shadow color from an ARGB tuple.

public static implicit operator TextShadowColor((byte Alpha, byte Red, byte Green, byte Blue) color)

Parameters

color (byte Alpha, byte Red, byte Green, byte Blue)

The ARGB channels.

Returns

TextShadowColor

A color containing the supplied channels.

implicit operator TextShadowColor(Color)

Creates a shadow color from a drawing color.

public static implicit operator TextShadowColor(Color color)

Parameters

color Color

The drawing color.

Returns

TextShadowColor

The corresponding shadow color.

implicit operator TextShadowColor(string)

Parses a hexadecimal shadow color.

public static implicit operator TextShadowColor(string color)

Parameters

color string

A #RRGGBBAA value.

Returns

TextShadowColor

The parsed shadow color.

Exceptions

ArgumentException

color is not a valid hexadecimal shadow color.

implicit operator Color(TextShadowColor)

Converts a shadow color to a drawing color.

public static implicit operator Color(TextShadowColor color)

Parameters

color TextShadowColor

The shadow color.

Returns

Color

The corresponding drawing color.

implicit operator string(TextShadowColor)

Converts a shadow color to its #RRGGBBAA representation.

public static implicit operator string(TextShadowColor color)

Parameters

color TextShadowColor

The shadow color.

Returns

string

The value of .

implicit operator int(TextShadowColor)

Packs a shadow color into a signed 32-bit ARGB value.

public static implicit operator int(TextShadowColor color)

Parameters

color TextShadowColor

The shadow color.

Returns

int

The packed ARGB value.

implicit operator TextShadowColor(int)

Unpacks a signed 32-bit ARGB value into a shadow color.

public static implicit operator TextShadowColor(int value)

Parameters

value int

The packed ARGB value.

Returns

TextShadowColor

The unpacked shadow color.

implicit operator float[](TextShadowColor)

Converts the channel bytes to normalized floating-point components.

public static implicit operator float[](TextShadowColor color)

Parameters

color TextShadowColor

The shadow color.

Returns

float[]

An array containing the implementation’s alpha, red, green, and blue component calculations.

implicit operator TextShadowColor(float[])

Creates a shadow color from normalized floating-point components.

public static implicit operator TextShadowColor(float[] components)

Parameters

components float[]

Alpha, red, green, and blue components in that order.

Returns

TextShadowColor

The color produced by multiplying each component by 255 and converting it to a byte.

Exceptions

IndexOutOfRangeException

components contains fewer than four elements.