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