[]
        
(Showing Draft Content)

C1.Util.DX.ColorF.-ctor

ColorF Constructor

ColorF(float)

Initializes a new instance of the ColorF struct.

Declaration
public ColorF(float value)
Public Sub New(value As Single)
Parameters
Type Name Description
float value

The value that will be assigned to all components.

ColorF(float, float, float, float)

Initializes a new instance of the ColorF struct.

Declaration
public ColorF(float red, float green, float blue, float alpha = 1)
Public Sub New(red As Single, green As Single, blue As Single, Optional alpha As Single = 1)
Parameters
Type Name Description
float red

The red component of the color.

float green

The green component of the color.

float blue

The blue component of the color.

float alpha

The alpha component of the color.

ColorF(uint)

Initializes a new instance of the ColorF struct.

Declaration
[CLSCompliant(false)]
public ColorF(uint argb)
<CLSCompliant(False)>
Public Sub New(argb As UInteger)
Parameters
Type Name Description
uint argb

A packed unsigned integer containing all four color components in ARGB order.

ColorF(uint, float)

Initializes a new instance of the ColorF struct.

Declaration
[CLSCompliant(false)]
public ColorF(uint rgb, float alpha)
<CLSCompliant(False)>
Public Sub New(rgb As UInteger, alpha As Single)
Parameters
Type Name Description
uint rgb

A packed unsigned integer containing three color components in RGB order.

float alpha

The alpha component of the color.

ColorF(ColorF, float)

Initializes a new instance of the ColorF struct.

Declaration
public ColorF(ColorF value, float alpha = 1)
Public Sub New(value As ColorF, Optional alpha As Single = 1)
Parameters
Type Name Description
ColorF value

The source ColorF.

float alpha

The alpha component of the color.

ColorF(Color)

Initializes a new instance of the ColorF struct.

Declaration
public ColorF(Color color)
Public Sub New(color As Color)
Parameters
Type Name Description
Color color

The System.Drawing.Color value.

ColorF(Vector3, float)

Initializes a new instance of the ColorF struct.

Declaration
public ColorF(Vector3 value, float alpha = 1)
Public Sub New(value As Vector3, Optional alpha As Single = 1)
Parameters
Type Name Description
Vector3 value

The red, green, and blue components of the color.

float alpha

The alpha component of the color.

ColorF(Vector4)

Initializes a new instance of the ColorF struct.

Declaration
public ColorF(Vector4 value)
Public Sub New(value As Vector4)
Parameters
Type Name Description
Vector4 value

The red, green, blue, and alpha components of the color.

ColorF(float[])

Initializes a new instance of the ColorF struct.

Declaration
public ColorF(float[] values)
Public Sub New(values As Single())
Parameters
Type Name Description
float[] values

The values to assign to the red, green, blue, and alpha components of the color. This must be an array with four elements.

Exceptions
Type Condition
ArgumentNullException

Thrown when values is null.

ArgumentOutOfRangeException

Thrown when values contains more or less than four elements.