Skip to content

Commit 1f6d854

Browse files
committed
- bug fix
1 parent c9eb5fb commit 1f6d854

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

Latex4PowerPoint/AddinUtilities.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,10 +122,12 @@ public static Color stringToColor(string colorText)
122122
{
123123
return Color.Black;
124124
}
125+
System.Globalization.CultureInfo ci;
126+
ci = System.Globalization.CultureInfo.CreateSpecificCulture("en-US");
125127
string[] col = colorText.Split(',');
126-
float fred = Convert.ToSingle(col[0].Replace('.', ',')) * 255.0f;
127-
float fgreen = Convert.ToSingle(col[1].Replace('.', ',')) * 255.0f;
128-
float fblue = Convert.ToSingle(col[2].Replace('.', ',')) * 255.0f;
128+
float fred = Convert.ToSingle(col[0], ci) * 255.0f;
129+
float fgreen = Convert.ToSingle(col[1], ci) * 255.0f;
130+
float fblue = Convert.ToSingle(col[2], ci) * 255.0f;
129131
return Color.FromArgb((int)fred, (int)fgreen, (int)fblue);
130132
}
131133

0 commit comments

Comments
 (0)