mirror of
https://github.com/vdemydiuk/mtapi.git
synced 2026-08-12 18:28:07 +00:00
Fixed issue #5: Color representation. MQL uses different color representation than C# System.Drawing.Color (Thanks Tr4Dr).
This commit is contained in:
@@ -10,12 +10,12 @@ namespace MtApi
|
||||
{
|
||||
public static Color ConvertFromMtColor(int color)
|
||||
{
|
||||
return Color.FromArgb(color);
|
||||
return Color.FromArgb((byte)(color), (byte)(color >> 8), (byte)(color >> 16));
|
||||
}
|
||||
|
||||
public static int ConvertToMtColor(Color color)
|
||||
{
|
||||
return color == Color.Empty ? 0xffffff : (color.ToArgb() & 0xffffff);
|
||||
return color == Color.Empty ? 0xffffff : (Color.FromArgb(color.B, color.G, color.R).ToArgb() & 0xffffff);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user