Exemple #1
0
        public static Color GetColor(this UIKit.UIColor color)
        {
            nfloat r, g, b, a;

            color.GetRGBA(out r, out g, out b, out a);
            return(Color.FromRGB(r, g, b, a));
        }
Exemple #2
0
        public static uint UIColorToInt(UIKit.UIColor color)
        {
            nfloat colorR, colorG, colorB, colorA;

            color.GetRGBA(out colorR, out colorG, out colorB, out colorA);

            return((uint)(colorR * 255.0f) << 24 | (uint)(colorG * 255.0f) << 16 | (uint)(colorB * 255.0f) << 8 | (uint)(colorA * 255.0f));
        }
Exemple #3
0
        public static RGB ToRGB(this UIKit.UIColor color)
        {
            nfloat r, g, b, a;

            color.GetRGBA(out r, out g, out b, out a);
            return(new RGB((byte)Math.Round(r * 255),
                           (byte)Math.Round(g * 255),
                           (byte)Math.Round(b * 255),
                           (byte)Math.Round(a * 255)));
        }