Smoothed download bar, fixed many warnings
This commit is contained in:
@@ -96,10 +96,10 @@ namespace LightlessSync.UI
|
||||
public static Vector4 HexToRgba(string hexColor)
|
||||
{
|
||||
hexColor = hexColor.TrimStart('#');
|
||||
int r = int.Parse(hexColor.Substring(0, 2), NumberStyles.HexNumber);
|
||||
int g = int.Parse(hexColor.Substring(2, 2), NumberStyles.HexNumber);
|
||||
int b = int.Parse(hexColor.Substring(4, 2), NumberStyles.HexNumber);
|
||||
int a = hexColor.Length == 8 ? int.Parse(hexColor.Substring(6, 2), NumberStyles.HexNumber) : 255;
|
||||
int r = int.Parse(hexColor[..2], NumberStyles.HexNumber);
|
||||
int g = int.Parse(hexColor[2..4], NumberStyles.HexNumber);
|
||||
int b = int.Parse(hexColor[4..6], NumberStyles.HexNumber);
|
||||
int a = hexColor.Length == 8 ? int.Parse(hexColor[6..8], NumberStyles.HexNumber) : 255;
|
||||
return new Vector4(r / 255f, g / 255f, b / 255f, a / 255f);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user