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
Implements
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
Blue
The blue channel.
public byte Blue { get; init; }Property Value
Green
The green channel.
public byte Green { get; init; }Property Value
Name
Gets the color as an uppercase #RRGGBBAA string.
public string Name { get; }Property Value
Red
The red channel.
public byte Red { get; init; }Property Value
Methods
FromString(string)
Parses a hexadecimal RGBA shadow color.
public static TextShadowColor FromString(string value)Parameters
value string
A #RRGGBBAA value.
Returns
The parsed shadow color.
Exceptions
value is not a valid hexadecimal shadow color.
ToString()
Returns the uppercase #RRGGBBAA representation of this color.
public override string ToString()Returns
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
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
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
The parsed shadow color.
Exceptions
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
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
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
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
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
The color produced by multiplying each component by 255 and converting it to a byte.
Exceptions
components contains fewer than four elements.