mirror of
https://github.com/vdemydiuk/mtapi.git
synced 2026-07-28 19:17:48 +00:00
18 lines
505 B
C#
Executable File
18 lines
505 B
C#
Executable File
using System.Drawing;
|
|
|
|
namespace MtApi
|
|
{
|
|
class MtApiColorConverter
|
|
{
|
|
public static Color ConvertFromMtColor(int color)
|
|
{
|
|
return Color.FromArgb((byte)(color), (byte)(color >> 8), (byte)(color >> 16));
|
|
}
|
|
|
|
public static int ConvertToMtColor(Color? color)
|
|
{
|
|
return color == null || color == Color.Empty ? 0xffffff : (Color.FromArgb(color.Value.B, color.Value.G, color.Value.R).ToArgb() & 0xffffff);
|
|
}
|
|
}
|
|
}
|