Table of Contents

Struct Color

Namespace
Xui.Core.Canvas
Assembly
Core.dll

Represents a color using red, green, blue, and alpha components, all normalized to the range [0, 1].

public struct Color
Inherited Members

Constructors

Color(NFloat, NFloat, NFloat, NFloat)

Initializes a new Color with the specified red, green, blue, and alpha components.

public Color(NFloat red, NFloat green, NFloat blue, NFloat alpha)

Parameters

red NFloat

Red component, normalized [0, 1]

green NFloat

Green component, normalized [0, 1]

blue NFloat

Blue component, normalized [0, 1]

alpha NFloat

Alpha component, normalized [0, 1]

Color(uint)

Initializes a new Color from a packed 32-bit RGBA value. The value format is 0xRRGGBBAA, where each component is 8 bits.

public Color(uint rgba)

Parameters

rgba uint

Packed RGBA value in 0xRRGGBBAA format.

Fields

Alpha

Alpha (opacity) component of the color, in the range [0, 1].

public NFloat Alpha

Field Value

NFloat

Blue

Blue component of the color, in the range [0, 1].

public NFloat Blue

Field Value

NFloat

Green

Green component of the color, in the range [0, 1].

public NFloat Green

Field Value

NFloat

Red

Red component of the color, in the range [0, 1].

public NFloat Red

Field Value

NFloat

Properties

IsTransparent

Returns true if the color is fully transparent (Alpha = 0).

public readonly bool IsTransparent { get; }

Property Value

bool

Operators

implicit operator Color(uint)

Implicitly converts a 32-bit RGBA value (0xRRGGBBAA) to a Color.

public static implicit operator Color(uint rgbaHex)

Parameters

rgbaHex uint

Packed RGBA hex value.

Returns

Color