in my addon, i want to change the text color based on the current overall color schema.
i know this , NinjaTrader.Core.Globals.GeneralOptions.Skin
but its not what i want :
i have bellow . but i dont know which Resource to search for ...
private SolidColorBrush windowBackgroundBrush ,textColor, backgroundColor;
windowBackgroundBrush = System.Windows.Application.Current.TryFindResource("???????????? ") as SolidColorBrush ?? new SolidColorBrush(Brushes.Purple.Color);
//Calculate the luminance of the background color
double luminance = (0.2126 * windowBackgroundBrush.Color.R + 0.7152 * windowBackgroundBrush.Color.G + 0.0722 * windowBackgroundBrush.Color.B) / 255.0;
// Determine the text color based on the luminance
textColor = luminance < 0.5 ? Brushes.White :Brushes.Black ;
backgroundColor = luminance < 0.5 ? Brushes.Black :Brushes.White;

Comment