Skip to content

Color Constructors

Definition

Namespace: Brine2D.Core

Overloads
Color\(byte, byte, byte, byte\) Creates a new color from RGBA byte values \(0\-255\).
Color\(float, float, float, float\) Creates a new color from normalized float values \(0\.0\-1\.0\).
Color\(uint\) Creates a new color from an integer RGBA value \(0xRRGGBBAA format\).

Color\(byte, byte, byte, byte\) Constructor

Creates a new color from RGBA byte values \(0\-255\).

C#
public Color(byte r, byte g, byte b, byte a=byte.MaxValue);

Parameters

r System.Byte

Red component \(0\-255\).

g System.Byte

Green component \(0\-255\).

b System.Byte

Blue component \(0\-255\).

a System.Byte

Alpha component \(0\-255, default: 255 = opaque\).

Color\(float, float, float, float\) Constructor

Creates a new color from normalized float values \(0\.0\-1\.0\).

C#
public Color(float r, float g, float b, float a=1f);

Parameters

r System.Single

Red component \(0\.0\-1\.0\).

g System.Single

Green component \(0\.0\-1\.0\).

b System.Single

Blue component \(0\.0\-1\.0\).

a System.Single

Alpha component \(0\.0\-1\.0, default: 1\.0 = opaque\).

Color\(uint\) Constructor

Creates a new color from an integer RGBA value \(0xRRGGBBAA format\).

C#
public Color(uint rgba);

Parameters

rgba System.UInt32

Packed RGBA value \(e\.g\., 0xFF0000FF for red\).