Xamarin.Forms
Color
s可以從ARGB或從AHSL創建。從一種模式到另一種模式的轉換是自動進行的,因此您不必將兩種格式都保存在數據庫中(您正在存儲ARGBHSL)。
現在,有很多的方法來創建,由這些值的子集的顏色:
public Color(double r, double g, double b, double a);
public static Color FromHex(string hex); //one of the following: #rgb, #argb, #rrggbb, #aarrggbb, the leading # is optional
public static Color FromUint(uint argb);
public static Color FromRgba(int r, int g, int b, int a);
public static Color FromRgb(int r, int g, int b);
public static Color FromRgba(double r, double g, double b, double a);
public static Color FromRgb(double r, double g, double b);
public static Color FromHsla(double h, double s, double l, double a = 1d);
我敢肯定你會發現無論是構造或那些適合工廠方法你需要。
如何從用戶獲取顏色?它是常量的列表,還是來自rgb或十六進制? – FetFrumos
這是一個xamarin表單顏色列表 – Mireille