small visual adjusments

This commit is contained in:
Oleksandr Bezdieniezhnykh
2024-08-12 11:14:09 +03:00
parent a81a6f881d
commit 468d28d9d8
5 changed files with 26 additions and 39 deletions
@@ -7,20 +7,14 @@ public static class ColorExtensions
public static Color ToColor(this int id)
{
var index = id % ColorValues.Length;
return ToColor($"#{ColorValues[index]}");
}
public static Color ToColor(string hex)
{
var color = (Color)ColorConverter.ConvertFromString(hex);
color.A = 128;
var hex = $"#40{ColorValues[index]}";
var color =(Color)ColorConverter.ConvertFromString(hex);
return color;
}
private static readonly string[] ColorValues =
[
"FF0000", "00FF00", "0000FF", "FFFF00", "FF00FF", "00FFFF", "000000",
"FF0000", "00FF00", "0000FF", "FFFF00", "FF00FF", "00FFFF", "000000",
"800000", "008000", "000080", "808000", "800080", "008080", "808080",
"C00000", "00C000", "0000C0", "C0C000", "C000C0", "00C0C0", "C0C0C0",
"400000", "004000", "000040", "404000", "400040", "004040", "404040",