public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
// parameter should be the brightness factor in double.
var factor = System.Convert.ToDouble(parameter, CultureInfo.InvariantCulture);
var brush = (SolidColorBrush)value;
var newColor = new System.Windows.Media.Color() { A = brush.Color.A, B = System.Convert.ToByte(brush.Color.B * factor, CultureInfo.InvariantCulture), G = System.Convert.ToByte(brush.Color.G * factor, CultureInfo.InvariantCulture), R = System.Convert.ToByte(brush.Color.R * factor, CultureInfo.InvariantCulture) };
return new SolidColorBrush(newColor);
}