Beispiel #1
0
 /// <summary>
 /// Constructs an instance of the class using the settings of another
 /// instance.
 /// </summary>
 /// <param name="HlsColor">The instance to clone.</param>
 public HlsColor(HlsColor hls)
 {
     this.red        = hls.red;
     this.blue       = hls.blue;
     this.green      = hls.green;
     this.luminance  = hls.luminance;
     this.hue        = hls.hue;
     this.saturation = hls.saturation;
 }
Beispiel #2
0
        public static Brush CreateLinearBrushFromSolidColor(Color color, double angle)
        {
            var lighter = new HlsColor(color);

            lighter.Lighten(0.33f);

            var darker = new HlsColor(color);

            darker.Darken(0.33f);

            return(new LinearGradientBrush(darker.Color, lighter.Color, angle));
        }