Table of Contents

Struct Color4

Namespace
Xui.GPU.Shaders.Types
Assembly
Xui.Core.dll

A 4-component RGBA color value.

public struct Color4
Inherited Members

Constructors

Color4(F32, F32, F32)

Initializes a new instance from RGB values with alpha set to 1.

public Color4(F32 r, F32 g, F32 b)

Parameters

r F32
g F32
b F32

Color4(F32, F32, F32, F32)

Initializes a new instance of the Color4 struct.

public Color4(F32 r, F32 g, F32 b, F32 a)

Parameters

r F32
g F32
b F32
a F32

Fields

A

The alpha component.

public F32 A

Field Value

F32

B

The blue component.

public F32 B

Field Value

F32

G

The green component.

public F32 G

Field Value

F32

R

The red component.

public F32 R

Field Value

F32

Properties

Black

Gets a black color (0, 0, 0, 1).

public static Color4 Black { get; }

Property Value

Color4

Transparent

Gets a transparent color (0, 0, 0, 0).

public static Color4 Transparent { get; }

Property Value

Color4

White

Gets a white color (1, 1, 1, 1).

public static Color4 White { get; }

Property Value

Color4

Methods

ToString()

Returns the fully qualified type name of this instance.

public override string ToString()

Returns

string

The fully qualified type name.

Operators

implicit operator Color4(uint)

Implicitly converts a packed 32-bit RGBA value (0xRRGGBBAA) to a Color4. Compatible with Xui.Core.Canvas.Colors web color constants.

public static implicit operator Color4(uint rgba)

Parameters

rgba uint

Returns

Color4

implicit operator Color4(Color)

Implicitly converts from Color to Color4.

public static implicit operator Color4(Color color)

Parameters

color Color

Returns

Color4

operator *(Color4, Color4)

Multiplies two colors component-wise.

public static Color4 operator *(Color4 left, Color4 right)

Parameters

left Color4
right Color4

Returns

Color4

operator *(Color4, F32)

Multiplies a color by a scalar.

public static Color4 operator *(Color4 left, F32 right)

Parameters

left Color4
right F32

Returns

Color4