public void SetLightness(double lightness) { m_selectedColor.Lightness = lightness; Invalidate(UIColorUtil.Rect(ColorSelectorRectangle)); SelectedColorChanged?.Invoke(this, null); Refresh();//Invalidate(UIColorUtil.Rect(ColorSelectorRectangle)); }
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)); } }