ColorFromHSB() public static method

public static ColorFromHSB ( double H, double S, double B ) : Color
H double
S double
B double
return Color
        protected override void OnRender(DrawingContext dc)
        {
            LinearGradientBrush h = new LinearGradientBrush();

            h.StartPoint = new Point(0, 0);
            h.EndPoint   = new Point(1, 0);
            h.GradientStops.Add(new GradientStop(Colors.White, 0.00));
            h.GradientStops.Add(new GradientStop(ColorHelper.ColorFromHSB(Hue, 1, 1), 1.0));
            dc.DrawRectangle(h, null, new Rect(0, 0, ActualWidth, ActualHeight));

            LinearGradientBrush v = new LinearGradientBrush();

            v.StartPoint = new Point(0, 0);
            v.EndPoint   = new Point(0, 1);
            v.GradientStops.Add(new GradientStop(Color.FromArgb(0xFF, 0, 0, 0), 1.00));
            v.GradientStops.Add(new GradientStop(Color.FromArgb(0x80, 0, 0, 0), 0.50));
            v.GradientStops.Add(new GradientStop(Color.FromArgb(0x00, 0, 0, 0), 0.00));
            dc.DrawRectangle(v, null, new Rect(0, 0, ActualWidth, ActualHeight));

            SetSaturationOffset();
            SetBrightnessOffset();
        }
 public void SetColor()
 {
     Color = ColorHelper.ColorFromHSB(Hue, Saturation, Brightness);
     //Brush = new SolidColorBrush(Color);
 }
Esempio n. 3
0
 private void SetColor()
 {
     base.Color = ColorHelper.ColorFromHSB(Hue, 1, 1);
     //base.Brush = new SolidColorBrush(Color);
 }