Пример #1
0
 /// <summary>
 /// returns a <see cref="SolidColorBrush"/> of the given <see cref="SolidColorBrush"/> with chosen opacity
 /// </summary>
 /// <param name="brush"></param>
 /// <param name="strength">opacity weight from 0.0 to 1.0 and is set to 0.75 if no value is provided</param>
 /// <returns>a given <see cref="SolidColorBrush"/> with chosen opacity</returns>
 public static SolidColorBrush OfStrength(this SolidColorBrush brush, double strength = 0.75d)
 {
     if (strength < 0d || strength > 1.0d)
     {
         throw new ArgumentOutOfRangeException(nameof(strength), @"strength must be a value between 0.0 and 1.0");
     }
     return(brush.OfStrength((byte)(strength * 255)));
 }