예제 #1
0
        public static CGColor ToCGColor(this SKColor color)
        {
#if __TVOS__
            // see https://bugzilla.xamarin.com/show_bug.cgi?id=44507
            return(UIColor.FromRGBA(color.Red, color.Green, color.Blue, color.Alpha).CGColor);
#else
            return(new CGColor(color.Red / 255f, color.Green / 255f, color.Blue / 255f, color.Alpha / 255f));
#endif
        }
예제 #2
0
        public static CGColor ToCGColor(this SKColorF color)
        {
#if __TVOS__ || __WATCHOS__ || __IOS__
            // see https://bugzilla.xamarin.com/show_bug.cgi?id=44507
            return(UIColor.FromRGBA(color.Red, color.Green, color.Blue, color.Alpha).CGColor);
#else
            return(UIColor.FromRgba(color.Red, color.Green, color.Blue, color.Alpha).CGColor);
#endif
        }