using System.Globalization; using System.Windows.Data; using System.Windows.Media; namespace ytLive.Helpers; /// TASK 22: the audio-sync status dot — green when the sync offset is a /// no-op (0 ms), amber once the creator has dialled in a delay. public class IntToSyncBrushConverter : IValueConverter { private static readonly Brush Ok = new SolidColorBrush(Color.FromRgb(0x34, 0xd3, 0x99)); private static readonly Brush Set = new SolidColorBrush(Color.FromRgb(0xf5, 0xb8, 0x4c)); public object Convert(object value, Type targetType, object parameter, CultureInfo culture) => value is int i && i == 0 ? Ok : Set; public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) => throw new NotSupportedException(); }