using Avalonia.Media;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace InABox.Avalonia.Converters;

public class BrushToColorConverter : AbstractConverter<Brush, Color>
{
    public static BrushToColorConverter Instance = new BrushToColorConverter();

    protected override Color Convert(Brush? value, object? parameter = null)
    {
        return value is SolidColorBrush brush ? brush.Color : default;
    }

    protected override Brush? Deconvert(Color value, object? parameter = null)
    {
        return new SolidColorBrush(value);
    }
}
