diff --git a/binding/Binding/Definitions.cs b/binding/Binding/Definitions.cs index a05a27c5e7..8e66cb6095 100644 --- a/binding/Binding/Definitions.cs +++ b/binding/Binding/Definitions.cs @@ -127,6 +127,16 @@ public override int GetHashCode () { return (int) color; } + + public static implicit operator SKColor (uint color) + { + return new SKColor (color); + } + + public static explicit operator uint (SKColor color) + { + return color.color; + } } [Flags] diff --git a/binding/Binding/SkiaApi.cs b/binding/Binding/SkiaApi.cs index 03e903d9f8..3b8b2c3ada 100755 --- a/binding/Binding/SkiaApi.cs +++ b/binding/Binding/SkiaApi.cs @@ -198,7 +198,7 @@ internal static class SkiaApi [DllImport(SKIA, CallingConvention = CallingConvention.Cdecl)] public extern static void sk_paint_set_verticaltext(sk_paint_t t, bool v); [DllImport(SKIA, CallingConvention = CallingConvention.Cdecl)] - public extern static SKColor sk_paint_get_color(sk_paint_t t); + public extern static UInt32 sk_paint_get_color(sk_paint_t t); [DllImport(SKIA, CallingConvention = CallingConvention.Cdecl)] public extern static void sk_paint_set_color(sk_paint_t t, SKColor color); [DllImport(SKIA, CallingConvention = CallingConvention.Cdecl)] @@ -923,9 +923,9 @@ internal static class SkiaApi [DllImport(SKIA, CallingConvention = CallingConvention.Cdecl)] public extern static void sk_bitmap_erase_rect(sk_bitmap_t cbitmap, SKColor color, ref SKRectI rect); [DllImport(SKIA, CallingConvention = CallingConvention.Cdecl)] - public extern static SKColor sk_bitmap_get_pixel_color(sk_bitmap_t cbitmap, int x, int y); + public extern static UInt32 sk_bitmap_get_pixel_color(sk_bitmap_t cbitmap, int x, int y); [DllImport(SKIA, CallingConvention = CallingConvention.Cdecl)] - public extern static SKColor sk_bitmap_get_index8_color(sk_bitmap_t cbitmap, int x, int y); + public extern static UInt32 sk_bitmap_get_index8_color(sk_bitmap_t cbitmap, int x, int y); [DllImport(SKIA, CallingConvention = CallingConvention.Cdecl)] public extern static void sk_bitmap_set_pixel_color(sk_bitmap_t cbitmap, int x, int y, SKColor color); [DllImport(SKIA, CallingConvention = CallingConvention.Cdecl)]