Ejemplo n.º 1
0
        protected virtual void CreateScale()
        {
            HSLColourStructure colour;

            colour = new HSLColourStructure(this.Colour);

            colour.S     = 0;
            this.Colour1 = colour.ToRgbColour();

            colour.S     = 1;
            this.Colour2 = colour.ToRgbColour();
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Raises the <see cref="HSLColourChanged" /> event.
        /// </summary>
        /// <param name="e">The <see cref="EventArgs" /> instance containing the event data.</param>
        protected virtual void OnHSLColourChanged(EventArgs e)
        {
            EventHandler handler;

            if (!_lockUpdates)
            {
                this.Colour = _hslColour.ToRgbColour();
            }

            this.Invalidate();

            handler = (EventHandler)this.Events[_eventHslColourChanged];

            handler?.Invoke(this, e);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Raises the <see cref="ColourSlider.ValueChanged" /> event.
        /// </summary>
        /// <param name="e">The <see cref="EventArgs" /> instance containing the event data.</param>
        protected override void OnValueChanged(EventArgs e)
        {
            if (!this.LockUpdates)
            {
                HSLColourStructure colour;

                this.LockUpdates = true;
                colour           = new HSLColourStructure(this.Colour);
                colour.L         = this.Value / 100D;
                _colour          = colour.ToRgbColour();
                this.OnColourChanged(e);
                this.LockUpdates = false;
            }

            base.OnValueChanged(e);
        }