From 495e77ec5a8e8f5904e79777bfe6369ac39dee78 Mon Sep 17 00:00:00 2001 From: Matthew Leibowitz Date: Tue, 27 Mar 2018 12:26:01 +0200 Subject: [PATCH] Fix CGColor creation. Fixes #475 --- .../SkiaSharp.Views/SkiaSharp.Views.Apple/AppleExtensions.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/SkiaSharp.Views/SkiaSharp.Views.Apple/AppleExtensions.cs b/source/SkiaSharp.Views/SkiaSharp.Views.Apple/AppleExtensions.cs index 8b67e01f..40930594 100644 --- a/source/SkiaSharp.Views/SkiaSharp.Views.Apple/AppleExtensions.cs +++ b/source/SkiaSharp.Views/SkiaSharp.Views.Apple/AppleExtensions.cs @@ -69,11 +69,11 @@ namespace SkiaSharp.Views.Mac public static CGColor ToCGColor(this SKColor color) { -#if __TVOS__ || __WATCHOS__ +#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 new CGColor(color.Red / 255f, color.Green / 255f, color.Blue / 255f, color.Alpha / 255f); + return UIColor.FromRgba(color.Red, color.Green, color.Blue, color.Alpha).CGColor; #endif }