Share via


Color.FromRgba 方法

定义

重载

FromRgba(Double, Double, Double, Double)

返回新的 RGBA 颜色实例。

FromRgba(Int32, Int32, Int32, Int32)

返回新的 RGBA 颜色实例。

FromRgba(Double, Double, Double, Double)

返回新的 RGBA 颜色实例。

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

参数

r
System.Double

该颜色的红色分量。

g
System.Double

该颜色的绿色分量。

b
System.Double

该颜色的蓝色分量。

a
System.Double

该颜色的 alpha 分量。

返回

新的 RGBA 颜色。

注解

将组件值固定为 [0,1]。 方法 FromRgba(Double, Double, Double, Double) 等效于 new Color (r, g, b, a),并且用于实现 API 一致性。

适用于

FromRgba(Int32, Int32, Int32, Int32)

返回新的 RGBA 颜色实例。

public static Xamarin.Forms.Color FromRgba (int r, int g, int b, int a);
static member FromRgba : int * int * int * int -> Xamarin.Forms.Color

参数

r
System.Int32

该颜色的红色分量。

g
System.Int32

该颜色的绿色分量。

b
System.Int32

该颜色的蓝色分量。

a
System.Int32

该颜色的 alpha 分量。

返回

新的 RGBA 颜色。

注解

组件值被固定为 [0,255]。

适用于