category management

This commit is contained in:
2022-03-07 17:34:09 +08:00
parent 49e4e46cdb
commit 46464e19dc
131 changed files with 3992 additions and 189 deletions

View File

@@ -1,4 +1,5 @@
using System;
using System.Globalization;
using Xamarin.Essentials;
namespace Billing
@@ -53,5 +54,24 @@ namespace Billing
}
}
}
public const string DEFAULT_COLOR = "#183153";
public static string WrapColorString(string color)
{
if (color == null)
{
return DEFAULT_COLOR;
}
if (color.Length > 7)
{
var alpha = color[1..3];
if (int.TryParse(alpha, NumberStyles.HexNumber, CultureInfo.InvariantCulture, out int a) && a == 255)
{
return "#" + color[3..];
}
}
return color;
}
}
}