Color.FromRgb 方法

定义

重载

FromRgb(Double, Double, Double)

返回新的 RGB 颜色实例。

FromRgb(Int32, Int32, Int32)

返回新的 RGB 颜色实例。

FromRgb(Double, Double, Double)

返回新的 RGB 颜色实例。

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

参数

r
System.Double

该颜色的红色分量。

g
System.Double

该颜色的绿色分量。

b
System.Double

该颜色的蓝色分量。

返回

RGB 颜色

注解

组件值固定为 [0,1]。 方法 FromRgb(Double, Double, Double) 严格等效于 new Color (r, g, b),并且存在用于 API 一致性。

适用于

FromRgb(Int32, Int32, Int32)

返回新的 RGB 颜色实例。

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

参数

r
System.Int32

该颜色的红色分量。

g
System.Int32

该颜色的绿色分量。

b
System.Int32

该颜色的蓝色分量。

返回

新的 RGB 颜色。

注解

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

适用于