Merge pull request #1 from MindGirl/xmlschemaparser

Use invariant culture for parsing double values
This commit is contained in:
Gilles Khouzam 2017-08-14 10:25:22 -07:00 committed by GitHub
commit 1b875aafb3

View file

@ -3,6 +3,7 @@
// Licensed under the terms described in the LICENSE file in the root of this project.
//
using System;
using System.Globalization;
using System.Xml;
using static ColorTool.ConsoleAPI;
@ -45,15 +46,15 @@ namespace ColorTool
{
if (c.InnerText == RED_KEY)
{
r = (int)(255 * Convert.ToDouble(c.NextSibling.InnerText));
r = (int)(255 * Convert.ToDouble(c.NextSibling.InnerText, CultureInfo.InvariantCulture));
}
else if (c.InnerText == GREEN_KEY)
{
g = (int)(255 * Convert.ToDouble(c.NextSibling.InnerText));
g = (int)(255 * Convert.ToDouble(c.NextSibling.InnerText, CultureInfo.InvariantCulture));
}
else if (c.InnerText == BLUE_KEY)
{
b = (int)(255 * Convert.ToDouble(c.NextSibling.InnerText));
b = (int)(255 * Convert.ToDouble(c.NextSibling.InnerText, CultureInfo.InvariantCulture));
}
else
{