A cross-platform UI framework for .NET
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

23 lines
613 B

using System;
using Avalonia.Media;
using CoreGraphics;
using UIKit;
namespace Avalonia.iOS
{
static class Extensions
{
public static Size ToAvalonia(this CGSize size) => new Size(size.Width, size.Height);
public static Point ToAvalonia(this CGPoint point) => new Point(point.X, point.Y);
static float ColorComponent(byte c) => (float) c / 255;
public static UIColor ToUiColor(this Color color) => new UIColor(
ColorComponent(color.R),
ColorComponent(color.G),
ColorComponent(color.B),
ColorComponent(color.A));
}
}