internal static bool TryParseHexColor(string Expression, out Color24 Color) {
if (Expression.StartsWith("#")) {
string a = Expression.Substring(1).TrimStart();
int x; if (int.TryParse(a, NumberStyles.HexNumber, CultureInfo.InvariantCulture, out x)) {
int r = (x >> 16) & 0xFF;
int g = (x >> 8) & 0xFF;
int b = x & 0xFF;
if (r >= 0 & r <= 255 & g >= 0 & g <= 255 & b >= 0 & b <= 255) {
Color = new Color24((byte)r, (byte)g, (byte)b);
return true;
} else {
Color = new Color24(0, 0, 255);
return false;
}
} else {
Color = new Color24(0, 0, 255);
return false;
}
} else {
Color = new Color24(0, 0, 255);
return false;
}
}