Skip to content

Commit

Permalink
Merge pull request #1 from MindGirl/xmlschemaparser
Browse files Browse the repository at this point in the history
Use invariant culture for parsing double values
  • Loading branch information
Gilles Khouzam authored Aug 14, 2017
2 parents 21dea14 + a313826 commit 1b875aa
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tools/ColorTool/ColorTool/XmlSchemeParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -45,15 +46,15 @@ static bool parseRgbFromXml(XmlNode components, ref uint rgb)
{
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
{
Expand Down

0 comments on commit 1b875aa

Please sign in to comment.