JD2022-TU1/main/tools/legacy/UA_AtlasEditor/Tools/Extensions.cs

25 lines
738 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace UA_AtlasEditor.Tools
{
public static class Extensions
{
public static System.Windows.Media.Color ToMediaColor(this System.Drawing.Color color)
{
return System.Windows.Media.Color.FromArgb(color.A, color.R, color.G, color.B);
}
public static int ToArgb(this System.Windows.Media.Color color)
{
return (color.A << 24) | (color.R << 16) | (color.G << 8) | color.B;
}
public static System.Drawing.Color ToDrawingColor(this System.Windows.Media.Color color)
{
return System.Drawing.Color.FromArgb(color.ToArgb());
}
}
}