using System;
using System.Globalization;
using System.Windows.Data;
using System.Windows.Media;

namespace AxCopilot.Themes;

public class HexToColorConverter : IValueConverter
{
	public static readonly HexToColorConverter Instance = new HexToColorConverter();

	public object Convert(object value, Type t, object p, CultureInfo c)
	{
		if (value is string value2)
		{
			try
			{
				return (Color)ColorConverter.ConvertFromString(value2);
			}
			catch
			{
			}
		}
		return Colors.Transparent;
	}

	public object ConvertBack(object v, Type t, object p, CultureInfo c)
	{
		throw new NotImplementedException();
	}
}
