Color Constructors

Definition

Overloads

Color(Double)

Initialize a new gray color.

Color(Double, Double, Double)

Initializes a new RGB color.

Color(Double, Double, Double, Double)

Initializes a new RGB color with an alpha channel.

Color(Double)

Initialize a new gray color.

public Color (double value);
new Xamarin.Forms.Color : double -> Xamarin.Forms.Color

Parameters

value
Double

The luminosity of the gray-scale color.

Remarks

This is equivalent to new Color (value, value, value). The value is clamped to [0-1]. App developers should use the FromRgb(Double, Double, Double) equivalent methods, instead.

Color(Double, Double, Double)

Initializes a new RGB color.

public Color (double r, double g, double b);
new Xamarin.Forms.Color : double * double * double -> Xamarin.Forms.Color

Parameters

r
Double

The red component of the color.

g
Double

The green component of the color.

b
Double

The blue component of the color.

Remarks

This is equivalent to new Color (r, g, b, 1). Values are clamped to [0-1]. Prefer the FromRgb(Double, Double, Double) equivalent methods.

Color(Double, Double, Double, Double)

Initializes a new RGB color with an alpha channel.

public Color (double r, double g, double b, double a);
new Xamarin.Forms.Color : double * double * double * double -> Xamarin.Forms.Color

Parameters

r
Double

The red component of the color.

g
Double

The green component of the color.

b
Double

The blue component of the color.

a
Double

The alpha component of the color.

Remarks

Values are clamped to [0-1].

Applies to