return new Color (components);
}
- public static object Parse(string s)
+ public static Color Parse(string s)
=> string.IsNullOrEmpty (s) ? new Color (Colors.White) :
s[0] == '#' ? new Color (UInt32.Parse (s.AsSpan().Slice (1), System.Globalization.NumberStyles.HexNumber)) :
char.IsDigit(s[0]) ? FromIml (s) :
/// <param name="ctx">backend context</param>
/// <param name="bounds">paint operation bounding box, unused for SolidColor</param>
public abstract void SetAsSource (Interface iFace, Context ctx, Rectangle bounds = default(Rectangle));
- public static object Parse (string s){
+ public static Fill Parse (string s){
ReadOnlySpan<char> tmp = s.AsSpan ();
if (tmp.Length == 0)
return null;
if (tmp.Length > 8 && tmp.Slice (1, 8).SequenceEqual ("gradient"))
- return Gradient.Parse (s);
+ return (Fill)Gradient.Parse (s);
if (tmp.EndsWith (".svg", StringComparison.OrdinalIgnoreCase) ||
tmp.EndsWith (".png", StringComparison.OrdinalIgnoreCase) ||
tmp.EndsWith (".jpg", StringComparison.OrdinalIgnoreCase) ||
public static implicit operator string(Picture _pic) => _pic == null ? null : _pic.Path;
#endregion
- public static new object Parse(string path)
+ public static new Picture Parse(string path)
{
if (string.IsNullOrEmpty (path))
return null;
public override string ToString () =>
_style == FontStyle.Normal ? $"{_name},{_size}" : $"{_name} {_style},{_size}";
- public static object Parse(string s)
+ public static Font Parse(string s)
{
Font f = new Font ();
ReadOnlySpan<char> tmp = s.AsSpan ().Trim ();