ARCed.Core.ColorWheel.ColorWheel C# (CSharp) Method

ColorWheel() public method

Default constructor
public ColorWheel ( Rectangle colorRectangle, Rectangle brightnessRectangle, Rectangle selectedColorRectangle ) : System
colorRectangle System.Drawing.Rectangle Rectangle for the color wheel image
brightnessRectangle System.Drawing.Rectangle Rectangle for the brightness control
selectedColorRectangle System.Drawing.Rectangle Rectangle for the selected color control
return System
        public ColorWheel(Rectangle colorRectangle, Rectangle brightnessRectangle, Rectangle selectedColorRectangle)
        {
            using (var path = new GraphicsPath())
            {
                this._colorRectangle = colorRectangle;
                this._brightnessRectangle = brightnessRectangle;
                this._selectedColorRectangle = selectedColorRectangle;
                this._radius = Math.Min(colorRectangle.Width, colorRectangle.Height) / 2;
                this._centerPoint = colorRectangle.Location;
                this._centerPoint.Offset(this._radius, this._radius);
                this._colorPoint = this._centerPoint;
                path.AddEllipse(colorRectangle);
                this._colorRegion = new Region(path);
                this._brightnessMin = this._brightnessRectangle.Top;
                this._brightnessMax = this._brightnessRectangle.Bottom;
                path.AddRectangle(new Rectangle(brightnessRectangle.Left, brightnessRectangle.Top - 10,
                    brightnessRectangle.Width + 10, brightnessRectangle.Height + 20));
                this._brightnessRegion = new Region(path);
                this._brightnessX = brightnessRectangle.Left + brightnessRectangle.Width;
                this._brightnessScaling = (double)255 / (this._brightnessMax - this._brightnessMin);
                this._brightnessPoint = new Point(this._brightnessX, this._brightnessMax);
                this.CreateGradient();
            }
        }