{"action":"closed","issue":{"url":"https://api.github.com/repos/vdemydiuk/mtapi/issues/5","repository_url":"https://api.github.com/repos/vdemydiuk/mtapi","labels_url":"https://api.github.com/repos/vdemydiuk/mtapi/issues/5/labels{/name}","comments_url":"https://api.github.com/repos/vdemydiuk/mtapi/issues/5/comments","events_url":"https://api.github.com/repos/vdemydiuk/mtapi/issues/5/events","html_url":"https://github.com/vdemydiuk/mtapi/issues/5","id":154540336,"number":5,"title":"Color representation","user":{"login":"Tr4Dr","id":19206422,"avatar_url":"https://avatars.githubusercontent.com/u/19206422?v=3","gravatar_id":"","url":"https://api.github.com/users/Tr4Dr","html_url":"https://github.com/Tr4Dr","followers_url":"https://api.github.com/users/Tr4Dr/followers","following_url":"https://api.github.com/users/Tr4Dr/following{/other_user}","gists_url":"https://api.github.com/users/Tr4Dr/gists{/gist_id}","starred_url":"https://api.github.com/users/Tr4Dr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Tr4Dr/subscriptions","organizations_url":"https://api.github.com/users/Tr4Dr/orgs","repos_url":"https://api.github.com/users/Tr4Dr/repos","events_url":"https://api.github.com/users/Tr4Dr/events{/privacy}","received_events_url":"https://api.github.com/users/Tr4Dr/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-05-12T17:41:20Z","updated_at":"2016-05-13T08:53:56Z","closed_at":"2016-05-13T08:53:56Z","body":"MQL uses different color representation than C# System.Drawing.Color.\r\n\r\nMQL4 color ( https://docs.mql4.com/basis/types/integer/color ):\r\n**0x00BBGGRR**\r\n**00**: ignored values\r\n**BB**: Blue component\r\n**GG**: Green component\r\n**RR**: Red component\r\n\r\nSystem.Drawing.Color ( https://msdn.microsoft.com/en-us/library/system.drawing.color%28v=vs.110%29.aspx ):\r\n**0xAARRGGBB**\r\n**AA**: Alpha component\r\n**BB**: Blue component\r\n**GG**: Green component\r\n**RR**: Red component\r\n\r\nA possible fix in **`MtApiColorConverter.cs`**:\r\n\r\n```C#\r\nusing System.Drawing;\r\n\r\nnamespace MtApi\r\n{\r\n    class MtApiColorConverter\r\n    {\r\n        public static Color ConvertFromMtColor(int mqlColor)\r\n        {\r\n            return Color.FromArgb((byte)(mqlColor), (byte)(mqlColor >> 8), (byte)(mqlColor >> 16));\r\n        }\r\n\r\n        public static int ConvertToMtColor(Color color)\r\n        {\r\n            return color == Color.Empty ? 0xffffff : (Color.FromArgb(color.B, color.G, color.R).ToArgb() & 0xffffff);\r\n        }\r\n    }\r\n}\r\n```"}}