File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments