summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Platform.WP8/ConvertExtensions.cs
blob: ed96ecdf0539454bf9faa245aa42d429c9160ed7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
´╗┐using System.Windows.Media;

namespace Xamarin.Forms.Platform.WinPhone
{
	internal static class ConvertExtensions
	{
		public static Brush ToBrush(this Color color)
		{
			return new SolidColorBrush(color.ToMediaColor());
		}

		public static System.Windows.Media.Color ToMediaColor(this Color color)
		{
			return System.Windows.Media.Color.FromArgb((byte)(color.A * 255), (byte)(color.R * 255), (byte)(color.G * 255), (byte)(color.B * 255));
		}
	}
}