Table of Contents

Class Color

Namespace
Sdl3Sharp.Video.Coloring
Assembly
Sdl3Sharp.dll

Provides static methods for creating Color<T> values

public static class Color
Inheritance
Color
Inherited Members

Fields

OpaqueAlphaByte

A fully opaque alpha component value as a byte

public const byte OpaqueAlphaByte = 255

Field Value

byte

OpaqueAlphaFloat

A fully opaque alpha component value as a float

public const float OpaqueAlphaFloat = 1

Field Value

float

TransparentAlphaByte

A fully transparent alpha component value as a byte

public const byte TransparentAlphaByte = 0

Field Value

byte

TransparentAlphaFloat

A fully transparent alpha component value as a float

public const float TransparentAlphaFloat = 0

Field Value

float

Methods

From(byte)

Creates a new Color<byte> value from a specified byte value

public static Color<byte> From(byte value)

Parameters

value byte

The byte value to use for the red, green and blue component value

Returns

Color<byte>

A new Color<byte> value

Remarks

The red, green and blue component values of the resulting Color<byte> value will all be set to the specified value. This results in a gray-scale color where 0 is black and 255 is white.

The alpha component value of the resulting Color<byte> value will be set to 255 (fully opaque).

From(byte, byte, byte)

Creates a new Color<byte> value from the specified red, green and blue component values as byte values

public static Color<byte> From(byte r, byte g, byte b)

Parameters

r byte

The red component value

g byte

The green component value

b byte

The blue component value

Returns

Color<byte>

A new Color<byte> value

Remarks

The alpha component value of the resulting Color<byte> value will be set to 255 (fully opaque).

From(byte, byte, byte, byte)

Creates a new Color<byte> value from the specified red, green, blue and alpha component values as byte values

public static Color<byte> From(byte r, byte g, byte b, byte a)

Parameters

r byte

The red component value

g byte

The green component value

b byte

The blue component value

a byte

The alpha component value

Returns

Color<byte>

A new Color<byte> value

From(float)

Creates a new Color<byte> value from a specified float value

public static Color<float> From(float value)

Parameters

value float

The float value to use for the red, green and blue component value

Returns

Color<float>

A new Color<float> value

Remarks

The value used the the red, green and blue component values is expected to be in the range from 0 to 1.

The red, green and blue component values of the resulting Color<float> value will all be set to the specified value. This results in a gray-scale color where 0 is black and 1 is white.

The alpha component value of the resulting Color<float> value will be set to 1 (fully opaque).

From(float, float, float)

Creates a new Color<float> value from the specified red, green and blue component values as float values

public static Color<float> From(float r, float g, float b)

Parameters

r float

The red component value

g float

The green component value

b float

The blue component value

Returns

Color<float>

A new Color<float> value

Remarks

The red, green and blue component values are expected to be in the range from 0 to 1, where 0 is the minimum component intensity and 1 is the maximum component intensity.

The alpha component value of the resulting Color<float> value will be set to 1 (fully opaque).

From(float, float, float, float)

Creates a new Color<float> value from the specified red, green, blue and alpha component values as float values

public static Color<float> From(float r, float g, float b, float a)

Parameters

r float

The red component value

g float

The green component value

b float

The blue component value

a float

The alpha component value

Returns

Color<float>

A new Color<float> value

Remarks

The red, green, blue and alpha component values are expected to be in the range from 0 to 1, where 0 is the minimum component intensity and 1 is the maximum component intensity.