Exemple #1
0
 public void SetLightness(double lightness)
 {
     m_selectedColor.Lightness = lightness;
     Invalidate(UIColorUtil.Rect(ColorSelectorRectangle));
     SelectedColorChanged?.Invoke(this, null);
     Refresh();//Invalidate(UIColorUtil.Rect(ColorSelectorRectangle));
 }
Exemple #2
0
        protected override void OnPaint(PaintEventArgs e)
        {
            base.OnPaint(e);
            DrawColorBar(e.Graphics);

            if (Focused)
            {
                RectangleF lr = ClientRectangleF;
                lr.Inflate(-2, -2);
                ControlPaint.DrawFocusRectangle(e.Graphics, UIColorUtil.Rect(lr));
            }
        }
Exemple #3
0
        protected void DrawColorBar(Graphics dc)
        {
            RectangleF lr = BarRectangle;

            if (m_numberOfColors == eNumberOfColors.Use2Colors)
            {
                UIColorUtil.Draw2ColorBar(dc, lr, Orientation, m_color1, m_color2);
            }
            else
            {
                UIColorUtil.Draw3ColorBar(dc, lr, Orientation, m_color1, m_color2, m_color3);
            }
            DrawSelector(dc, lr, Orientation, (float)Percent);
        }