From 809f6166dcdcb3abbc276b874fa1b62a69e514f0 Mon Sep 17 00:00:00 2001 From: miku-666 <74728189+NessieHax@users.noreply.github.com> Date: Sun, 16 Apr 2023 19:59:39 +0200 Subject: [PATCH] Updated CBH Theme repo link and removed MechanikaDesign from Vendors --- .gitmodules | 6 +- PCK-Studio/Forms/Editor/COLEditor.Designer.cs | 12 +- PCK-Studio/PckStudio.csproj | 12 +- PCK_Studio.sln | 61 +- Vendor/CrEaTiiOn-Brotherhood-Official-C-Theme | 1 - .../CrEaTiiOn-Brotherhood-Theme-Library-Net | 1 + .../ColorBox2D/ColorChangedEventArgs.cs | 39 - .../MechanikaDesign/ColorBox2D/ColorModes.cs | 19 - .../ColorBox2D/ColorPicker.csproj | 88 -- .../Controls/ColorBox2D.Designer.cs | 37 - .../ColorBox2D/Controls/ColorBox2D.cs | 309 ------ .../Controls/ColorHexagon.Designer.cs | 36 - .../ColorBox2D/Controls/ColorHexagon.cs | 402 -------- .../Controls/ColorSliderVertical.Designer.cs | 45 - .../Controls/ColorSliderVertical.cs | 325 ------- .../Controls/ColorSliderVertical.resx | 120 --- .../ColorBox2D/Controls/ColorWheel.cs | 884 ------------------ Vendor/MechanikaDesign/ColorBox2D/HslColor.cs | 353 ------- .../ColorBox2D/MathExtensions.cs | 25 - .../ColorBox2D/Properties/AssemblyInfo.cs | 36 - .../ColorHexagon/ColorHexagon.csproj | 63 -- .../ColorHexagon/Properties/AssemblyInfo.cs | 36 - .../ColorPicker.Demo/App.config | 6 - .../ColorPicker.Demo/ColorPicker.Demo.csproj | 99 -- .../FormColorPickerDemo.Designer.cs | 412 -------- .../ColorPicker.Demo/FormColorPickerDemo.cs | 196 ---- .../ColorPicker.Demo/FormColorPickerDemo.resx | 120 --- .../ColorPicker.Demo/Program.cs | 22 - .../Properties/AssemblyInfo.cs | 36 - .../Properties/Resources.Designer.cs | 63 -- .../Properties/Resources.resx | 117 --- .../Properties/Settings.Designer.cs | 26 - .../Properties/Settings.settings | 7 - .../MechanikaDesign/ColorPickerControls.sln | 28 - .../MechanikaDesign/ColorWheel/ColorHelper.cs | 122 --- .../MechanikaDesign/ColorWheel/ColorWheel.cs | 884 ------------------ .../ColorWheel/ColorWheel.csproj | 60 -- Vendor/MechanikaDesign/ColorWheel/HslColor.cs | 231 ----- .../ColorWheel/Properties/AssemblyInfo.cs | 36 - 39 files changed, 33 insertions(+), 5342 deletions(-) delete mode 160000 Vendor/CrEaTiiOn-Brotherhood-Official-C-Theme create mode 160000 Vendor/CrEaTiiOn-Brotherhood-Theme-Library-Net delete mode 100644 Vendor/MechanikaDesign/ColorBox2D/ColorChangedEventArgs.cs delete mode 100644 Vendor/MechanikaDesign/ColorBox2D/ColorModes.cs delete mode 100644 Vendor/MechanikaDesign/ColorBox2D/ColorPicker.csproj delete mode 100644 Vendor/MechanikaDesign/ColorBox2D/Controls/ColorBox2D.Designer.cs delete mode 100644 Vendor/MechanikaDesign/ColorBox2D/Controls/ColorBox2D.cs delete mode 100644 Vendor/MechanikaDesign/ColorBox2D/Controls/ColorHexagon.Designer.cs delete mode 100644 Vendor/MechanikaDesign/ColorBox2D/Controls/ColorHexagon.cs delete mode 100644 Vendor/MechanikaDesign/ColorBox2D/Controls/ColorSliderVertical.Designer.cs delete mode 100644 Vendor/MechanikaDesign/ColorBox2D/Controls/ColorSliderVertical.cs delete mode 100644 Vendor/MechanikaDesign/ColorBox2D/Controls/ColorSliderVertical.resx delete mode 100644 Vendor/MechanikaDesign/ColorBox2D/Controls/ColorWheel.cs delete mode 100644 Vendor/MechanikaDesign/ColorBox2D/HslColor.cs delete mode 100644 Vendor/MechanikaDesign/ColorBox2D/MathExtensions.cs delete mode 100644 Vendor/MechanikaDesign/ColorBox2D/Properties/AssemblyInfo.cs delete mode 100644 Vendor/MechanikaDesign/ColorHexagon/ColorHexagon.csproj delete mode 100644 Vendor/MechanikaDesign/ColorHexagon/Properties/AssemblyInfo.cs delete mode 100644 Vendor/MechanikaDesign/ColorPicker.Demo/App.config delete mode 100644 Vendor/MechanikaDesign/ColorPicker.Demo/ColorPicker.Demo.csproj delete mode 100644 Vendor/MechanikaDesign/ColorPicker.Demo/FormColorPickerDemo.Designer.cs delete mode 100644 Vendor/MechanikaDesign/ColorPicker.Demo/FormColorPickerDemo.cs delete mode 100644 Vendor/MechanikaDesign/ColorPicker.Demo/FormColorPickerDemo.resx delete mode 100644 Vendor/MechanikaDesign/ColorPicker.Demo/Program.cs delete mode 100644 Vendor/MechanikaDesign/ColorPicker.Demo/Properties/AssemblyInfo.cs delete mode 100644 Vendor/MechanikaDesign/ColorPicker.Demo/Properties/Resources.Designer.cs delete mode 100644 Vendor/MechanikaDesign/ColorPicker.Demo/Properties/Resources.resx delete mode 100644 Vendor/MechanikaDesign/ColorPicker.Demo/Properties/Settings.Designer.cs delete mode 100644 Vendor/MechanikaDesign/ColorPicker.Demo/Properties/Settings.settings delete mode 100644 Vendor/MechanikaDesign/ColorPickerControls.sln delete mode 100644 Vendor/MechanikaDesign/ColorWheel/ColorHelper.cs delete mode 100644 Vendor/MechanikaDesign/ColorWheel/ColorWheel.cs delete mode 100644 Vendor/MechanikaDesign/ColorWheel/ColorWheel.csproj delete mode 100644 Vendor/MechanikaDesign/ColorWheel/HslColor.cs delete mode 100644 Vendor/MechanikaDesign/ColorWheel/Properties/AssemblyInfo.cs diff --git a/.gitmodules b/.gitmodules index 33053ccd..34a02b34 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,6 +1,6 @@ [submodule "OMI-Lib"] path = Vendor/OMI-Lib url = https://github.com/PhoenixARC/-OMI-Filetype-Library.git -[submodule "Vendor/CrEaTiiOn-Brotherhood-Official-C-Theme"] - path = Vendor/CrEaTiiOn-Brotherhood-Official-C-Theme - url = https://github.com/NessieHax/CrEaTiiOn-Brotherhood-Official-C-Theme.git +[submodule "CrEaTiiOn-Brotherhood-Theme-Library"] + path = Vendor/CrEaTiiOn-Brotherhood-Theme-Library-Net + url = https://github.com/EternalModz/CrEaTiiOn-Brotherhood-Theme-Library-NET.git diff --git a/PCK-Studio/Forms/Editor/COLEditor.Designer.cs b/PCK-Studio/Forms/Editor/COLEditor.Designer.cs index 8723c4db..b447bef8 100644 --- a/PCK-Studio/Forms/Editor/COLEditor.Designer.cs +++ b/PCK-Studio/Forms/Editor/COLEditor.Designer.cs @@ -73,8 +73,8 @@ namespace PckStudio.Forms.Editor this.fogTab = new System.Windows.Forms.TabPage(); this.panel1 = new System.Windows.Forms.Panel(); this.SetColorButton = new CBH.Ultimate.Controls.CrEaTiiOn_Ultimate_GradientButton(); - this.colorSliderVertical1 = new MechanikaDesign.WinForms.UI.ColorPicker.ColorSliderVertical(); - this.colorBox2D1 = new MechanikaDesign.WinForms.UI.ColorPicker.ColorBox2D(); + this.colorSliderVertical1 = new CBH.Controls.CrEaTiiOn_ColorSliderVertical(); + this.colorBox2D1 = new CBH.Controls.CrEaTiiOn_ColorBox2D(); this.blueUpDown = new System.Windows.Forms.NumericUpDown(); this.greenUpDown = new System.Windows.Forms.NumericUpDown(); this.redUpDown = new System.Windows.Forms.NumericUpDown(); @@ -473,7 +473,7 @@ namespace PckStudio.Forms.Editor // colorSliderVertical1 // this.colorSliderVertical1.BackColor = System.Drawing.Color.Transparent; - this.colorSliderVertical1.ColorMode = MechanikaDesign.WinForms.UI.ColorPicker.ColorModes.Hue; + this.colorSliderVertical1.ColorMode = CBH.Controls.ColorModes.Hue; this.colorSliderVertical1.ColorRGB = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); resources.ApplyResources(this.colorSliderVertical1, "colorSliderVertical1"); this.colorSliderVertical1.Name = "colorSliderVertical1"; @@ -482,7 +482,7 @@ namespace PckStudio.Forms.Editor // // colorBox2D1 // - this.colorBox2D1.ColorMode = MechanikaDesign.WinForms.UI.ColorPicker.ColorModes.Hue; + this.colorBox2D1.ColorMode = CBH.Controls.ColorModes.Hue; this.colorBox2D1.ColorRGB = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); resources.ApplyResources(this.colorBox2D1, "colorBox2D1"); this.colorBox2D1.Name = "colorBox2D1"; @@ -697,8 +697,8 @@ namespace PckStudio.Forms.Editor private ToolStripMenuItem copyColorToolStripMenuItem; private ToolStripMenuItem pasteColorToolStripMenuItem; private Panel panel1; - private MechanikaDesign.WinForms.UI.ColorPicker.ColorSliderVertical colorSliderVertical1; - private MechanikaDesign.WinForms.UI.ColorPicker.ColorBox2D colorBox2D1; + private CBH.Controls.CrEaTiiOn_ColorSliderVertical colorSliderVertical1; + private CBH.Controls.CrEaTiiOn_ColorBox2D colorBox2D1; private NumericUpDown blueUpDown; private NumericUpDown greenUpDown; private NumericUpDown redUpDown; diff --git a/PCK-Studio/PckStudio.csproj b/PCK-Studio/PckStudio.csproj index 7626d282..d71679a8 100644 --- a/PCK-Studio/PckStudio.csproj +++ b/PCK-Studio/PckStudio.csproj @@ -781,21 +781,15 @@ - - {38f99682-d013-4ae3-8334-4bf492a11ff9} - ColorPicker + + {4f287251-7f2a-4b47-9102-4a1aabd41f20} + CBH-WinForm-Theme-NET- {693AEBC1-293D-4DF0-BCAE-26A1099FE7BB} OMI Filetype Library - - - {c3d7b16c-c047-4baa-884f-7a2308619c33} - Net Framework v4.8 - - - \ No newline at end of file diff --git a/Vendor/MechanikaDesign/ColorBox2D/Controls/ColorBox2D.Designer.cs b/Vendor/MechanikaDesign/ColorBox2D/Controls/ColorBox2D.Designer.cs deleted file mode 100644 index 63eb01b5..00000000 --- a/Vendor/MechanikaDesign/ColorBox2D/Controls/ColorBox2D.Designer.cs +++ /dev/null @@ -1,37 +0,0 @@ -namespace MechanikaDesign.WinForms.UI.ColorPicker -{ - partial class ColorBox2D - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Component Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - components = new System.ComponentModel.Container(); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - } - - #endregion - } -} diff --git a/Vendor/MechanikaDesign/ColorBox2D/Controls/ColorBox2D.cs b/Vendor/MechanikaDesign/ColorBox2D/Controls/ColorBox2D.cs deleted file mode 100644 index d01222e5..00000000 --- a/Vendor/MechanikaDesign/ColorBox2D/Controls/ColorBox2D.cs +++ /dev/null @@ -1,309 +0,0 @@ -using System; -using System.ComponentModel; -using System.Drawing; -using System.Drawing.Drawing2D; -using System.Windows.Forms; - -namespace MechanikaDesign.WinForms.UI.ColorPicker -{ - [DefaultEvent("ColorChanged")] - public partial class ColorBox2D: UserControl - { - - #region Events - public delegate void ColorChangedEventHandler(object sender, ColorChangedEventArgs args); - public event ColorChangedEventHandler ColorChanged; - - #endregion - - #region Fields - - private HslColor colorHSL; - private ColorModes colorMode; - private Color colorRGB = Color.Empty; - private Point markerPoint = Point.Empty; - private bool mouseMoving; - - #endregion - - #region Properties - public ColorModes ColorMode - { - get { return this.colorMode; } - set - { - this.colorMode = value; - this.ResetMarker(); - this.Refresh(); - } - } - - public HslColor ColorHSL - { - get { return this.colorHSL; } - set - { - this.colorHSL = value; - this.colorRGB = this.colorHSL.RgbValue; - this.ResetMarker(); - this.Refresh(); - } - } - - public Color ColorRGB - { - get { return this.colorRGB; } - set - { - this.colorRGB = value; - this.colorHSL = HslColor.FromColor(this.colorRGB); - this.ResetMarker(); - this.Refresh(); - } - } - - #endregion - - #region Constructors - - public ColorBox2D() - { - InitializeComponent(); - base.SetStyle(ControlStyles.OptimizedDoubleBuffer | ControlStyles.AllPaintingInWmPaint, true); - - this.colorHSL = HslColor.FromAhsl(1.0, 1.0, 1.0); - this.colorRGB = this.colorHSL.RgbValue; - this.colorMode = ColorModes.Hue; - } - - #endregion - - #region Overriden Methods - - protected override void OnMouseDown(MouseEventArgs e) - { - base.OnMouseDown(e); - this.mouseMoving = true; - this.SetMarker(e.X, e.Y); - } - - protected override void OnMouseMove(MouseEventArgs e) - { - base.OnMouseMove(e); - if (this.mouseMoving) - { - this.SetMarker(e.X, e.Y); - } - } - - protected override void OnMouseUp(MouseEventArgs e) - { - base.OnMouseUp(e); - this.mouseMoving = false; - } - - protected override void OnPaint(PaintEventArgs e) - { - base.OnPaint(e); - HslColor color = HslColor.FromAhsl(0xff); - HslColor color2 = HslColor.FromAhsl(0xff); - switch (this.ColorMode) - { - case ColorModes.Hue: - color.H = this.ColorHSL.H; - color2.H = this.ColorHSL.H; - color.S = 0.0; - color2.S = 1.0; - break; - - case ColorModes.Saturation: - color.S = this.ColorHSL.S; - color2.S = this.ColorHSL.S; - color.L = 1.0; - color2.L = 0.0; - break; - - case ColorModes.Luminance: - color.L = this.ColorHSL.L; - color2.L = this.ColorHSL.L; - color.S = 1.0; - color2.S = 0.0; - break; - } - for (int i = 0; i < (base.Height - 4); i++) - { - int green = MathExtensions.Round(255.0 - ((255.0 * i) / ((double)(base.Height - 4)))); - Color empty = Color.Empty; - Color rgbValue = Color.Empty; - switch (this.ColorMode) - { - case ColorModes.Red: - empty = Color.FromArgb(this.ColorRGB.R, green, 0); - rgbValue = Color.FromArgb(this.ColorRGB.R, green, 0xff); - break; - - case ColorModes.Green: - empty = Color.FromArgb(green, this.ColorRGB.G, 0); - rgbValue = Color.FromArgb(green, this.ColorRGB.G, 0xff); - break; - - case ColorModes.Blue: - empty = Color.FromArgb(0, green, this.ColorRGB.B); - rgbValue = Color.FromArgb(0xff, green, this.ColorRGB.B); - break; - - case ColorModes.Hue: - color2.L = color.L = 1.0 - (((double)i) / ((double)(base.Height - 4))); - empty = color.RgbValue; - rgbValue = color2.RgbValue; - break; - - case ColorModes.Saturation: - case ColorModes.Luminance: - color2.H = color.H = ((double)i) / ((double)(base.Width - 4)); - empty = color.RgbValue; - rgbValue = color2.RgbValue; - break; - } - - Rectangle rect = new Rectangle(2, 2, base.Width - 4, 1); - Rectangle rectangle2 = new Rectangle(2, i + 2, base.Width - 4, 1); - if ((this.ColorMode == ColorModes.Saturation) || (this.ColorMode == ColorModes.Luminance)) - { - rect = new Rectangle(2, 2, 1, base.Height - 4); - rectangle2 = new Rectangle(i + 2, 2, 1, base.Height - 4); - using (LinearGradientBrush brush = new LinearGradientBrush(rect, empty, rgbValue, 90f, false)) - { - e.Graphics.FillRectangle(brush, rectangle2); - continue; - } - } - using (LinearGradientBrush brush2 = new LinearGradientBrush(rect, empty, rgbValue, 0f, false)) - { - e.Graphics.FillRectangle(brush2, rectangle2); - } - } - Pen white = Pens.White; - if (this.colorHSL.L >= 0.78431372549019607) - { - if ((this.colorHSL.H < 0.072222222222222215) || (this.colorHSL.H > 0.55555555555555558)) - { - if (this.colorHSL.S <= 0.27450980392156865) - { - white = Pens.Black; - } - } - else - { - white = Pens.Black; - } - } - e.Graphics.DrawEllipse(white, this.markerPoint.X - 5, this.markerPoint.Y - 5, 10, 10); - } - - - #endregion - - #region Private Methods - - private HslColor GetColor(int x, int y) - { - int num; - int num2; - int num3; - HslColor color = HslColor.FromAhsl(0xff); - switch (this.ColorMode) - { - case ColorModes.Red: - num2 = MathExtensions.Round(255.0 * (1.0 - (((double)y) / ((double)(base.Height - 4))))); - num3 = MathExtensions.Round((255.0 * x) / ((double)(base.Width - 4))); - return HslColor.FromColor(Color.FromArgb(this.colorRGB.R, num2, num3)); - - case ColorModes.Green: - num = MathExtensions.Round(255.0 * (1.0 - (((double)y) / ((double)(base.Height - 4))))); - num3 = MathExtensions.Round((255.0 * x) / ((double)(base.Width - 4))); - return HslColor.FromColor(Color.FromArgb(num, this.colorRGB.G, num3)); - - case ColorModes.Blue: - num = MathExtensions.Round((255.0 * x) / ((double)(base.Width - 4))); - num2 = MathExtensions.Round(255.0 * (1.0 - (((double)y) / ((double)(base.Height - 4))))); - return HslColor.FromColor(Color.FromArgb(num, num2, this.colorRGB.B)); - - case ColorModes.Hue: - color.H = this.colorHSL.H; - color.S = ((double)x) / ((double)(base.Width - 4)); - color.L = 1.0 - (((double)y) / ((double)(base.Height - 4))); - return color; - - case ColorModes.Saturation: - color.S = this.colorHSL.S; - color.H = ((double)x) / ((double)(base.Width - 4)); - color.L = 1.0 - (((double)y) / ((double)(base.Height - 4))); - return color; - - case ColorModes.Luminance: - color.L = this.colorHSL.L; - color.H = ((double)x) / ((double)(base.Width - 4)); - color.S = 1.0 - (((double)y) / ((double)(base.Height - 4))); - return color; - } - return color; - } - - private void ResetMarker() - { - switch (this.colorMode) - { - case ColorModes.Red: - this.markerPoint.X = MathExtensions.Round(((base.Width - 4) * this.colorRGB.B) / 255.0); - this.markerPoint.Y = MathExtensions.Round((base.Height - 4) * (1.0 - (((double)this.colorRGB.G) / 255.0))); - return; - - case ColorModes.Green: - this.markerPoint.X = MathExtensions.Round(((base.Width - 4) * this.colorRGB.B) / 255.0); - this.markerPoint.Y = MathExtensions.Round((base.Height - 4) * (1.0 - (((double)this.colorRGB.R) / 255.0))); - return; - - case ColorModes.Blue: - this.markerPoint.X = MathExtensions.Round(((base.Width - 4) * this.colorRGB.R) / 255.0); - this.markerPoint.Y = MathExtensions.Round((base.Height - 4) * (1.0 - (((double)this.colorRGB.G) / 255.0))); - return; - - case ColorModes.Hue: - this.markerPoint.X = MathExtensions.Round((base.Width - 4) * this.colorHSL.S); - this.markerPoint.Y = MathExtensions.Round((base.Height - 4) * (1.0 - this.colorHSL.L)); - return; - - case ColorModes.Saturation: - this.markerPoint.X = MathExtensions.Round((base.Width - 4) * this.colorHSL.H); - this.markerPoint.Y = MathExtensions.Round((base.Height - 4) * (1.0 - this.colorHSL.L)); - return; - - case ColorModes.Luminance: - this.markerPoint.X = MathExtensions.Round((base.Width - 4) * this.colorHSL.H); - this.markerPoint.Y = MathExtensions.Round((base.Height - 4) * (1.0 - this.colorHSL.S)); - return; - } - } - - private void SetMarker(int x, int y) - { - x = MathExtensions.LimitToRange(x, 0, base.Width - 4); - y = MathExtensions.LimitToRange(y, 0, base.Height - 4); - if ((this.markerPoint.X != x) || (this.markerPoint.Y != y)) - { - this.markerPoint = new Point(x, y); - this.colorHSL = this.GetColor(x, y); - this.colorRGB = this.colorHSL.RgbValue; - this.Refresh(); - if (this.ColorChanged != null) - { - this.ColorChanged(this, new ColorChangedEventArgs(this.colorRGB)); - } - } - } - - #endregion - - } -} diff --git a/Vendor/MechanikaDesign/ColorBox2D/Controls/ColorHexagon.Designer.cs b/Vendor/MechanikaDesign/ColorBox2D/Controls/ColorHexagon.Designer.cs deleted file mode 100644 index defc1b84..00000000 --- a/Vendor/MechanikaDesign/ColorBox2D/Controls/ColorHexagon.Designer.cs +++ /dev/null @@ -1,36 +0,0 @@ -namespace MechanikaDesign.WinForms.UI.ColorPicker -{ - partial class ColorHexagon - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Component Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - components = new System.ComponentModel.Container(); - } - - #endregion - } -} diff --git a/Vendor/MechanikaDesign/ColorBox2D/Controls/ColorHexagon.cs b/Vendor/MechanikaDesign/ColorBox2D/Controls/ColorHexagon.cs deleted file mode 100644 index 6e7def33..00000000 --- a/Vendor/MechanikaDesign/ColorBox2D/Controls/ColorHexagon.cs +++ /dev/null @@ -1,402 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Drawing; -using System.Drawing.Drawing2D; -using System.Threading; -using System.Windows.Forms; - -namespace MechanikaDesign.WinForms.UI.ColorPicker -{ - [DefaultEvent("ColorChanged")] - public partial class ColorHexagon: UserControl - { - # region Fields - private const float COEFFCIENT = 0.824f; - private ColorHexagonElement[] hexagonElements = new ColorHexagonElement[0x93]; - private float[] matrix1 = new float[] { -0.5f, -1f, -0.5f, 0.5f, 1f, 0.5f }; - private float[] matrix2 = new float[] { 0.824f, 0f, -0.824f, -0.824f, 0f, 0.824f }; - private int oldSelectedHexagonIndex = -1; - private int sectorMaximum = 7; - private int selectedHexagonIndex = -1; - #endregion - - #region Events - public delegate void ColorChangedEventHandler(object sender, ColorChangedEventArgs args); - public event ColorChangedEventHandler ColorChanged; - - #endregion - - #region Properties - public Color SelectedColor - { - get - { - if (this.selectedHexagonIndex < 0) - { - return Color.Empty; - } - return this.hexagonElements[this.selectedHexagonIndex].CurrentColor; - } - } - #endregion - - #region Constructors - public ColorHexagon() - { - base.SetStyle(ControlStyles.AllPaintingInWmPaint, true); - base.SetStyle(ControlStyles.UserPaint, true); - base.SetStyle(ControlStyles.Opaque, true); - base.SetStyle(ControlStyles.OptimizedDoubleBuffer, true); - base.SetStyle(ControlStyles.ResizeRedraw, true); - base.SetStyle(ControlStyles.SupportsTransparentBackColor, true); - for (int i = 0; i < this.hexagonElements.Length; i++) - { - this.hexagonElements[i] = new ColorHexagonElement(); - } - - InitializeComponent(); - } - #endregion - - #region Methods/Functions - private void DrawHexagonHighlighter(int selectedHexagonIndex) - { - if (selectedHexagonIndex != this.oldSelectedHexagonIndex) - { - if (this.oldSelectedHexagonIndex >= 0) - { - this.hexagonElements[this.oldSelectedHexagonIndex].IsHovered = false; - base.Invalidate(this.hexagonElements[this.oldSelectedHexagonIndex].BoundingRectangle); - } - this.oldSelectedHexagonIndex = selectedHexagonIndex; - if (this.oldSelectedHexagonIndex >= 0) - { - this.hexagonElements[this.oldSelectedHexagonIndex].IsHovered = true; - base.Invalidate(this.hexagonElements[this.oldSelectedHexagonIndex].BoundingRectangle); - } - } - } - - private int GetHexagonIndexFromCoordinates(int xCoordinate, int yCoordinate) - { - for (int i = 0; i < this.hexagonElements.Length; i++) - { - if (this.hexagonElements[i].BoundingRectangle.Contains(xCoordinate, yCoordinate)) - { - return i; - } - } - return -1; - } - - private int GetHexgaonWidth(int availableHeight) - { - int num = availableHeight / (2 * this.sectorMaximum); - if ((((int) Math.Floor((double) (((double) num) / 2.0))) * 2) < num) - { - num--; - } - return num; - } - - private void InitializeGrayscaleHexagons(ref Rectangle clientRectangle, int hexagonWidth, - ref int centerOfMiddleHexagonX, ref int centerOfMiddleHexagonY, - ref int index) - { - int red = 0xff; - int num4 = 0x11; - int num3 = 0x10; - int num5 = (((clientRectangle.Width - (7 * hexagonWidth)) / 2) + clientRectangle.X) - (hexagonWidth / 3); - - centerOfMiddleHexagonX = num5; - centerOfMiddleHexagonY = clientRectangle.Bottom; - for (int i = 0; i < num3; i++) - { - this.hexagonElements[index].CurrentColor = Color.FromArgb(red, red, red); - this.hexagonElements[index].SetHexagonPoints((float)centerOfMiddleHexagonX, (float)centerOfMiddleHexagonY, hexagonWidth); - centerOfMiddleHexagonX += hexagonWidth; - index++; - if (i == 7) - { - centerOfMiddleHexagonX = num5 + (hexagonWidth / 2); - centerOfMiddleHexagonY += (int)(hexagonWidth * 0.824f); - } - red -= num4; - } - } - - private void InitializeHexagons() - { - Rectangle clientRectangle = base.ClientRectangle; - clientRectangle.Offset(0, -8); - if (clientRectangle.Height < clientRectangle.Width) - { - clientRectangle.Inflate(-(clientRectangle.Width - clientRectangle.Height) / 2, 0); - } - else - { - clientRectangle.Inflate(0, -(clientRectangle.Height - clientRectangle.Width) / 2); - } - - int hexagonWidth = this.GetHexgaonWidth(Math.Min(clientRectangle.Height, clientRectangle.Width)); - int centerOfMiddleHexagonX = (clientRectangle.Left + clientRectangle.Right) / 2; - int centerOfMiddleHexagonY = (clientRectangle.Top + clientRectangle.Bottom) / 2; - - centerOfMiddleHexagonY -= hexagonWidth; - this.hexagonElements[0].CurrentColor = Color.White; - this.hexagonElements[0].SetHexagonPoints((float)centerOfMiddleHexagonX, (float)centerOfMiddleHexagonY, hexagonWidth); - int index = 1; - for (int i = 1; i < this.sectorMaximum; i++) - { - float yCoordinate = centerOfMiddleHexagonY; - float xCoordinate = centerOfMiddleHexagonX + (hexagonWidth * i); - for (int j = 0; j < (this.sectorMaximum - 1); j++) - { - int num9 = (int)(hexagonWidth * this.matrix2[j]); - int num10 = (int)(hexagonWidth * this.matrix1[j]); - for (int k = 0; k < i; k++) - { - double num12 = ((0.936 * (this.sectorMaximum - i)) / ((double)this.sectorMaximum)) + 0.12; - float colorQuotient = GetColorQuotient(xCoordinate - centerOfMiddleHexagonX, yCoordinate - centerOfMiddleHexagonY); - this.hexagonElements[index].SetHexagonPoints(xCoordinate, yCoordinate, hexagonWidth); - this.hexagonElements[index].CurrentColor = ColorFromRGBRatios((double)colorQuotient, num12, 1.0); - yCoordinate += num9; - xCoordinate += num10; - index++; - } - } - } - clientRectangle.Y -= hexagonWidth + (hexagonWidth / 2); - this.InitializeGrayscaleHexagons(ref clientRectangle, hexagonWidth, ref centerOfMiddleHexagonX, ref centerOfMiddleHexagonY, ref index); - } - - #endregion - - #region Overridden Methods - - protected override void OnMouseDown(MouseEventArgs e) - { - if (e.Button == MouseButtons.Left) - { - if (this.selectedHexagonIndex >= 0) - { - this.hexagonElements[this.selectedHexagonIndex].IsSelected = false; - base.Invalidate(this.hexagonElements[this.selectedHexagonIndex].BoundingRectangle); - } - this.selectedHexagonIndex = -1; - if (this.oldSelectedHexagonIndex >= 0) - { - this.selectedHexagonIndex = this.oldSelectedHexagonIndex; - this.hexagonElements[this.selectedHexagonIndex].IsSelected = true; - if (this.ColorChanged != null) - { - this.ColorChanged(this, new ColorChangedEventArgs(this.SelectedColor)); - } - base.Invalidate(this.hexagonElements[this.selectedHexagonIndex].BoundingRectangle); - } - } - base.OnMouseDown(e); - } - - protected override void OnMouseLeave(EventArgs e) - { - base.OnMouseLeave(e); - this.DrawHexagonHighlighter(-1); - } - - protected override void OnMouseMove(MouseEventArgs e) - { - base.OnMouseMove(e); - this.DrawHexagonHighlighter(this.GetHexagonIndexFromCoordinates(e.X, e.Y)); - } - - protected override void OnPaint(PaintEventArgs e) - { - if (this.BackColor == Color.Transparent) - { - base.OnPaintBackground(e); - } - - Graphics g = e.Graphics; - using (SolidBrush brush = new SolidBrush(this.BackColor)) - { - g.FillRectangle(brush, base.ClientRectangle); - } - - g.SmoothingMode = SmoothingMode.AntiAlias; - foreach (ColorHexagonElement element in this.hexagonElements) - { - element.Paint(g); - } - - if (this.oldSelectedHexagonIndex >= 0) - { - this.hexagonElements[this.oldSelectedHexagonIndex].Paint(g); - } - if (this.selectedHexagonIndex >= 0) - { - this.hexagonElements[this.selectedHexagonIndex].Paint(g); - } - base.OnPaint(e); - } - - protected override void OnResize(EventArgs e) - { - this.InitializeHexagons(); - base.OnResize(e); - } - - #endregion - - #region Color Helper Functions - private static float GetColorQuotient(float value1, float value2) - { - return (float)((Math.Atan2((double)value2, (double)value1) * 180.0) / 3.1415926535897931); - } - - private static int GetColorChannelValue(float value1, float value2, float value3) - { - if (value3 > 360f) - { - value3 -= 360f; - } - else if (value3 < 0f) - { - value3 += 360f; - } - if (value3 < 60f) - { - value1 += ((value2 - value1) * value3) / 60f; - } - else if (value3 < 180f) - { - value1 = value2; - } - else if (value3 < 240f) - { - value1 += ((value2 - value1) * (240f - value3)) / 60f; - } - return (int)(value1 * 255f); - } - - private static Color ColorFromRGBRatios(double value1, double value2, double value3) - { - int num; - int num2; - int num3; - if (value3 == 0.0) - { - num = num2 = num3 = (int)(value2 * 255.0); - } - else - { - float num4; - if (value2 <= 0.5) - { - num4 = (float)(value2 + (value2 * value3)); - } - else - { - num4 = (float)((value2 + value3) - (value2 * value3)); - } - float num5 = ((float)(2.0 * value2)) - num4; - num = GetColorChannelValue(num5, num4, (float)(value1 + 120.0)); - num2 = GetColorChannelValue(num5, num4, (float)value1); - num3 = GetColorChannelValue(num5, num4, (float)(value1 - 120.0)); - } - return Color.FromArgb(num, num2, num3); - } - #endregion - - } - - #region HexagaonElement Class - internal class ColorHexagonElement - { - #region Fields - - private Rectangle boundingRect = Rectangle.Empty; - private Color hexagonColor = Color.Empty; - private Point[] hexagonPoints = new Point[6]; - private bool isHovered; - private bool isSelected; - - #endregion - - #region Methods - - public void Paint(Graphics g) - { - GraphicsPath path = new GraphicsPath(); - path.AddPolygon(this.hexagonPoints); - path.CloseAllFigures(); - using (SolidBrush brush = new SolidBrush(this.hexagonColor)) - { - g.FillPath(brush, path); - } - if (this.isHovered || this.isSelected) - { - SmoothingMode smoothingMode = g.SmoothingMode; - g.SmoothingMode = SmoothingMode.AntiAlias; - using (Pen pen = new Pen(Color.FromArgb(0x2a, 0x5b, 150), 2f)) - { - g.DrawPath(pen, path); - } - using (Pen pen2 = new Pen(Color.FromArgb(150, 0xb1, 0xef), 1f)) - { - g.DrawPath(pen2, path); - } - g.SmoothingMode = smoothingMode; - } - path.Dispose(); - } - - public void SetHexagonPoints(float xCoordinate, float yCoordinate, int hexagonWidth) - { - float num = hexagonWidth * 0.5773503f; - this.hexagonPoints[0] = new Point((int)Math.Floor((double)(xCoordinate - (hexagonWidth / 2))), ((int)Math.Floor((double)(yCoordinate - (num / 2f)))) - 1); - this.hexagonPoints[1] = new Point((int)Math.Floor((double)xCoordinate), ((int)Math.Floor((double)(yCoordinate - (hexagonWidth / 2)))) - 1); - this.hexagonPoints[2] = new Point((int)Math.Floor((double)(xCoordinate + (hexagonWidth / 2))), ((int)Math.Floor((double)(yCoordinate - (num / 2f)))) - 1); - this.hexagonPoints[3] = new Point((int)Math.Floor((double)(xCoordinate + (hexagonWidth / 2))), ((int)Math.Floor((double)(yCoordinate + (num / 2f)))) + 1); - this.hexagonPoints[4] = new Point((int)Math.Floor((double)xCoordinate), ((int)Math.Floor((double)(yCoordinate + (hexagonWidth / 2)))) + 1); - this.hexagonPoints[5] = new Point((int)Math.Floor((double)(xCoordinate - (hexagonWidth / 2))), ((int)Math.Floor((double)(yCoordinate + (num / 2f)))) + 1); - using (GraphicsPath path = new GraphicsPath()) - { - path.AddPolygon(this.hexagonPoints); - this.boundingRect = Rectangle.Round(path.GetBounds()); - this.boundingRect.Inflate(2, 2); - } - } - - #endregion - - #region Properties - - public Rectangle BoundingRectangle - { - get { return this.boundingRect; } - } - - public Color CurrentColor - { - get { return this.hexagonColor; } - set { this.hexagonColor = value; } - } - - public bool IsHovered - { - get { return this.isHovered; } - set { this.isHovered = value; } - } - - public bool IsSelected - { - get { return this.isSelected; } - set { this.isSelected = value; } - } - - #endregion - } - #endregion -} diff --git a/Vendor/MechanikaDesign/ColorBox2D/Controls/ColorSliderVertical.Designer.cs b/Vendor/MechanikaDesign/ColorBox2D/Controls/ColorSliderVertical.Designer.cs deleted file mode 100644 index 2b4d5c45..00000000 --- a/Vendor/MechanikaDesign/ColorBox2D/Controls/ColorSliderVertical.Designer.cs +++ /dev/null @@ -1,45 +0,0 @@ -namespace MechanikaDesign.WinForms.UI.ColorPicker -{ - partial class ColorSliderVertical - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Component Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.SuspendLayout(); - // - // ColorSlider - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.Name = "ColorSlider"; - this.Size = new System.Drawing.Size(25, 150); - this.ResumeLayout(false); - - } - - #endregion - } -} diff --git a/Vendor/MechanikaDesign/ColorBox2D/Controls/ColorSliderVertical.cs b/Vendor/MechanikaDesign/ColorBox2D/Controls/ColorSliderVertical.cs deleted file mode 100644 index 7315b3a7..00000000 --- a/Vendor/MechanikaDesign/ColorBox2D/Controls/ColorSliderVertical.cs +++ /dev/null @@ -1,325 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Drawing; -using System.Data; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Forms; - -namespace MechanikaDesign.WinForms.UI.ColorPicker -{ - [DefaultEvent("ColorChanged")] - public partial class ColorSliderVertical : UserControl - { - #region Events - - public delegate void ColorChangedEventHandler(object sender, ColorChangedEventArgs args); - public event ColorChangedEventHandler ColorChanged; - - #endregion - - #region Fields - - private HslColor colorHSL = HslColor.FromAhsl(0xff); - private ColorModes colorMode; - private Color colorRGB = Color.Empty; - private bool mouseMoving; - private int position; - private bool setHueSilently; - private Color nubColor; - - #endregion - - #region Properties - - public Color ColorRGB - { - get { return this.colorRGB; } - set - { - this.colorRGB = value; - if (!this.setHueSilently) - { - this.colorHSL = HslColor.FromColor(this.ColorRGB); - } - this.ResetSlider(); - this.Refresh(); - } - } - - public HslColor ColorHSL - { - get { return this.colorHSL; } - set - { - this.colorHSL = value; - this.colorRGB = this.colorHSL.RgbValue; - this.ResetSlider(); - this.Refresh(); - } - } - - public ColorModes ColorMode - { - get { return this.colorMode; } - set - { - this.colorMode = value; - this.ResetSlider(); - this.Refresh(); - } - } - - /// - /// Gets or sets the color of the selection nub. - /// - /// - /// The color of the nub. - /// - [Category("Appearance")] - [DefaultValue(typeof(Color), "Black")] - public Color NubColor - { - get { return this.nubColor; } - set { this.nubColor = value; } - } - - /// - /// Gets or sets the position of the selection nub. - /// - /// - /// The position. - /// - public int Position - { - get { return this.position; } - set - { - int num = value; - num = MathExtensions.LimitToRange(num, 0, base.Height - 9); - if (num != this.position) - { - this.position = num; - this.ResetHSLRGB(); - this.Refresh(); - if (this.ColorChanged != null) - { - this.ColorChanged(this, new ColorChangedEventArgs(this.colorRGB)); - } - } - } - } - - #endregion - - #region Constructors - - public ColorSliderVertical() - { - InitializeComponent(); - base.SetStyle(ControlStyles.OptimizedDoubleBuffer | ControlStyles.AllPaintingInWmPaint, true); - - this.colorHSL = HslColor.FromAhsl(1.0, 1.0, 1.0); - this.colorRGB = this.colorHSL.RgbValue; - this.colorMode = ColorModes.Hue; - } - - #endregion - - #region Overridden Methods - - protected override void OnMouseDown(MouseEventArgs e) - { - base.OnMouseDown(e); - this.mouseMoving = true; - this.Position = e.Y - 4; - } - - protected override void OnMouseUp(MouseEventArgs e) - { - base.OnMouseUp(e); - this.mouseMoving = false; - } - - protected override void OnMouseMove(MouseEventArgs e) - { - base.OnMouseMove(e); - if (this.mouseMoving) - { - this.Position = e.Y - 4; - } - } - - protected override void OnPaint(PaintEventArgs e) - { - base.OnPaint(e); - HslColor color = HslColor.FromAhsl(0xff); - switch (this.ColorMode) - { - case ColorModes.Hue: - color.L = color.S = 1.0; - break; - - case ColorModes.Saturation: - color.H = this.ColorHSL.H; - color.L = this.ColorHSL.L; - break; - - case ColorModes.Luminance: - color.H = this.ColorHSL.H; - color.S = this.ColorHSL.S; - break; - } - for (int i = 0; i < (base.Height - 8); i++) - { - double num2 = 0.0; - if (this.ColorMode < ColorModes.Hue) - { - num2 = 255.0 - MathExtensions.Round((255.0 * i) / (base.Height - 8.0)); - } - else - { - num2 = 1.0 - (((double)i) / ((double)(base.Height - 8))); - } - Color empty = Color.Empty; - switch (this.ColorMode) - { - case ColorModes.Red: - empty = Color.FromArgb((int)num2, this.ColorRGB.G, this.ColorRGB.B); - break; - - case ColorModes.Green: - empty = Color.FromArgb(this.ColorRGB.R, (int)num2, this.ColorRGB.B); - break; - - case ColorModes.Blue: - empty = Color.FromArgb(this.ColorRGB.R, this.ColorRGB.G, (int)num2); - break; - - case ColorModes.Hue: - color.H = num2; - empty = color.RgbValue; - break; - - case ColorModes.Saturation: - color.S = num2; - empty = color.RgbValue; - break; - - case ColorModes.Luminance: - color.L = num2; - empty = color.RgbValue; - break; - } - - using (Pen pen = new Pen(empty)) - { - e.Graphics.DrawLine(pen, 11, i + 4, base.Width - 11, i + 4); - } - } - this.DrawSlider(e.Graphics); - } - - - #endregion - - #region Private Methods - - private void DrawSlider(Graphics g) - { - using (Pen pen = new Pen(Color.FromArgb(0x74, 0x72, 0x6a))) - { - SolidBrush fill = new SolidBrush(this.nubColor); - Point[] points = new Point[] { new Point(1, this.position), new Point(3, this.position), new Point(7, this.position + 4), new Point(3, this.position + 8), new Point(1, this.position + 8), new Point(0, this.position + 7), new Point(0, this.position + 1) }; - g.FillPolygon(fill, points); - g.DrawPolygon(pen, points); - - points[0] = new Point(base.Width - 2, this.position); - points[1] = new Point(base.Width - 4, this.position); - points[2] = new Point(base.Width - 8, this.position + 4); - points[3] = new Point(base.Width - 4, this.position + 8); - points[4] = new Point(base.Width - 2, this.position + 8); - points[5] = new Point(base.Width - 1, this.position + 7); - points[6] = new Point(base.Width - 1, this.position + 1); - - g.FillPolygon(fill, points); - g.DrawPolygon(pen, points); - } - } - - private void ResetSlider() - { - double h = 0.0; - switch (this.ColorMode) - { - case ColorModes.Red: - h = ((double)this.colorRGB.R) / 255.0; - break; - - case ColorModes.Green: - h = ((double)this.colorRGB.G) / 255.0; - break; - - case ColorModes.Blue: - h = ((double)this.colorRGB.B) / 255.0; - break; - - case ColorModes.Hue: - h = this.colorHSL.H; - break; - - case ColorModes.Saturation: - h = this.colorHSL.S; - break; - - case ColorModes.Luminance: - h = this.colorHSL.L; - break; - } - this.position = (base.Height - 8) - MathExtensions.Round((base.Height - 8) * h); - } - - private void ResetHSLRGB() - { - this.setHueSilently = true; - switch (this.ColorMode) - { - case ColorModes.Red: - this.ColorRGB = Color.FromArgb(0xff - MathExtensions.Round((255.0 * this.position) / ((double)(base.Height - 9))), this.ColorRGB.G, this.ColorRGB.B); - this.ColorHSL = HslColor.FromColor(this.ColorRGB); - break; - - case ColorModes.Green: - this.ColorRGB = Color.FromArgb(this.ColorRGB.R, 0xff - MathExtensions.Round((255.0 * this.position) / ((double)(base.Height - 9))), this.ColorRGB.B); - this.ColorHSL = HslColor.FromColor(this.ColorRGB); - break; - - case ColorModes.Blue: - this.ColorRGB = Color.FromArgb(this.ColorRGB.R, this.ColorRGB.G, 0xff - MathExtensions.Round((255.0 * this.position) / ((double)(base.Height - 9)))); - this.ColorHSL = HslColor.FromColor(this.ColorRGB); - break; - - case ColorModes.Hue: - this.colorHSL.H = 1.0 - (((double)this.position) / ((double)(base.Height - 9))); - this.ColorRGB = this.ColorHSL.RgbValue; - break; - - case ColorModes.Saturation: - this.colorHSL.S = 1.0 - (((double)this.position) / ((double)(base.Height - 9))); - this.ColorRGB = this.ColorHSL.RgbValue; - break; - - case ColorModes.Luminance: - this.colorHSL.L = 1.0 - (((double)this.position) / ((double)(base.Height - 9))); - this.ColorRGB = this.ColorHSL.RgbValue; - break; - } - this.setHueSilently = false; - } - - #endregion - - } -} diff --git a/Vendor/MechanikaDesign/ColorBox2D/Controls/ColorSliderVertical.resx b/Vendor/MechanikaDesign/ColorBox2D/Controls/ColorSliderVertical.resx deleted file mode 100644 index 1af7de15..00000000 --- a/Vendor/MechanikaDesign/ColorBox2D/Controls/ColorSliderVertical.resx +++ /dev/null @@ -1,120 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/Vendor/MechanikaDesign/ColorBox2D/Controls/ColorWheel.cs b/Vendor/MechanikaDesign/ColorBox2D/Controls/ColorWheel.cs deleted file mode 100644 index 21276fd6..00000000 --- a/Vendor/MechanikaDesign/ColorBox2D/Controls/ColorWheel.cs +++ /dev/null @@ -1,884 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Drawing; -using System.Drawing.Drawing2D; -using System.Data; -using System.Windows.Forms; - -namespace MechanikaDesign.WinForms.UI.ColorPicker -{ - - [DefaultProperty("Color")] - [DefaultEvent("ColorChanged")] - public partial class ColorWheel: Control - { - private const int PADDING = 10; - private const int INNER_RADIUS = 200; - private const int OUTER_RADIUS = INNER_RADIUS + 50; - - #region Fields - - private Brush _brush; - private PointF _centerPoint; - private Color _color; - private int _colorStep; - private bool _dragStartedWithinWheel; - private HslColor _hslColor; - private int _largeChange; - private float _radius; - private int _selectionSize; - private int _smallChange; - private int _updateCount; - - #endregion - - #region Constructors - - /// - /// Initializes a new instance of the class. - /// - public ColorWheel() - { - this.SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint | ControlStyles.OptimizedDoubleBuffer | ControlStyles.Selectable | ControlStyles.StandardClick | ControlStyles.StandardDoubleClick, true); - this.Color = Color.Black; - this.ColorStep = 4; - this.SelectionSize = 10; - this.SmallChange = 1; - this.LargeChange = 5; - this.SelectionGlyph = this.CreateSelectionGlyph(); - } - - #endregion - - #region Events - - /// - /// Occurs when the Color property value changes - /// - [Category("Property Changed")] - public event EventHandler ColorChanged; - - /// - /// Occurs when the ColorStep property value changes - /// - [Category("Property Changed")] - public event EventHandler ColorStepChanged; - - /// - /// Occurs when the HslColor property value changes - /// - [Category("Property Changed")] - public event EventHandler HslColorChanged; - - /// - /// Occurs when the LargeChange property value changes - /// - [Category("Property Changed")] - public event EventHandler LargeChangeChanged; - - /// - /// Occurs when the SelectionSize property value changes - /// - [Category("Property Changed")] - public event EventHandler SelectionSizeChanged; - - /// - /// Occurs when the SmallChange property value changes - /// - [Category("Property Changed")] - public event EventHandler SmallChangeChanged; - - #endregion - - #region Overridden Methods - /// - /// Releases the unmanaged resources used by the and its child controls and optionally releases the managed resources. - /// - /// true to release both managed and unmanaged resources; false to release only unmanaged resources. - protected override void Dispose(bool disposing) - { - if (disposing) - { - if (_brush != null) - { - _brush.Dispose(); - } - - if (this.SelectionGlyph != null) - { - this.SelectionGlyph.Dispose(); - } - } - - base.Dispose(disposing); - } - - /// - /// Determines whether the specified key is a regular input key or a special key that requires preprocessing. - /// - /// One of the values. - /// true if the specified key is a regular input key; otherwise, false. - protected override bool IsInputKey(Keys keyData) - { - bool result; - - if ((keyData & Keys.Left) == Keys.Left || (keyData & Keys.Up) == Keys.Up || (keyData & Keys.Down) == Keys.Down || (keyData & Keys.Right) == Keys.Right || (keyData & Keys.PageUp) == Keys.PageUp || (keyData & Keys.PageDown) == Keys.PageDown) - { - result = true; - } - else - { - result = base.IsInputKey(keyData); - } - - return result; - } - /// - /// Raises the event. - /// - /// An that contains the event data. - protected override void OnGotFocus(EventArgs e) - { - base.OnGotFocus(e); - - this.Invalidate(); - } - - /// - /// Raises the event. - /// - /// A that contains the event data. - protected override void OnKeyDown(KeyEventArgs e) - { - HslColor color; - double hue; - int step; - - color = this.HslColor; - hue = color.H; - - step = e.Shift ? this.LargeChange : this.SmallChange; - - switch (e.KeyCode) - { - case Keys.Right: - case Keys.Up: - hue += step; - break; - case Keys.Left: - case Keys.Down: - hue -= step; - break; - case Keys.PageUp: - hue += this.LargeChange; - break; - case Keys.PageDown: - hue -= this.LargeChange; - break; - } - - if (hue >= 360) - { - hue = 0; - } - if (hue < 0) - { - hue = 359; - } - - if (hue != color.H) - { - color.H = hue; - - // As the Color and HslColor properties update each other, need to temporarily disable this and manually set both - // otherwise the wheel "sticks" due to imprecise conversion from RGB to HSL - this.LockUpdates = true; - this.Color = color.ToRgbColor(); - this.HslColor = color; - this.LockUpdates = false; - - e.Handled = true; - } - - base.OnKeyDown(e); - } - - /// - /// Raises the event. - /// - /// An that contains the event data. - protected override void OnLostFocus(EventArgs e) - { - base.OnLostFocus(e); - - this.Invalidate(); - } - - /// - /// Raises the event. - /// - /// A that contains the event data. - protected override void OnMouseDown(MouseEventArgs e) - { - base.OnMouseDown(e); - - if (!this.Focused && this.TabStop) - { - this.Focus(); - } - - if (e.Button == MouseButtons.Left && this.IsPointInWheel(e.Location)) - { - _dragStartedWithinWheel = true; - this.SetColor(e.Location); - } - } - - /// - /// Raises the event. - /// - /// A that contains the event data. - protected override void OnMouseMove(MouseEventArgs e) - { - base.OnMouseMove(e); - - if (e.Button == MouseButtons.Left && _dragStartedWithinWheel) - { - this.SetColor(e.Location); - } - } - - /// - /// Raises the event. - /// - /// A that contains the event data. - protected override void OnMouseUp(MouseEventArgs e) - { - base.OnMouseUp(e); - - _dragStartedWithinWheel = false; - } - - /// - /// Raises the event. - /// - /// A that contains the event data. - protected override void OnPaddingChanged(EventArgs e) - { - base.OnPaddingChanged(e); - - this.RefreshWheel(); - } - - /// - /// Raises the event. - /// - /// A that contains the event data. - protected override void OnPaint(PaintEventArgs e) - { - base.OnPaint(e); - - if (this.AllowPainting) - { - base.OnPaintBackground(e); - - if (this.BackgroundImage == null && this.Parent != null && (this.BackColor == this.Parent.BackColor || this.Parent.BackColor.A != 255)) - { - ButtonRenderer.DrawParentBackground(e.Graphics, this.DisplayRectangle, this); - } - - if (_brush != null) - { - e.Graphics.FillPie(_brush, this.ClientRectangle, 0, 360); - } - - // smooth out the edge of the wheel - e.Graphics.SmoothingMode = SmoothingMode.AntiAlias; - using (Pen pen = new Pen(this.BackColor, 2)) - { - e.Graphics.DrawEllipse(pen, new RectangleF(_centerPoint.X - _radius, _centerPoint.Y - _radius, _radius * 2, _radius * 2)); - } - - if (!this.Color.IsEmpty) - { - this.PaintCurrentColor(e); - } - } - } - - /// - /// Raises the event. - /// - /// An that contains the event data. - protected override void OnResize(EventArgs e) - { - base.OnResize(e); - - this.RefreshWheel(); - } - - #endregion - - #region Public Properties - - /// - /// Gets or sets the component color. - /// - /// The component color. - [Category("Appearance")] - [DefaultValue(typeof(Color), "Black")] - public virtual Color Color - { - get { return _color; } - set - { - if (this.Color != value) - { - _color = value; - - this.OnColorChanged(EventArgs.Empty); - } - } - } - - /// - /// Gets or sets the increment for rendering the color wheel. - /// - /// The color step. - /// Value must be between 1 and 359 - [Category("Appearance")] - [DefaultValue(4)] - public virtual int ColorStep - { - get { return _colorStep; } - set - { - if (value < 1 || value > 359) - { - throw new ArgumentOutOfRangeException("value", value, "Value must be between 1 and 359"); - } - - if (this.ColorStep != value) - { - _colorStep = value; - - this.OnColorStepChanged(EventArgs.Empty); - } - } - } - - /// - /// Gets or sets the component color. - /// - /// The component color. - [Category("Appearance")] - [DefaultValue(typeof(HslColor), "0, 0, 0")] - [Browsable(false) /* disable editing until I write a proper type convertor */] - [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] - public virtual HslColor HslColor - { - get { return _hslColor; } - set - { - if (this.HslColor != value) - { - _hslColor = value; - - this.OnHslColorChanged(EventArgs.Empty); - } - } - } - - /// - /// Gets or sets a value to be added to or subtracted from the property when the wheel selection is moved a large distance. - /// - /// A numeric value. The default value is 5. - [Category("Behavior")] - [DefaultValue(5)] - public virtual int LargeChange - { - get { return _largeChange; } - set - { - if (this.LargeChange != value) - { - _largeChange = value; - - this.OnLargeChangeChanged(EventArgs.Empty); - } - } - } - - /// - /// Gets or sets the size of the selection handle. - /// - /// The size of the selection handle. - [Category("Appearance")] - [DefaultValue(10)] - public virtual int SelectionSize - { - get { return _selectionSize; } - set - { - if (this.SelectionSize != value) - { - _selectionSize = value; - - this.OnSelectionSizeChanged(EventArgs.Empty); - } - } - } - - /// - /// Gets or sets a value to be added to or subtracted from the property when the wheel selection is moved a small distance. - /// - /// A numeric value. The default value is 1. - [Category("Behavior")] - [DefaultValue(1)] - public virtual int SmallChange - { - get { return _smallChange; } - set - { - if (this.SmallChange != value) - { - _smallChange = value; - - this.OnSmallChangeChanged(EventArgs.Empty); - } - } - } - - #endregion - - #region Protected Properties - - /// - /// Gets a value indicating whether painting of the control is allowed. - /// - /// - /// true if painting of the control is allowed; otherwise, false. - /// - protected virtual bool AllowPainting - { - get { return _updateCount == 0; } - } - - protected Color[] Colors { get; set; } - - protected bool LockUpdates { get; set; } - - protected PointF[] Points { get; set; } - - protected Image SelectionGlyph { get; set; } - - #endregion - - #region Public Members - - /// - /// Disables any redrawing of the image box - /// - public virtual void BeginUpdate() - { - _updateCount++; - } - - /// - /// Enables the redrawing of the image box - /// - public virtual void EndUpdate() - { - if (_updateCount > 0) - { - _updateCount--; - } - - if (this.AllowPainting) - { - this.Invalidate(); - } - } - - #endregion - - #region Protected Members - - /// - /// Calculates wheel attributes. - /// - protected virtual void CalculateWheel() - { - List points; - List colors; - - points = new List(); - colors = new List(); - - // Only define the points if the control is above a minimum size, otherwise if it's too small, - // you get an "out of memory" exceptions (of all things) when creating the brush - if (this.ClientSize.Width > 16 && this.ClientSize.Height > 16) - { - int w; - int h; - - w = this.ClientSize.Width; - h = this.ClientSize.Height; - - _centerPoint = new PointF(w / 2.0F, h / 2.0F); - _radius = this.GetRadius(_centerPoint); - - for (double angle = 0; angle < 360; angle += this.ColorStep) - { - double angleR; - PointF location; - - angleR = angle * (Math.PI / 180); - location = this.GetColorLocation(angleR, _radius); - - points.Add(location); - colors.Add(new HslColor(angle, 1.0, 0.5).ToRgbColor()); - } - } - - this.Points = points.ToArray(); - this.Colors = colors.ToArray(); - } - - /// - /// Creates the gradient brush used to paint the wheel. - /// - protected virtual Brush CreateGradientBrush() - { - Brush result; - - if (this.Points.Length != 0 && this.Points.Length == this.Colors.Length) - { - result = new PathGradientBrush(this.Points, WrapMode.Clamp) - { - CenterPoint = _centerPoint, - CenterColor = Color.White, - SurroundColors = this.Colors - }; - } - else - { - result = null; - } - - return result; - } - - /// - /// Creates the selection glyph. - /// - protected virtual Image CreateSelectionGlyph() - { - Image image; - int halfSize; - - halfSize = this.SelectionSize / 2; - image = new Bitmap(this.SelectionSize + 1, this.SelectionSize + 1); - - using (Graphics g = Graphics.FromImage(image)) - { - Point[] diamondOuter; - - diamondOuter = new[] - { - new Point(halfSize, 0), new Point(this.SelectionSize, halfSize), new Point(halfSize, this.SelectionSize), new Point(0, halfSize) - }; - - g.FillPolygon(SystemBrushes.Control, diamondOuter); - g.DrawPolygon(SystemPens.ControlDark, diamondOuter); - - using (Pen pen = new Pen(Color.FromArgb(128, SystemColors.ControlDark))) - { - g.DrawLine(pen, halfSize, 1, this.SelectionSize - 1, halfSize); - g.DrawLine(pen, halfSize, 2, this.SelectionSize - 2, halfSize); - g.DrawLine(pen, halfSize, this.SelectionSize - 1, this.SelectionSize - 2, halfSize + 1); - g.DrawLine(pen, halfSize, this.SelectionSize - 2, this.SelectionSize - 3, halfSize + 1); - } - - using (Pen pen = new Pen(Color.FromArgb(196, SystemColors.ControlLightLight))) - { - g.DrawLine(pen, halfSize, this.SelectionSize - 1, 1, halfSize); - } - - g.DrawLine(SystemPens.ControlLightLight, 1, halfSize, halfSize, 1); - } - - return image; - } - - /// - /// Gets the point within the wheel representing the source color. - /// - /// The color. - protected PointF GetColorLocation(Color color) - { - return this.GetColorLocation(new HslColor(color)); - } - - /// - /// Gets the point within the wheel representing the source color. - /// - /// The color. - protected virtual PointF GetColorLocation(HslColor color) - { - double angle; - double radius; - - angle = color.H * Math.PI / 180; - radius = _radius * color.S; - - return this.GetColorLocation(angle, radius); - } - - protected PointF GetColorLocation(double angleR, double radius) - { - double x; - double y; - - x = this.Padding.Left + _centerPoint.X + Math.Cos(angleR) * radius; - y = this.Padding.Top + _centerPoint.Y - Math.Sin(angleR) * radius; - - return new PointF((float)x, (float)y); - } - - protected float GetRadius(PointF centerPoint) - { - return Math.Min(centerPoint.X, centerPoint.Y) - (Math.Max(this.Padding.Horizontal, this.Padding.Vertical) + (this.SelectionSize / 2)); - } - - /// - /// Determines whether the specified point is within the bounds of the color wheel. - /// - /// The point. - /// true if the specified point is within the bounds of the color wheel; otherwise, false. - protected bool IsPointInWheel(Point point) - { - PointF normalized; - - // http://my.safaribooksonline.com/book/programming/csharp/9780672331985/graphics-with-windows-forms-and-gdiplus/ch17lev1sec21 - - normalized = new PointF(point.X - _centerPoint.X, point.Y - _centerPoint.Y); - - return (normalized.X * normalized.X + normalized.Y * normalized.Y) <= (_radius * _radius); - } - - /// - /// Raises the event. - /// - /// The instance containing the event data. - protected virtual void OnColorChanged(EventArgs e) - { - EventHandler handler; - - if (!this.LockUpdates) - { - this.HslColor = new HslColor(this.Color); - } - this.Refresh(); - - handler = this.ColorChanged; - - if (handler != null) - { - handler(this, e); - } - } - - /// - /// Raises the event. - /// - /// The instance containing the event data. - protected virtual void OnColorStepChanged(EventArgs e) - { - EventHandler handler; - - this.RefreshWheel(); - - handler = this.ColorStepChanged; - - if (handler != null) - { - handler(this, e); - } - } - - /// - /// Raises the event. - /// - /// The instance containing the event data. - protected virtual void OnHslColorChanged(EventArgs e) - { - EventHandler handler; - - if (!this.LockUpdates) - { - this.Color = this.HslColor.ToRgbColor(); - } - this.Invalidate(); - - handler = this.HslColorChanged; - - if (handler != null) - { - handler(this, e); - } - } - - /// - /// Raises the event. - /// - /// The instance containing the event data. - protected virtual void OnLargeChangeChanged(EventArgs e) - { - EventHandler handler; - - handler = this.LargeChangeChanged; - - if (handler != null) - { - handler(this, e); - } - } - - /// - /// Raises the event. - /// - /// The instance containing the event data. - protected virtual void OnSelectionSizeChanged(EventArgs e) - { - EventHandler handler; - - if (this.SelectionGlyph != null) - { - this.SelectionGlyph.Dispose(); - } - - this.SelectionGlyph = this.CreateSelectionGlyph(); - this.RefreshWheel(); - - handler = this.SelectionSizeChanged; - - if (handler != null) - { - handler(this, e); - } - } - - /// - /// Raises the event. - /// - /// The instance containing the event data. - protected virtual void OnSmallChangeChanged(EventArgs e) - { - EventHandler handler; - - handler = this.SmallChangeChanged; - - if (handler != null) - { - handler(this, e); - } - } - - protected void PaintColor(PaintEventArgs e, HslColor color) - { - this.PaintColor(e, color, false); - } - - protected virtual void PaintColor(PaintEventArgs e, HslColor color, bool includeFocus) - { - PointF location; - - location = this.GetColorLocation(color); - - if (!float.IsNaN(location.X) && !float.IsNaN(location.Y)) - { - int x; - int y; - - x = (int)location.X - (this.SelectionSize / 2); - y = (int)location.Y - (this.SelectionSize / 2); - - if (this.SelectionGlyph == null) - { - e.Graphics.DrawRectangle(Pens.Black, x, y, this.SelectionSize, this.SelectionSize); - } - else - { - e.Graphics.DrawImage(this.SelectionGlyph, x, y); - } - - if (this.Focused && includeFocus) - { - ControlPaint.DrawFocusRectangle(e.Graphics, new Rectangle(x - 1, y - 1, this.SelectionSize + 2, this.SelectionSize + 2)); - } - } - } - - protected virtual void PaintCurrentColor(PaintEventArgs e) - { - this.PaintColor(e, this.HslColor, true); - } - - protected virtual void SetColor(Point point) - { - double dx; - double dy; - double angle; - double distance; - double saturation; - - dx = Math.Abs(point.X - _centerPoint.X - this.Padding.Left); - dy = Math.Abs(point.Y - _centerPoint.Y - this.Padding.Top); - angle = Math.Atan(dy / dx) / Math.PI * 180; - distance = Math.Pow((Math.Pow(dx, 2) + (Math.Pow(dy, 2))), 0.5); - saturation = distance / _radius; - - if (distance < 6) - { - saturation = 0; // snap to center - } - - if (point.X < _centerPoint.X) - { - angle = 180 - angle; - } - if (point.Y > _centerPoint.Y) - { - angle = 360 - angle; - } - - this.LockUpdates = true; - this.HslColor = new HslColor(angle, saturation, 0.5); - this.Color = this.HslColor.ToRgbColor(); - this.LockUpdates = false; - } - - #endregion - - #region Private Members - - /// - /// Refreshes the wheel attributes and then repaints the control - /// - private void RefreshWheel() - { - if (_brush != null) - { - _brush.Dispose(); - } - - this.CalculateWheel(); - _brush = this.CreateGradientBrush(); - this.Invalidate(); - } - - #endregion - } -} diff --git a/Vendor/MechanikaDesign/ColorBox2D/HslColor.cs b/Vendor/MechanikaDesign/ColorBox2D/HslColor.cs deleted file mode 100644 index 698ede50..00000000 --- a/Vendor/MechanikaDesign/ColorBox2D/HslColor.cs +++ /dev/null @@ -1,353 +0,0 @@ -using System; -using System.ComponentModel; -using System.Drawing; -using System.Runtime.InteropServices; - -namespace MechanikaDesign.WinForms.UI.ColorPicker -{ - [StructLayout(LayoutKind.Sequential)] - public struct HslColor - { - public static readonly HslColor Empty; - private double hue; - private double saturation; - private double luminance; - private int alpha; - - public HslColor(int a, double h, double s, double l) - { - this.alpha = a; - this.hue = h; - this.saturation = s; - this.luminance = l; - this.A = a; - this.H = this.hue; - this.S = this.saturation; - this.L = this.luminance; - } - - public HslColor(double h, double s, double l) - { - this.alpha = 0xff; - this.hue = h; - this.saturation = s; - this.luminance = l; - } - - public HslColor(Color color) - { - this.alpha = color.A; - this.hue = 0.0; - this.saturation = 0.0; - this.luminance = 0.0; - this.RGBtoHSL(color); - } - - public static HslColor FromArgb(int a, int r, int g, int b) - { - return new HslColor(Color.FromArgb(a, r, g, b)); - } - - public static HslColor FromColor(Color color) - { - return new HslColor(color); - } - - public static HslColor FromAhsl(int a) - { - return new HslColor(a, 0.0, 0.0, 0.0); - } - - public static HslColor FromAhsl(int a, HslColor hsl) - { - return new HslColor(a, hsl.hue, hsl.saturation, hsl.luminance); - } - - public static HslColor FromAhsl(double h, double s, double l) - { - return new HslColor(0xff, h, s, l); - } - - public static HslColor FromAhsl(int a, double h, double s, double l) - { - return new HslColor(a, h, s, l); - } - - public static bool operator ==(HslColor left, HslColor right) - { - return (((left.A == right.A) && (left.H == right.H)) && ((left.S == right.S) && (left.L == right.L))); - } - - public static bool operator !=(HslColor left, HslColor right) - { - return !(left == right); - } - - public override bool Equals(object obj) - { - if (obj is HslColor) - { - HslColor color = (HslColor)obj; - if (((this.A == color.A) && (this.H == color.H)) && ((this.S == color.S) && (this.L == color.L))) - { - return true; - } - } - return false; - } - - public override int GetHashCode() - { - return (((this.alpha.GetHashCode() ^ this.hue.GetHashCode()) ^ this.saturation.GetHashCode()) ^ this.luminance.GetHashCode()); - } - - [DefaultValue((double)0.0), Category("Appearance"), Description("H Channel value")] - public double H - { - get - { - return this.hue; - } - set - { - this.hue = value; - this.hue = (this.hue > 1.0) ? 1.0 : ((this.hue < 0.0) ? 0.0 : this.hue); - } - } - [Category("Appearance"), Description("S Channel value"), DefaultValue((double)0.0)] - public double S - { - get - { - return this.saturation; - } - set - { - this.saturation = value; - this.saturation = (this.saturation > 1.0) ? 1.0 : ((this.saturation < 0.0) ? 0.0 : this.saturation); - } - } - [Category("Appearance"), Description("L Channel value"), DefaultValue((double)0.0)] - public double L - { - get - { - return this.luminance; - } - set - { - this.luminance = value; - this.luminance = (this.luminance > 1.0) ? 1.0 : ((this.luminance < 0.0) ? 0.0 : this.luminance); - } - } - [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] - public Color RgbValue - { - get - { - return this.HSLtoRGB(); - } - set - { - this.RGBtoHSL(value); - } - } - public int A - { - get - { - return this.alpha; - } - set - { - this.alpha = (value > 0xff) ? 0xff : ((value < 0) ? 0 : value); - } - } - public bool IsEmpty - { - get - { - return ((((this.alpha == 0) && (this.H == 0.0)) && (this.S == 0.0)) && (this.L == 0.0)); - } - } - - public Color ToRgbColor() - { - return this.ToRgbColor(this.A); - } - - public Color ToRgbColor(int alpha) - { - double q; - if (this.L < 0.5) - { - q = this.L * (1 + this.S); - } - else - { - q = this.L + this.S - (this.L * this.S); - } - double p = 2 * this.L - q; - double hk = this.H / 360; - - // r,g,b colors - double[] tc = new[] - { - hk + (1d / 3d), hk, hk - (1d / 3d) - }; - double[] colors = new[] - { - 0.0, 0.0, 0.0 - }; - - for (int color = 0; color < colors.Length; color++) - { - if (tc[color] < 0) - { - tc[color] += 1; - } - if (tc[color] > 1) - { - tc[color] -= 1; - } - - if (tc[color] < (1d / 6d)) - { - colors[color] = p + ((q - p) * 6 * tc[color]); - } - else if (tc[color] >= (1d / 6d) && tc[color] < (1d / 2d)) - { - colors[color] = q; - } - else if (tc[color] >= (1d / 2d) && tc[color] < (2d / 3d)) - { - colors[color] = p + ((q - p) * 6 * (2d / 3d - tc[color])); - } - else - { - colors[color] = p; - } - - colors[color] *= 255; - } - - return Color.FromArgb(alpha, (int)colors[0], (int)colors[1], (int)colors[2]); - } - - private Color HSLtoRGB() - { - int num2; - int red = this.Round(this.luminance * 255.0); - int blue = this.Round(((1.0 - this.saturation) * (this.luminance / 1.0)) * 255.0); - double num4 = ((double)(red - blue)) / 255.0; - if ((this.hue >= 0.0) && (this.hue <= 0.16666666666666666)) - { - num2 = this.Round((((this.hue - 0.0) * num4) * 1530.0) + blue); - return Color.FromArgb(this.alpha, red, num2, blue); - } - if (this.hue <= 0.33333333333333331) - { - num2 = this.Round((-((this.hue - 0.16666666666666666) * num4) * 1530.0) + red); - return Color.FromArgb(this.alpha, num2, red, blue); - } - if (this.hue <= 0.5) - { - num2 = this.Round((((this.hue - 0.33333333333333331) * num4) * 1530.0) + blue); - return Color.FromArgb(this.alpha, blue, red, num2); - } - if (this.hue <= 0.66666666666666663) - { - num2 = this.Round((-((this.hue - 0.5) * num4) * 1530.0) + red); - return Color.FromArgb(this.alpha, blue, num2, red); - } - if (this.hue <= 0.83333333333333337) - { - num2 = this.Round((((this.hue - 0.66666666666666663) * num4) * 1530.0) + blue); - return Color.FromArgb(this.alpha, num2, blue, red); - } - if (this.hue <= 1.0) - { - num2 = this.Round((-((this.hue - 0.83333333333333337) * num4) * 1530.0) + red); - return Color.FromArgb(this.alpha, red, blue, num2); - } - return Color.FromArgb(this.alpha, 0, 0, 0); - } - - private void RGBtoHSL(Color color) - { - int r; - int g; - double num4; - this.alpha = color.A; - if (color.R > color.G) - { - r = color.R; - g = color.G; - } - else - { - r = color.G; - g = color.R; - } - if (color.B > r) - { - r = color.B; - } - else if (color.B < g) - { - g = color.B; - } - int num3 = r - g; - this.luminance = ((double)r) / 255.0; - if (r == 0) - { - this.saturation = 0.0; - } - else - { - this.saturation = ((double)num3) / ((double)r); - } - if (num3 == 0) - { - num4 = 0.0; - } - else - { - num4 = 60.0 / ((double)num3); - } - if (r == color.R) - { - if (color.G < color.B) - { - this.hue = (360.0 + (num4 * (color.G - color.B))) / 360.0; - } - else - { - this.hue = (num4 * (color.G - color.B)) / 360.0; - } - } - else if (r == color.G) - { - this.hue = (120.0 + (num4 * (color.B - color.R))) / 360.0; - } - else if (r == color.B) - { - this.hue = (240.0 + (num4 * (color.R - color.G))) / 360.0; - } - else - { - this.hue = 0.0; - } - } - - private int Round(double val) - { - return (int)(val + 0.5); - } - - static HslColor() - { - Empty = new HslColor(); - } - } -} diff --git a/Vendor/MechanikaDesign/ColorBox2D/MathExtensions.cs b/Vendor/MechanikaDesign/ColorBox2D/MathExtensions.cs deleted file mode 100644 index 96ef7ceb..00000000 --- a/Vendor/MechanikaDesign/ColorBox2D/MathExtensions.cs +++ /dev/null @@ -1,25 +0,0 @@ -using System; - -namespace MechanikaDesign.WinForms.UI.ColorPicker -{ - internal static class MathExtensions - { - public static int Round(double val) - { - int num = (int)val; - int num2 = (int)(val * 100.0); - if ((num2 % 100) >= 50) - { - num++; - } - return num; - } - - public static int LimitToRange(int value, int inclusiveMinimum, int inclusiveMaximum) - { - if (value < inclusiveMinimum) { return inclusiveMinimum; } - if (value > inclusiveMaximum) { return inclusiveMaximum; } - return value; - } - } -} diff --git a/Vendor/MechanikaDesign/ColorBox2D/Properties/AssemblyInfo.cs b/Vendor/MechanikaDesign/ColorBox2D/Properties/AssemblyInfo.cs deleted file mode 100644 index 427b5eb7..00000000 --- a/Vendor/MechanikaDesign/ColorBox2D/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("Mechanika Design Color Picker Controls")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("Mechanika Design Color Picker Controls Library")] -[assembly: AssemblyCopyright("Copyright © 2015 Mechanika Design")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("53782a11-f0b6-4d1f-8365-2078a4133dfa")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Vendor/MechanikaDesign/ColorHexagon/ColorHexagon.csproj b/Vendor/MechanikaDesign/ColorHexagon/ColorHexagon.csproj deleted file mode 100644 index 9dc09e84..00000000 --- a/Vendor/MechanikaDesign/ColorHexagon/ColorHexagon.csproj +++ /dev/null @@ -1,63 +0,0 @@ - - - - - Debug - AnyCPU - {ADC128AF-95A4-4BA9-B5D7-FE438E1E7A5C} - Library - Properties - ColorHexagon - ColorHexagon - v4.0 - 512 - - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - - - - - - - - - UserControl - - - ColorHexagon.cs - - - - - - - - \ No newline at end of file diff --git a/Vendor/MechanikaDesign/ColorHexagon/Properties/AssemblyInfo.cs b/Vendor/MechanikaDesign/ColorHexagon/Properties/AssemblyInfo.cs deleted file mode 100644 index 67efe5ac..00000000 --- a/Vendor/MechanikaDesign/ColorHexagon/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("ColorHexagon")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("ColorHexagon")] -[assembly: AssemblyCopyright("Copyright © 2015")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("d53138c7-6021-4516-ada2-197f71459161")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Vendor/MechanikaDesign/ColorPicker.Demo/App.config b/Vendor/MechanikaDesign/ColorPicker.Demo/App.config deleted file mode 100644 index 74ade9db..00000000 --- a/Vendor/MechanikaDesign/ColorPicker.Demo/App.config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/Vendor/MechanikaDesign/ColorPicker.Demo/ColorPicker.Demo.csproj b/Vendor/MechanikaDesign/ColorPicker.Demo/ColorPicker.Demo.csproj deleted file mode 100644 index 4479f43a..00000000 --- a/Vendor/MechanikaDesign/ColorPicker.Demo/ColorPicker.Demo.csproj +++ /dev/null @@ -1,99 +0,0 @@ - - - - - Debug - AnyCPU - {DF274AA1-5380-4B84-B9F5-FF66E6A1D37B} - WinExe - Properties - ColorPicker.Demo - ColorPicker.Demo - v4.0 - 512 - - - - AnyCPU - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - AnyCPU - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - - - - - - - - - - - - - Form - - - FormColorPickerDemo.cs - - - - - FormColorPickerDemo.cs - - - ResXFileCodeGenerator - Resources.Designer.cs - Designer - - - True - Resources.resx - True - - - SettingsSingleFileGenerator - Settings.Designer.cs - - - True - Settings.settings - True - - - - - - - - {38F99682-D013-4AE3-8334-4BF492A11FF9} - ColorPicker - - - - - \ No newline at end of file diff --git a/Vendor/MechanikaDesign/ColorPicker.Demo/FormColorPickerDemo.Designer.cs b/Vendor/MechanikaDesign/ColorPicker.Demo/FormColorPickerDemo.Designer.cs deleted file mode 100644 index f8d9bad4..00000000 --- a/Vendor/MechanikaDesign/ColorPicker.Demo/FormColorPickerDemo.Designer.cs +++ /dev/null @@ -1,412 +0,0 @@ -namespace ColorHexagon.Demo -{ - partial class FormColorPickerDemo - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Windows Form Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.labelCurrent = new System.Windows.Forms.Label(); - this.labelCurrentColor = new System.Windows.Forms.Label(); - this.labelHex = new System.Windows.Forms.Label(); - this.textboxHexColor = new System.Windows.Forms.TextBox(); - this.tabControlMain = new System.Windows.Forms.TabControl(); - this.tabHexagon = new System.Windows.Forms.TabPage(); - this.colorHexagon = new MechanikaDesign.WinForms.UI.ColorPicker.ColorHexagon(); - this.tabWheel = new System.Windows.Forms.TabPage(); - this.colorWheel = new MechanikaDesign.WinForms.UI.ColorPicker.ColorWheel(); - this.tabColorBox = new System.Windows.Forms.TabPage(); - this.numLuminance = new System.Windows.Forms.NumericUpDown(); - this.radioLuminance = new System.Windows.Forms.RadioButton(); - this.numSaturation = new System.Windows.Forms.NumericUpDown(); - this.radioSaturation = new System.Windows.Forms.RadioButton(); - this.numHue = new System.Windows.Forms.NumericUpDown(); - this.radioHue = new System.Windows.Forms.RadioButton(); - this.numBlue = new System.Windows.Forms.NumericUpDown(); - this.radioBlue = new System.Windows.Forms.RadioButton(); - this.numGreen = new System.Windows.Forms.NumericUpDown(); - this.radioGreen = new System.Windows.Forms.RadioButton(); - this.numRed = new System.Windows.Forms.NumericUpDown(); - this.radioRed = new System.Windows.Forms.RadioButton(); - this.colorSlider = new MechanikaDesign.WinForms.UI.ColorPicker.ColorSliderVertical(); - this.colorBox2D = new MechanikaDesign.WinForms.UI.ColorPicker.ColorBox2D(); - this.tabControlMain.SuspendLayout(); - this.tabHexagon.SuspendLayout(); - this.tabWheel.SuspendLayout(); - this.tabColorBox.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.numLuminance)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.numSaturation)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.numHue)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.numBlue)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.numGreen)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.numRed)).BeginInit(); - this.SuspendLayout(); - // - // labelCurrent - // - this.labelCurrent.AutoSize = true; - this.labelCurrent.Location = new System.Drawing.Point(448, 22); - this.labelCurrent.Name = "labelCurrent"; - this.labelCurrent.Size = new System.Drawing.Size(41, 13); - this.labelCurrent.TabIndex = 1; - this.labelCurrent.Text = "Current"; - // - // labelCurrentColor - // - this.labelCurrentColor.BackColor = System.Drawing.Color.White; - this.labelCurrentColor.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.labelCurrentColor.Location = new System.Drawing.Point(451, 39); - this.labelCurrentColor.Name = "labelCurrentColor"; - this.labelCurrentColor.Size = new System.Drawing.Size(68, 32); - this.labelCurrentColor.TabIndex = 2; - // - // labelHex - // - this.labelHex.AutoSize = true; - this.labelHex.Location = new System.Drawing.Point(448, 98); - this.labelHex.Name = "labelHex"; - this.labelHex.Size = new System.Drawing.Size(26, 13); - this.labelHex.TabIndex = 3; - this.labelHex.Text = "Hex"; - // - // textboxHexColor - // - this.textboxHexColor.Location = new System.Drawing.Point(451, 114); - this.textboxHexColor.Name = "textboxHexColor"; - this.textboxHexColor.ReadOnly = true; - this.textboxHexColor.Size = new System.Drawing.Size(68, 20); - this.textboxHexColor.TabIndex = 4; - this.textboxHexColor.Text = "FFFFFF"; - // - // tabControlMain - // - this.tabControlMain.Controls.Add(this.tabHexagon); - this.tabControlMain.Controls.Add(this.tabWheel); - this.tabControlMain.Controls.Add(this.tabColorBox); - this.tabControlMain.Dock = System.Windows.Forms.DockStyle.Left; - this.tabControlMain.Location = new System.Drawing.Point(0, 0); - this.tabControlMain.Name = "tabControlMain"; - this.tabControlMain.SelectedIndex = 0; - this.tabControlMain.Size = new System.Drawing.Size(427, 370); - this.tabControlMain.TabIndex = 5; - // - // tabHexagon - // - this.tabHexagon.Controls.Add(this.colorHexagon); - this.tabHexagon.Location = new System.Drawing.Point(4, 22); - this.tabHexagon.Name = "tabHexagon"; - this.tabHexagon.Padding = new System.Windows.Forms.Padding(3); - this.tabHexagon.Size = new System.Drawing.Size(419, 344); - this.tabHexagon.TabIndex = 0; - this.tabHexagon.Text = "Color Hexagon"; - this.tabHexagon.UseVisualStyleBackColor = true; - // - // colorHexagon - // - this.colorHexagon.Dock = System.Windows.Forms.DockStyle.Fill; - this.colorHexagon.Location = new System.Drawing.Point(3, 3); - this.colorHexagon.Name = "colorHexagon"; - this.colorHexagon.Size = new System.Drawing.Size(413, 338); - this.colorHexagon.TabIndex = 1; - this.colorHexagon.ColorChanged += new MechanikaDesign.WinForms.UI.ColorPicker.ColorHexagon.ColorChangedEventHandler(this.colorHexagon_ColorChanged); - // - // tabWheel - // - this.tabWheel.Controls.Add(this.colorWheel); - this.tabWheel.Location = new System.Drawing.Point(4, 22); - this.tabWheel.Name = "tabWheel"; - this.tabWheel.Padding = new System.Windows.Forms.Padding(3); - this.tabWheel.Size = new System.Drawing.Size(419, 344); - this.tabWheel.TabIndex = 1; - this.tabWheel.Text = "Color Wheel"; - this.tabWheel.UseVisualStyleBackColor = true; - // - // colorWheel - // - this.colorWheel.Color = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(255))))); - this.colorWheel.Dock = System.Windows.Forms.DockStyle.Fill; - this.colorWheel.Location = new System.Drawing.Point(3, 3); - this.colorWheel.Name = "colorWheel"; - this.colorWheel.Size = new System.Drawing.Size(413, 338); - this.colorWheel.TabIndex = 0; - this.colorWheel.ColorChanged += new System.EventHandler(this.colorWheel_ColorChanged); - // - // tabColorBox - // - this.tabColorBox.Controls.Add(this.numLuminance); - this.tabColorBox.Controls.Add(this.radioLuminance); - this.tabColorBox.Controls.Add(this.numSaturation); - this.tabColorBox.Controls.Add(this.radioSaturation); - this.tabColorBox.Controls.Add(this.numHue); - this.tabColorBox.Controls.Add(this.radioHue); - this.tabColorBox.Controls.Add(this.numBlue); - this.tabColorBox.Controls.Add(this.radioBlue); - this.tabColorBox.Controls.Add(this.numGreen); - this.tabColorBox.Controls.Add(this.radioGreen); - this.tabColorBox.Controls.Add(this.numRed); - this.tabColorBox.Controls.Add(this.radioRed); - this.tabColorBox.Controls.Add(this.colorSlider); - this.tabColorBox.Controls.Add(this.colorBox2D); - this.tabColorBox.Location = new System.Drawing.Point(4, 22); - this.tabColorBox.Name = "tabColorBox"; - this.tabColorBox.Padding = new System.Windows.Forms.Padding(3); - this.tabColorBox.Size = new System.Drawing.Size(419, 344); - this.tabColorBox.TabIndex = 2; - this.tabColorBox.Text = "Color Box & Slider"; - this.tabColorBox.UseVisualStyleBackColor = true; - // - // numLuminance - // - this.numLuminance.Location = new System.Drawing.Point(349, 165); - this.numLuminance.Name = "numLuminance"; - this.numLuminance.Size = new System.Drawing.Size(54, 20); - this.numLuminance.TabIndex = 13; - this.numLuminance.Value = new decimal(new int[] { - 100, - 0, - 0, - 0}); - this.numLuminance.ValueChanged += new System.EventHandler(this.numLuminance_ValueChanged); - // - // radioLuminance - // - this.radioLuminance.AutoSize = true; - this.radioLuminance.Location = new System.Drawing.Point(306, 165); - this.radioLuminance.Name = "radioLuminance"; - this.radioLuminance.Size = new System.Drawing.Size(34, 17); - this.radioLuminance.TabIndex = 12; - this.radioLuminance.Text = "L:"; - this.radioLuminance.UseVisualStyleBackColor = true; - this.radioLuminance.CheckedChanged += new System.EventHandler(this.ColorModeChangedHandler); - // - // numSaturation - // - this.numSaturation.Location = new System.Drawing.Point(349, 139); - this.numSaturation.Name = "numSaturation"; - this.numSaturation.Size = new System.Drawing.Size(54, 20); - this.numSaturation.TabIndex = 11; - this.numSaturation.Value = new decimal(new int[] { - 100, - 0, - 0, - 0}); - this.numSaturation.ValueChanged += new System.EventHandler(this.numSaturation_ValueChanged); - // - // radioSaturation - // - this.radioSaturation.AutoSize = true; - this.radioSaturation.Location = new System.Drawing.Point(306, 139); - this.radioSaturation.Name = "radioSaturation"; - this.radioSaturation.Size = new System.Drawing.Size(35, 17); - this.radioSaturation.TabIndex = 10; - this.radioSaturation.Text = "S:"; - this.radioSaturation.UseVisualStyleBackColor = true; - this.radioSaturation.CheckedChanged += new System.EventHandler(this.ColorModeChangedHandler); - // - // numHue - // - this.numHue.Location = new System.Drawing.Point(349, 113); - this.numHue.Maximum = new decimal(new int[] { - 359, - 0, - 0, - 0}); - this.numHue.Name = "numHue"; - this.numHue.Size = new System.Drawing.Size(54, 20); - this.numHue.TabIndex = 9; - this.numHue.ValueChanged += new System.EventHandler(this.numHue_ValueChanged); - // - // radioHue - // - this.radioHue.AutoSize = true; - this.radioHue.Checked = true; - this.radioHue.Location = new System.Drawing.Point(306, 113); - this.radioHue.Name = "radioHue"; - this.radioHue.Size = new System.Drawing.Size(36, 17); - this.radioHue.TabIndex = 8; - this.radioHue.TabStop = true; - this.radioHue.Text = "H:"; - this.radioHue.UseVisualStyleBackColor = true; - this.radioHue.CheckedChanged += new System.EventHandler(this.ColorModeChangedHandler); - // - // numBlue - // - this.numBlue.Location = new System.Drawing.Point(349, 69); - this.numBlue.Maximum = new decimal(new int[] { - 255, - 0, - 0, - 0}); - this.numBlue.Name = "numBlue"; - this.numBlue.Size = new System.Drawing.Size(54, 20); - this.numBlue.TabIndex = 7; - this.numBlue.ValueChanged += new System.EventHandler(this.numBlue_ValueChanged); - // - // radioBlue - // - this.radioBlue.AutoSize = true; - this.radioBlue.Location = new System.Drawing.Point(306, 69); - this.radioBlue.Name = "radioBlue"; - this.radioBlue.Size = new System.Drawing.Size(35, 17); - this.radioBlue.TabIndex = 6; - this.radioBlue.Text = "B:"; - this.radioBlue.UseVisualStyleBackColor = true; - this.radioBlue.CheckedChanged += new System.EventHandler(this.ColorModeChangedHandler); - // - // numGreen - // - this.numGreen.Location = new System.Drawing.Point(349, 43); - this.numGreen.Maximum = new decimal(new int[] { - 255, - 0, - 0, - 0}); - this.numGreen.Name = "numGreen"; - this.numGreen.Size = new System.Drawing.Size(54, 20); - this.numGreen.TabIndex = 5; - this.numGreen.ValueChanged += new System.EventHandler(this.numGreen_ValueChanged); - // - // radioGreen - // - this.radioGreen.AutoSize = true; - this.radioGreen.Location = new System.Drawing.Point(306, 43); - this.radioGreen.Name = "radioGreen"; - this.radioGreen.Size = new System.Drawing.Size(36, 17); - this.radioGreen.TabIndex = 4; - this.radioGreen.Text = "G:"; - this.radioGreen.UseVisualStyleBackColor = true; - this.radioGreen.CheckedChanged += new System.EventHandler(this.ColorModeChangedHandler); - // - // numRed - // - this.numRed.Location = new System.Drawing.Point(349, 17); - this.numRed.Maximum = new decimal(new int[] { - 255, - 0, - 0, - 0}); - this.numRed.Name = "numRed"; - this.numRed.Size = new System.Drawing.Size(54, 20); - this.numRed.TabIndex = 3; - this.numRed.Value = new decimal(new int[] { - 255, - 0, - 0, - 0}); - this.numRed.ValueChanged += new System.EventHandler(this.numRed_ValueChanged); - // - // radioRed - // - this.radioRed.AutoSize = true; - this.radioRed.Location = new System.Drawing.Point(306, 17); - this.radioRed.Name = "radioRed"; - this.radioRed.Size = new System.Drawing.Size(36, 17); - this.radioRed.TabIndex = 2; - this.radioRed.Text = "R:"; - this.radioRed.UseVisualStyleBackColor = true; - this.radioRed.CheckedChanged += new System.EventHandler(this.ColorModeChangedHandler); - // - // colorSlider - // - this.colorSlider.ColorMode = MechanikaDesign.WinForms.UI.ColorPicker.ColorModes.Hue; - this.colorSlider.ColorRGB = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); - this.colorSlider.Location = new System.Drawing.Point(259, 8); - this.colorSlider.Name = "colorSlider"; - this.colorSlider.NubColor = System.Drawing.Color.White; - this.colorSlider.Position = 142; - this.colorSlider.Size = new System.Drawing.Size(40, 252); - this.colorSlider.TabIndex = 1; - this.colorSlider.ColorChanged += new MechanikaDesign.WinForms.UI.ColorPicker.ColorSliderVertical.ColorChangedEventHandler(this.colorSlider_ColorChanged); - // - // colorBox2D - // - this.colorBox2D.ColorMode = MechanikaDesign.WinForms.UI.ColorPicker.ColorModes.Hue; - this.colorBox2D.ColorRGB = System.Drawing.Color.Red; - this.colorBox2D.Location = new System.Drawing.Point(8, 8); - this.colorBox2D.Name = "colorBox2D"; - this.colorBox2D.Size = new System.Drawing.Size(245, 252); - this.colorBox2D.TabIndex = 0; - this.colorBox2D.ColorChanged += new MechanikaDesign.WinForms.UI.ColorPicker.ColorBox2D.ColorChangedEventHandler(this.colorBox2D_ColorChanged); - // - // FormColorPickerDemo - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(535, 370); - this.Controls.Add(this.tabControlMain); - this.Controls.Add(this.textboxHexColor); - this.Controls.Add(this.labelHex); - this.Controls.Add(this.labelCurrentColor); - this.Controls.Add(this.labelCurrent); - this.MaximizeBox = false; - this.Name = "FormColorPickerDemo"; - this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; - this.Text = "Color Picker UI Control Demo"; - this.tabControlMain.ResumeLayout(false); - this.tabHexagon.ResumeLayout(false); - this.tabWheel.ResumeLayout(false); - this.tabColorBox.ResumeLayout(false); - this.tabColorBox.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.numLuminance)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.numSaturation)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.numHue)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.numBlue)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.numGreen)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.numRed)).EndInit(); - this.ResumeLayout(false); - this.PerformLayout(); - - } - - #endregion - - private System.Windows.Forms.Label labelCurrent; - private System.Windows.Forms.Label labelCurrentColor; - private System.Windows.Forms.Label labelHex; - private System.Windows.Forms.TextBox textboxHexColor; - private System.Windows.Forms.TabControl tabControlMain; - private System.Windows.Forms.TabPage tabHexagon; - private MechanikaDesign.WinForms.UI.ColorPicker.ColorHexagon colorHexagon; - private System.Windows.Forms.TabPage tabWheel; - private MechanikaDesign.WinForms.UI.ColorPicker.ColorWheel colorWheel; - private System.Windows.Forms.TabPage tabColorBox; - private MechanikaDesign.WinForms.UI.ColorPicker.ColorBox2D colorBox2D; - private MechanikaDesign.WinForms.UI.ColorPicker.ColorSliderVertical colorSlider; - private System.Windows.Forms.NumericUpDown numBlue; - private System.Windows.Forms.RadioButton radioBlue; - private System.Windows.Forms.NumericUpDown numGreen; - private System.Windows.Forms.RadioButton radioGreen; - private System.Windows.Forms.NumericUpDown numRed; - private System.Windows.Forms.RadioButton radioRed; - private System.Windows.Forms.NumericUpDown numLuminance; - private System.Windows.Forms.RadioButton radioLuminance; - private System.Windows.Forms.NumericUpDown numSaturation; - private System.Windows.Forms.RadioButton radioSaturation; - private System.Windows.Forms.NumericUpDown numHue; - private System.Windows.Forms.RadioButton radioHue; - - } -} - diff --git a/Vendor/MechanikaDesign/ColorPicker.Demo/FormColorPickerDemo.cs b/Vendor/MechanikaDesign/ColorPicker.Demo/FormColorPickerDemo.cs deleted file mode 100644 index ba14a936..00000000 --- a/Vendor/MechanikaDesign/ColorPicker.Demo/FormColorPickerDemo.cs +++ /dev/null @@ -1,196 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Forms; -using MechanikaDesign.WinForms.UI.ColorPicker; - -namespace ColorHexagon.Demo -{ - public partial class FormColorPickerDemo : Form - { - #region Fields - - private HslColor colorHsl = HslColor.FromAhsl(0xff); - private ColorModes colorMode = ColorModes.Hue; - private Color colorRgb = Color.Empty; - private bool lockUpdates = false; - - #endregion - - public FormColorPickerDemo() - { - InitializeComponent(); - this.colorBox2D.ColorMode = this.colorMode; - this.colorSlider.ColorMode = this.colorMode; - } - - private void colorHexagon_ColorChanged(object sender, ColorChangedEventArgs args) - { - labelCurrentColor.BackColor = colorHexagon.SelectedColor; - textboxHexColor.Text = ColorTranslator.ToHtml(colorHexagon.SelectedColor); - } - - private void colorWheel_ColorChanged(object sender, EventArgs e) - { - labelCurrentColor.BackColor = colorWheel.Color; - textboxHexColor.Text = ColorTranslator.ToHtml(colorWheel.Color); - } - - private void colorSlider_ColorChanged(object sender, ColorChangedEventArgs args) - { - if (!this.lockUpdates) - { - HslColor colorHSL = this.colorSlider.ColorHSL; - this.colorHsl = colorHSL; - this.colorRgb = this.colorHsl.RgbValue; - this.lockUpdates = true; - this.colorBox2D.ColorHSL = this.colorHsl; - this.lockUpdates = false; - labelCurrentColor.BackColor = this.colorRgb; - textboxHexColor.Text = ColorTranslator.ToHtml(this.colorRgb); - UpdateColorFields(); - } - } - - private void colorBox2D_ColorChanged(object sender, ColorChangedEventArgs args) - { - if (!this.lockUpdates) - { - HslColor colorHSL = this.colorBox2D.ColorHSL; - this.colorHsl = colorHSL; - this.colorRgb = this.colorHsl.RgbValue; - this.lockUpdates = true; - this.colorSlider.ColorHSL = this.colorHsl; - this.lockUpdates = false; - labelCurrentColor.BackColor = this.colorRgb; - textboxHexColor.Text = ColorTranslator.ToHtml(this.colorRgb); - UpdateColorFields(); - } - } - - private void ColorModeChangedHandler(object sender, EventArgs e) - { - if (sender == this.radioRed) - { - this.colorMode = ColorModes.Red; - } - else if (sender == this.radioGreen) - { - this.colorMode = ColorModes.Green; - } - else if (sender == this.radioBlue) - { - this.colorMode = ColorModes.Blue; - } - else if (sender == this.radioHue) - { - this.colorMode = ColorModes.Hue; - } - else if (sender == this.radioSaturation) - { - this.colorMode = ColorModes.Saturation; - } - else if (sender == this.radioLuminance) - { - this.colorMode = ColorModes.Luminance; - } - this.colorSlider.ColorMode = this.colorMode; - this.colorBox2D.ColorMode = this.colorMode; - } - - private void UpdateColorFields() - { - this.lockUpdates = true; - this.numRed.Value = this.colorRgb.R; - this.numGreen.Value = this.colorRgb.G; - this.numBlue.Value = this.colorRgb.B; - this.numHue.Value = (int)(((decimal)this.colorHsl.H) * 360M); - this.numSaturation.Value = (int)(((decimal)this.colorHsl.S) * 100M); - this.numLuminance.Value = (int)(((decimal)this.colorHsl.L) * 100M); - this.lockUpdates = false; - } - - private void UpdateRgbFields(Color newColor) - { - this.colorHsl = HslColor.FromColor(newColor); - this.colorRgb = newColor; - this.lockUpdates = true; - this.numHue.Value = (int)(((decimal)this.colorHsl.H) * 360M); - this.numSaturation.Value = (int)(((decimal)this.colorHsl.S) * 100M); - this.numLuminance.Value = (int)(((decimal)this.colorHsl.L) * 100M); - this.lockUpdates = false; - this.colorSlider.ColorHSL = this.colorHsl; - this.colorBox2D.ColorHSL = this.colorHsl; - } - - private void UpdateHslFields(HslColor newColor) - { - this.colorHsl = newColor; - this.colorRgb = newColor.RgbValue; - this.lockUpdates = true; - this.numRed.Value = this.colorRgb.R; - this.numGreen.Value = this.colorRgb.G; - this.numBlue.Value = this.colorRgb.B; - this.lockUpdates = false; - this.colorSlider.ColorHSL = this.colorHsl; - this.colorBox2D.ColorHSL = this.colorHsl; - } - - private void numRed_ValueChanged(object sender, EventArgs e) - { - if (!this.lockUpdates) - { - UpdateRgbFields(Color.FromArgb((int)this.numRed.Value, (int)this.numGreen.Value, (int)this.numBlue.Value)); - } - } - - private void numGreen_ValueChanged(object sender, EventArgs e) - { - if (!this.lockUpdates) - { - UpdateRgbFields(Color.FromArgb((int)this.numRed.Value, (int)this.numGreen.Value, (int)this.numBlue.Value)); - } - } - - private void numBlue_ValueChanged(object sender, EventArgs e) - { - if (!this.lockUpdates) - { - UpdateRgbFields(Color.FromArgb((int)this.numRed.Value, (int)this.numGreen.Value, (int)this.numBlue.Value)); - } - } - - private void numHue_ValueChanged(object sender, EventArgs e) - { - if (!this.lockUpdates) - { - HslColor newColor = HslColor.FromAhsl((double)(((float)((int)this.numHue.Value)) / 360f), this.colorHsl.S, this.colorHsl.L); - this.UpdateHslFields(newColor); - } - } - - private void numSaturation_ValueChanged(object sender, EventArgs e) - { - if (!this.lockUpdates) - { - HslColor newColor = HslColor.FromAhsl(this.colorHsl.A, this.colorHsl.H, (double)(((float)((int)this.numSaturation.Value)) / 100f), this.colorHsl.L); - this.UpdateHslFields(newColor); - } - - } - - private void numLuminance_ValueChanged(object sender, EventArgs e) - { - if (!this.lockUpdates) - { - HslColor newColor = HslColor.FromAhsl(this.colorHsl.A, this.colorHsl.H, this.colorHsl.S, (double)(((float)((int)this.numLuminance.Value)) / 100f)); - this.UpdateHslFields(newColor); - } - } - } -} diff --git a/Vendor/MechanikaDesign/ColorPicker.Demo/FormColorPickerDemo.resx b/Vendor/MechanikaDesign/ColorPicker.Demo/FormColorPickerDemo.resx deleted file mode 100644 index 1af7de15..00000000 --- a/Vendor/MechanikaDesign/ColorPicker.Demo/FormColorPickerDemo.resx +++ /dev/null @@ -1,120 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/Vendor/MechanikaDesign/ColorPicker.Demo/Program.cs b/Vendor/MechanikaDesign/ColorPicker.Demo/Program.cs deleted file mode 100644 index 51cc771b..00000000 --- a/Vendor/MechanikaDesign/ColorPicker.Demo/Program.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using System.Windows.Forms; - -namespace ColorHexagon.Demo -{ - static class Program - { - /// - /// The main entry point for the application. - /// - [STAThread] - static void Main() - { - Application.EnableVisualStyles(); - Application.SetCompatibleTextRenderingDefault(false); - Application.Run(new FormColorPickerDemo()); - } - } -} diff --git a/Vendor/MechanikaDesign/ColorPicker.Demo/Properties/AssemblyInfo.cs b/Vendor/MechanikaDesign/ColorPicker.Demo/Properties/AssemblyInfo.cs deleted file mode 100644 index 34e5af2b..00000000 --- a/Vendor/MechanikaDesign/ColorPicker.Demo/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("Color Picker Controls Demonstration")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("Mechanika Design Color Picker Controls Library")] -[assembly: AssemblyCopyright("Copyright © 2015 Mechanika Design")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("9cefab06-ff46-44ec-867f-50faeb88222a")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Vendor/MechanikaDesign/ColorPicker.Demo/Properties/Resources.Designer.cs b/Vendor/MechanikaDesign/ColorPicker.Demo/Properties/Resources.Designer.cs deleted file mode 100644 index 49e20c84..00000000 --- a/Vendor/MechanikaDesign/ColorPicker.Demo/Properties/Resources.Designer.cs +++ /dev/null @@ -1,63 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.34209 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace ColorPicker.Demo.Properties { - using System; - - - /// - /// A strongly-typed resource class, for looking up localized strings, etc. - /// - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Resources { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal Resources() { - } - - /// - /// Returns the cached ResourceManager instance used by this class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager { - get { - if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ColorPicker.Demo.Properties.Resources", typeof(Resources).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture { - get { - return resourceCulture; - } - set { - resourceCulture = value; - } - } - } -} diff --git a/Vendor/MechanikaDesign/ColorPicker.Demo/Properties/Resources.resx b/Vendor/MechanikaDesign/ColorPicker.Demo/Properties/Resources.resx deleted file mode 100644 index af7dbebb..00000000 --- a/Vendor/MechanikaDesign/ColorPicker.Demo/Properties/Resources.resx +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/Vendor/MechanikaDesign/ColorPicker.Demo/Properties/Settings.Designer.cs b/Vendor/MechanikaDesign/ColorPicker.Demo/Properties/Settings.Designer.cs deleted file mode 100644 index 0ac9ff03..00000000 --- a/Vendor/MechanikaDesign/ColorPicker.Demo/Properties/Settings.Designer.cs +++ /dev/null @@ -1,26 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.34209 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace ColorPicker.Demo.Properties { - - - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "12.0.0.0")] - internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { - - private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); - - public static Settings Default { - get { - return defaultInstance; - } - } - } -} diff --git a/Vendor/MechanikaDesign/ColorPicker.Demo/Properties/Settings.settings b/Vendor/MechanikaDesign/ColorPicker.Demo/Properties/Settings.settings deleted file mode 100644 index 39645652..00000000 --- a/Vendor/MechanikaDesign/ColorPicker.Demo/Properties/Settings.settings +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/Vendor/MechanikaDesign/ColorPickerControls.sln b/Vendor/MechanikaDesign/ColorPickerControls.sln deleted file mode 100644 index 95194a5a..00000000 --- a/Vendor/MechanikaDesign/ColorPickerControls.sln +++ /dev/null @@ -1,28 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2013 -VisualStudioVersion = 12.0.31101.0 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ColorPicker.Demo", "ColorPicker.Demo\ColorPicker.Demo.csproj", "{DF274AA1-5380-4B84-B9F5-FF66E6A1D37B}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ColorPicker", "ColorBox2D\ColorPicker.csproj", "{38F99682-D013-4AE3-8334-4BF492A11FF9}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {DF274AA1-5380-4B84-B9F5-FF66E6A1D37B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {DF274AA1-5380-4B84-B9F5-FF66E6A1D37B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {DF274AA1-5380-4B84-B9F5-FF66E6A1D37B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {DF274AA1-5380-4B84-B9F5-FF66E6A1D37B}.Release|Any CPU.Build.0 = Release|Any CPU - {38F99682-D013-4AE3-8334-4BF492A11FF9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {38F99682-D013-4AE3-8334-4BF492A11FF9}.Debug|Any CPU.Build.0 = Debug|Any CPU - {38F99682-D013-4AE3-8334-4BF492A11FF9}.Release|Any CPU.ActiveCfg = Release|Any CPU - {38F99682-D013-4AE3-8334-4BF492A11FF9}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/Vendor/MechanikaDesign/ColorWheel/ColorHelper.cs b/Vendor/MechanikaDesign/ColorWheel/ColorHelper.cs deleted file mode 100644 index 4911b025..00000000 --- a/Vendor/MechanikaDesign/ColorWheel/ColorHelper.cs +++ /dev/null @@ -1,122 +0,0 @@ -using System; -using System.ComponentModel; -using System.Drawing; -using System.Runtime.InteropServices; - -namespace MechanikaDesign.WinForms.UI.ColorPicker -{ - public static class ColorHelper - { - // r,g,b values are from 0 to 1 - // h = [0,360], s = [0,1], v = [0,1] - // if s == 0, then h = -1 (undefined) - /// - /// Generates the Hue, Saturation, and Value for a given color - /// - /// The Color to generate the values for - /// Out value for Hue - /// Out value for Saturation - /// Out value for Value - public static void HSVFromRGB(Color color, out double hue, out double saturation, out double value) - { - double min, max, delta, r, g, b; - r = (double)color.R / 255d; - g = (double)color.G / 255d; - b = (double)color.B / 255d; - - min = Math.Min(r, Math.Min(g, b)); - max = Math.Max(r, Math.Max(g, b)); - value = max; // v - delta = max - min; - if (max != 0) - saturation = delta / max; // s - else - { - // r = g = b = 0 // s = 0, v is undefined - saturation = 0; - hue = -1; - return; - } - if (r == max) - hue = (g - b) / delta; // between yellow & magenta - else if (g == max) - hue = 2 + (b - r) / delta; // between cyan & yellow - else - hue = 4 + (r - g) / delta; // between magenta & cyan - hue *= 60; // degrees - if (hue < 0) - hue += 360; - } - - - /// - /// Generates a Color from a Hue, Saturation, and Value combination - /// - /// Hue to use for the Color. (Max 360) - /// Saturation to use for the Color. (Max 1.0) - /// Value to use for the Color. (Max 1.0) - /// Generated Color - public static Color ColorFromHSV(double hue, double saturation, double value) - { - try - { - int i; - double f, p, q, t, r, g, b; - - if (saturation == 0) - { - // achromatic (grey) - r = g = b = value; - return Color.FromArgb((int)(255 * r), (int)(255 * g), (int)(255 * b)); - } - hue /= 60; // sector 0 to 5 - i = (int)Math.Floor(hue); - f = hue - i; // factorial part of h - p = value * (1 - saturation); - q = value * (1 - saturation * f); - t = value * (1 - saturation * (1 - f)); - switch (i) - { - case 0: - r = value; - g = t; - b = p; - break; - case 1: - r = q; - g = value; - b = p; - break; - case 2: - r = p; - g = value; - b = t; - break; - case 3: - r = p; - g = q; - b = value; - break; - case 4: - r = t; - g = p; - b = value; - break; - default: // case 5: - r = value; - g = p; - b = q; - break; - } - return Color.FromArgb((int)(255 * r), (int)(255 * g), (int)(255 * b)); - } - catch - { - - } - return Color.Empty; - } - - - } -} diff --git a/Vendor/MechanikaDesign/ColorWheel/ColorWheel.cs b/Vendor/MechanikaDesign/ColorWheel/ColorWheel.cs deleted file mode 100644 index eb6a8874..00000000 --- a/Vendor/MechanikaDesign/ColorWheel/ColorWheel.cs +++ /dev/null @@ -1,884 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Drawing; -using System.Drawing.Drawing2D; -using System.Data; -using System.Windows.Forms; - -namespace MechanikaDesign.WinForms.UI.ColorPicker -{ - - [DefaultProperty("Color")] - [DefaultEvent("ColorChanged")] - public partial class ColorWheel: Control - { - private const int PADDING = 10; - private const int INNER_RADIUS = 200; - private const int OUTER_RADIUS = INNER_RADIUS + 50; - - #region Fields - - private Brush _brush; - private PointF _centerPoint; - private Color _color; - private int _colorStep; - private bool _dragStartedWithinWheel; - private HslColor _hslColor; - private int _largeChange; - private float _radius; - private int _selectionSize; - private int _smallChange; - private int _updateCount; - - #endregion - - #region Constructors - - /// - /// Initializes a new instance of the class. - /// - public ColorWheel() - { - this.SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint | ControlStyles.OptimizedDoubleBuffer | ControlStyles.Selectable | ControlStyles.StandardClick | ControlStyles.StandardDoubleClick, true); - this.Color = Color.Black; - this.ColorStep = 4; - this.SelectionSize = 10; - this.SmallChange = 1; - this.LargeChange = 5; - this.SelectionGlyph = this.CreateSelectionGlyph(); - } - - #endregion - - #region Events - - /// - /// Occurs when the Color property value changes - /// - [Category("Property Changed")] - public event EventHandler ColorChanged; - - /// - /// Occurs when the ColorStep property value changes - /// - [Category("Property Changed")] - public event EventHandler ColorStepChanged; - - /// - /// Occurs when the HslColor property value changes - /// - [Category("Property Changed")] - public event EventHandler HslColorChanged; - - /// - /// Occurs when the LargeChange property value changes - /// - [Category("Property Changed")] - public event EventHandler LargeChangeChanged; - - /// - /// Occurs when the SelectionSize property value changes - /// - [Category("Property Changed")] - public event EventHandler SelectionSizeChanged; - - /// - /// Occurs when the SmallChange property value changes - /// - [Category("Property Changed")] - public event EventHandler SmallChangeChanged; - - #endregion - - #region Overridden Methods - /// - /// Releases the unmanaged resources used by the and its child controls and optionally releases the managed resources. - /// - /// true to release both managed and unmanaged resources; false to release only unmanaged resources. - protected override void Dispose(bool disposing) - { - if (disposing) - { - if (_brush != null) - { - _brush.Dispose(); - } - - if (this.SelectionGlyph != null) - { - this.SelectionGlyph.Dispose(); - } - } - - base.Dispose(disposing); - } - - /// - /// Determines whether the specified key is a regular input key or a special key that requires preprocessing. - /// - /// One of the values. - /// true if the specified key is a regular input key; otherwise, false. - protected override bool IsInputKey(Keys keyData) - { - bool result; - - if ((keyData & Keys.Left) == Keys.Left || (keyData & Keys.Up) == Keys.Up || (keyData & Keys.Down) == Keys.Down || (keyData & Keys.Right) == Keys.Right || (keyData & Keys.PageUp) == Keys.PageUp || (keyData & Keys.PageDown) == Keys.PageDown) - { - result = true; - } - else - { - result = base.IsInputKey(keyData); - } - - return result; - } - /// - /// Raises the event. - /// - /// An that contains the event data. - protected override void OnGotFocus(EventArgs e) - { - base.OnGotFocus(e); - - this.Invalidate(); - } - - /// - /// Raises the event. - /// - /// A that contains the event data. - protected override void OnKeyDown(KeyEventArgs e) - { - HslColor color; - double hue; - int step; - - color = this.HslColor; - hue = color.H; - - step = e.Shift ? this.LargeChange : this.SmallChange; - - switch (e.KeyCode) - { - case Keys.Right: - case Keys.Up: - hue += step; - break; - case Keys.Left: - case Keys.Down: - hue -= step; - break; - case Keys.PageUp: - hue += this.LargeChange; - break; - case Keys.PageDown: - hue -= this.LargeChange; - break; - } - - if (hue >= 360) - { - hue = 0; - } - if (hue < 0) - { - hue = 359; - } - - if (hue != color.H) - { - color.H = hue; - - // As the Color and HslColor properties update each other, need to temporarily disable this and manually set both - // otherwise the wheel "sticks" due to imprecise conversion from RGB to HSL - this.LockUpdates = true; - this.Color = color.ToRgbColor(); - this.HslColor = color; - this.LockUpdates = false; - - e.Handled = true; - } - - base.OnKeyDown(e); - } - - /// - /// Raises the event. - /// - /// An that contains the event data. - protected override void OnLostFocus(EventArgs e) - { - base.OnLostFocus(e); - - this.Invalidate(); - } - - /// - /// Raises the event. - /// - /// A that contains the event data. - protected override void OnMouseDown(MouseEventArgs e) - { - base.OnMouseDown(e); - - if (!this.Focused && this.TabStop) - { - this.Focus(); - } - - if (e.Button == MouseButtons.Left && this.IsPointInWheel(e.Location)) - { - _dragStartedWithinWheel = true; - this.SetColor(e.Location); - } - } - - /// - /// Raises the event. - /// - /// A that contains the event data. - protected override void OnMouseMove(MouseEventArgs e) - { - base.OnMouseMove(e); - - if (e.Button == MouseButtons.Left && _dragStartedWithinWheel) - { - this.SetColor(e.Location); - } - } - - /// - /// Raises the event. - /// - /// A that contains the event data. - protected override void OnMouseUp(MouseEventArgs e) - { - base.OnMouseUp(e); - - _dragStartedWithinWheel = false; - } - - /// - /// Raises the event. - /// - /// A that contains the event data. - protected override void OnPaddingChanged(EventArgs e) - { - base.OnPaddingChanged(e); - - this.RefreshWheel(); - } - - /// - /// Raises the event. - /// - /// A that contains the event data. - protected override void OnPaint(PaintEventArgs e) - { - base.OnPaint(e); - - if (this.AllowPainting) - { - base.OnPaintBackground(e); - - if (this.BackgroundImage == null && this.Parent != null && (this.BackColor == this.Parent.BackColor || this.Parent.BackColor.A != 255)) - { - ButtonRenderer.DrawParentBackground(e.Graphics, this.DisplayRectangle, this); - } - - if (_brush != null) - { - e.Graphics.FillPie(_brush, this.ClientRectangle, 0, 360); - } - - // smooth out the edge of the wheel - e.Graphics.SmoothingMode = SmoothingMode.AntiAlias; - using (Pen pen = new Pen(this.BackColor, 2)) - { - e.Graphics.DrawEllipse(pen, new RectangleF(_centerPoint.X - _radius, _centerPoint.Y - _radius, _radius * 2, _radius * 2)); - } - - if (!this.Color.IsEmpty) - { - this.PaintCurrentColor(e); - } - } - } - - /// - /// Raises the event. - /// - /// An that contains the event data. - protected override void OnResize(EventArgs e) - { - base.OnResize(e); - - this.RefreshWheel(); - } - - #endregion - - #region Public Properties - - /// - /// Gets or sets the component color. - /// - /// The component color. - [Category("Appearance")] - [DefaultValue(typeof(Color), "Black")] - public virtual Color Color - { - get { return _color; } - set - { - if (this.Color != value) - { - _color = value; - - this.OnColorChanged(EventArgs.Empty); - } - } - } - - /// - /// Gets or sets the increment for rendering the color wheel. - /// - /// The color step. - /// Value must be between 1 and 359 - [Category("Appearance")] - [DefaultValue(4)] - public virtual int ColorStep - { - get { return _colorStep; } - set - { - if (value < 1 || value > 359) - { - throw new ArgumentOutOfRangeException("value", value, "Value must be between 1 and 359"); - } - - if (this.ColorStep != value) - { - _colorStep = value; - - this.OnColorStepChanged(EventArgs.Empty); - } - } - } - - /// - /// Gets or sets the component color. - /// - /// The component color. - [Category("Appearance")] - [DefaultValue(typeof(HslColor), "0, 0, 0")] - [Browsable(false) /* disable editing until I write a proper type convertor */] - [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] - public virtual HslColor HslColor - { - get { return _hslColor; } - set - { - if (this.HslColor != value) - { - _hslColor = value; - - this.OnHslColorChanged(EventArgs.Empty); - } - } - } - - /// - /// Gets or sets a value to be added to or subtracted from the property when the wheel selection is moved a large distance. - /// - /// A numeric value. The default value is 5. - [Category("Behavior")] - [DefaultValue(5)] - public virtual int LargeChange - { - get { return _largeChange; } - set - { - if (this.LargeChange != value) - { - _largeChange = value; - - this.OnLargeChangeChanged(EventArgs.Empty); - } - } - } - - /// - /// Gets or sets the size of the selection handle. - /// - /// The size of the selection handle. - [Category("Appearance")] - [DefaultValue(10)] - public virtual int SelectionSize - { - get { return _selectionSize; } - set - { - if (this.SelectionSize != value) - { - _selectionSize = value; - - this.OnSelectionSizeChanged(EventArgs.Empty); - } - } - } - - /// - /// Gets or sets a value to be added to or subtracted from the property when the wheel selection is moved a small distance. - /// - /// A numeric value. The default value is 1. - [Category("Behavior")] - [DefaultValue(1)] - public virtual int SmallChange - { - get { return _smallChange; } - set - { - if (this.SmallChange != value) - { - _smallChange = value; - - this.OnSmallChangeChanged(EventArgs.Empty); - } - } - } - - #endregion - - #region Protected Properties - - /// - /// Gets a value indicating whether painting of the control is allowed. - /// - /// - /// true if painting of the control is allowed; otherwise, false. - /// - protected virtual bool AllowPainting - { - get { return _updateCount == 0; } - } - - protected Color[] Colors { get; set; } - - protected bool LockUpdates { get; set; } - - protected PointF[] Points { get; set; } - - protected Image SelectionGlyph { get; set; } - - #endregion - - #region Public Members - - /// - /// Disables any redrawing of the image box - /// - public virtual void BeginUpdate() - { - _updateCount++; - } - - /// - /// Enables the redrawing of the image box - /// - public virtual void EndUpdate() - { - if (_updateCount > 0) - { - _updateCount--; - } - - if (this.AllowPainting) - { - this.Invalidate(); - } - } - - #endregion - - #region Protected Members - - /// - /// Calculates wheel attributes. - /// - protected virtual void CalculateWheel() - { - List points; - List colors; - - points = new List(); - colors = new List(); - - // Only define the points if the control is above a minimum size, otherwise if it's too small, - // you get an "out of memory" exceptions (of all things) when creating the brush - if (this.ClientSize.Width > 16 && this.ClientSize.Height > 16) - { - int w; - int h; - - w = this.ClientSize.Width; - h = this.ClientSize.Height; - - _centerPoint = new PointF(w / 2.0F, h / 2.0F); - _radius = this.GetRadius(_centerPoint); - - for (double angle = 0; angle < 360; angle += this.ColorStep) - { - double angleR; - PointF location; - - angleR = angle * (Math.PI / 180); - location = this.GetColorLocation(angleR, _radius); - - points.Add(location); - colors.Add(new HslColor(angle, 1, 0.5).ToRgbColor()); - } - } - - this.Points = points.ToArray(); - this.Colors = colors.ToArray(); - } - - /// - /// Creates the gradient brush used to paint the wheel. - /// - protected virtual Brush CreateGradientBrush() - { - Brush result; - - if (this.Points.Length != 0 && this.Points.Length == this.Colors.Length) - { - result = new PathGradientBrush(this.Points, WrapMode.Clamp) - { - CenterPoint = _centerPoint, - CenterColor = Color.White, - SurroundColors = this.Colors - }; - } - else - { - result = null; - } - - return result; - } - - /// - /// Creates the selection glyph. - /// - protected virtual Image CreateSelectionGlyph() - { - Image image; - int halfSize; - - halfSize = this.SelectionSize / 2; - image = new Bitmap(this.SelectionSize + 1, this.SelectionSize + 1); - - using (Graphics g = Graphics.FromImage(image)) - { - Point[] diamondOuter; - - diamondOuter = new[] - { - new Point(halfSize, 0), new Point(this.SelectionSize, halfSize), new Point(halfSize, this.SelectionSize), new Point(0, halfSize) - }; - - g.FillPolygon(SystemBrushes.Control, diamondOuter); - g.DrawPolygon(SystemPens.ControlDark, diamondOuter); - - using (Pen pen = new Pen(Color.FromArgb(128, SystemColors.ControlDark))) - { - g.DrawLine(pen, halfSize, 1, this.SelectionSize - 1, halfSize); - g.DrawLine(pen, halfSize, 2, this.SelectionSize - 2, halfSize); - g.DrawLine(pen, halfSize, this.SelectionSize - 1, this.SelectionSize - 2, halfSize + 1); - g.DrawLine(pen, halfSize, this.SelectionSize - 2, this.SelectionSize - 3, halfSize + 1); - } - - using (Pen pen = new Pen(Color.FromArgb(196, SystemColors.ControlLightLight))) - { - g.DrawLine(pen, halfSize, this.SelectionSize - 1, 1, halfSize); - } - - g.DrawLine(SystemPens.ControlLightLight, 1, halfSize, halfSize, 1); - } - - return image; - } - - /// - /// Gets the point within the wheel representing the source color. - /// - /// The color. - protected PointF GetColorLocation(Color color) - { - return this.GetColorLocation(new HslColor(color)); - } - - /// - /// Gets the point within the wheel representing the source color. - /// - /// The color. - protected virtual PointF GetColorLocation(HslColor color) - { - double angle; - double radius; - - angle = color.H * Math.PI / 180; - radius = _radius * color.S; - - return this.GetColorLocation(angle, radius); - } - - protected PointF GetColorLocation(double angleR, double radius) - { - double x; - double y; - - x = this.Padding.Left + _centerPoint.X + Math.Cos(angleR) * radius; - y = this.Padding.Top + _centerPoint.Y - Math.Sin(angleR) * radius; - - return new PointF((float)x, (float)y); - } - - protected float GetRadius(PointF centerPoint) - { - return Math.Min(centerPoint.X, centerPoint.Y) - (Math.Max(this.Padding.Horizontal, this.Padding.Vertical) + (this.SelectionSize / 2)); - } - - /// - /// Determines whether the specified point is within the bounds of the color wheel. - /// - /// The point. - /// true if the specified point is within the bounds of the color wheel; otherwise, false. - protected bool IsPointInWheel(Point point) - { - PointF normalized; - - // http://my.safaribooksonline.com/book/programming/csharp/9780672331985/graphics-with-windows-forms-and-gdiplus/ch17lev1sec21 - - normalized = new PointF(point.X - _centerPoint.X, point.Y - _centerPoint.Y); - - return (normalized.X * normalized.X + normalized.Y * normalized.Y) <= (_radius * _radius); - } - - /// - /// Raises the event. - /// - /// The instance containing the event data. - protected virtual void OnColorChanged(EventArgs e) - { - EventHandler handler; - - if (!this.LockUpdates) - { - this.HslColor = new HslColor(this.Color); - } - this.Refresh(); - - handler = this.ColorChanged; - - if (handler != null) - { - handler(this, e); - } - } - - /// - /// Raises the event. - /// - /// The instance containing the event data. - protected virtual void OnColorStepChanged(EventArgs e) - { - EventHandler handler; - - this.RefreshWheel(); - - handler = this.ColorStepChanged; - - if (handler != null) - { - handler(this, e); - } - } - - /// - /// Raises the event. - /// - /// The instance containing the event data. - protected virtual void OnHslColorChanged(EventArgs e) - { - EventHandler handler; - - if (!this.LockUpdates) - { - this.Color = this.HslColor.ToRgbColor(); - } - this.Invalidate(); - - handler = this.HslColorChanged; - - if (handler != null) - { - handler(this, e); - } - } - - /// - /// Raises the event. - /// - /// The instance containing the event data. - protected virtual void OnLargeChangeChanged(EventArgs e) - { - EventHandler handler; - - handler = this.LargeChangeChanged; - - if (handler != null) - { - handler(this, e); - } - } - - /// - /// Raises the event. - /// - /// The instance containing the event data. - protected virtual void OnSelectionSizeChanged(EventArgs e) - { - EventHandler handler; - - if (this.SelectionGlyph != null) - { - this.SelectionGlyph.Dispose(); - } - - this.SelectionGlyph = this.CreateSelectionGlyph(); - this.RefreshWheel(); - - handler = this.SelectionSizeChanged; - - if (handler != null) - { - handler(this, e); - } - } - - /// - /// Raises the event. - /// - /// The instance containing the event data. - protected virtual void OnSmallChangeChanged(EventArgs e) - { - EventHandler handler; - - handler = this.SmallChangeChanged; - - if (handler != null) - { - handler(this, e); - } - } - - protected void PaintColor(PaintEventArgs e, HslColor color) - { - this.PaintColor(e, color, false); - } - - protected virtual void PaintColor(PaintEventArgs e, HslColor color, bool includeFocus) - { - PointF location; - - location = this.GetColorLocation(color); - - if (!float.IsNaN(location.X) && !float.IsNaN(location.Y)) - { - int x; - int y; - - x = (int)location.X - (this.SelectionSize / 2); - y = (int)location.Y - (this.SelectionSize / 2); - - if (this.SelectionGlyph == null) - { - e.Graphics.DrawRectangle(Pens.Black, x, y, this.SelectionSize, this.SelectionSize); - } - else - { - e.Graphics.DrawImage(this.SelectionGlyph, x, y); - } - - if (this.Focused && includeFocus) - { - ControlPaint.DrawFocusRectangle(e.Graphics, new Rectangle(x - 1, y - 1, this.SelectionSize + 2, this.SelectionSize + 2)); - } - } - } - - protected virtual void PaintCurrentColor(PaintEventArgs e) - { - this.PaintColor(e, this.HslColor, true); - } - - protected virtual void SetColor(Point point) - { - double dx; - double dy; - double angle; - double distance; - double saturation; - - dx = Math.Abs(point.X - _centerPoint.X - this.Padding.Left); - dy = Math.Abs(point.Y - _centerPoint.Y - this.Padding.Top); - angle = Math.Atan(dy / dx) / Math.PI * 180; - distance = Math.Pow((Math.Pow(dx, 2) + (Math.Pow(dy, 2))), 0.5); - saturation = distance / _radius; - - if (distance < 6) - { - saturation = 0; // snap to center - } - - if (point.X < _centerPoint.X) - { - angle = 180 - angle; - } - if (point.Y > _centerPoint.Y) - { - angle = 360 - angle; - } - - this.LockUpdates = true; - this.HslColor = new HslColor(angle, saturation, 0.5); - this.Color = this.HslColor.ToRgbColor(); - this.LockUpdates = false; - } - - #endregion - - #region Private Members - - /// - /// Refreshes the wheel attributes and then repaints the control - /// - private void RefreshWheel() - { - if (_brush != null) - { - _brush.Dispose(); - } - - this.CalculateWheel(); - _brush = this.CreateGradientBrush(); - this.Invalidate(); - } - - #endregion - } -} diff --git a/Vendor/MechanikaDesign/ColorWheel/ColorWheel.csproj b/Vendor/MechanikaDesign/ColorWheel/ColorWheel.csproj deleted file mode 100644 index 2f208643..00000000 --- a/Vendor/MechanikaDesign/ColorWheel/ColorWheel.csproj +++ /dev/null @@ -1,60 +0,0 @@ - - - - - Debug - AnyCPU - {A9F7F23D-AE72-4FC9-9B55-FCF21F0AE333} - Library - Properties - ColorWheel - ColorWheel - v4.5 - 512 - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - - - - - - - - - Component - - - - - - - - - \ No newline at end of file diff --git a/Vendor/MechanikaDesign/ColorWheel/HslColor.cs b/Vendor/MechanikaDesign/ColorWheel/HslColor.cs deleted file mode 100644 index 3a804536..00000000 --- a/Vendor/MechanikaDesign/ColorWheel/HslColor.cs +++ /dev/null @@ -1,231 +0,0 @@ -using System; -using System.ComponentModel; -using System.Drawing; -using System.Text; - -namespace MechanikaDesign.WinForms.UI.ColorPicker -{ - [Serializable] - public struct HslColor - { - #region Constants - - public static readonly HslColor Empty; - - #endregion - - #region Fields - - private double hue; - private double saturation; - private double luminance; - private int alpha; - private bool isEmpty; - - #endregion - - #region Static Constructors - - static HslColor() - { - Empty = new HslColor - { - IsEmpty = true - }; - } - - #endregion - - #region Public Constructors - - public HslColor(double h, double s, double l) - : this(255, h, s, l) - { } - - public HslColor(int a, double h, double s, double l) - { - this.alpha = a; - this.hue = Math.Min(359, h); - this.saturation = Math.Min(1, s); - this.luminance = Math.Min(1, l); - isEmpty = false; - } - - public HslColor(Color color) - { - this.alpha = color.A; - this.hue = color.GetHue(); - this.saturation = color.GetSaturation(); - this.luminance = color.GetBrightness(); - isEmpty = false; - } - - #endregion - - #region Operators - - public static bool operator ==(HslColor left, HslColor right) - { - return (((left.A == right.A) && (left.H == right.H)) && ((left.S == right.S) && (left.L == right.L))); - } - - public static bool operator !=(HslColor left, HslColor right) - { - return !(left == right); - } - - public static implicit operator HslColor(Color color) - { - return new HslColor(color); - } - - public static implicit operator Color(HslColor color) - { - return color.ToRgbColor(); - } - - #endregion - - #region Overridden Methods - - public override bool Equals(object obj) - { - if (obj is HslColor) - { - HslColor color = (HslColor)obj; - if (((this.A == color.A) && (this.H == color.H)) && ((this.S == color.S) && (this.L == color.L))) - { - return true; - } - } - return false; - } - - public override int GetHashCode() - { - return (((this.alpha.GetHashCode() ^ this.hue.GetHashCode()) ^ this.saturation.GetHashCode()) ^ this.luminance.GetHashCode()); - } - - public override string ToString() - { - StringBuilder builder; - - builder = new StringBuilder(); - builder.Append(this.GetType().Name); - builder.Append(" ["); - builder.Append("H="); - builder.Append(this.H); - builder.Append(", S="); - builder.Append(this.S); - builder.Append(", L="); - builder.Append(this.L); - builder.Append("]"); - - return builder.ToString(); - } - - #endregion - - #region Public Members - - public double H - { - get { return this.hue; } - set - { - this.hue = value; - this.hue = (this.hue > 359.0) ? 0 : ((this.hue < 0.0) ? 359 : this.hue); - } - } - - public double S - { - get { return this.saturation; } - set { this.saturation = Math.Min(1, Math.Max(0, value)); } - } - - public double L - { - get { return this.luminance; } - set { this.luminance = Math.Min(1, Math.Max(0, value)); } - } - - public int A - { - get { return this.alpha; } - set { this.alpha = Math.Min(0, Math.Max(255, value)); } - } - - public bool IsEmpty - { - get { return isEmpty; } - internal set { isEmpty = value; } - } - - public Color ToRgbColor() - { - return this.ToRgbColor(this.A); - } - - public Color ToRgbColor(int alpha) - { - double q; - if (this.L < 0.5) - { - q = this.L * (1 + this.S); - } - else - { - q = this.L + this.S - (this.L * this.S); - } - double p = 2 * this.L - q; - double hk = this.H / 360; - - // r,g,b colors - double[] tc = new[] - { - hk + (1d / 3d), hk, hk - (1d / 3d) - }; - double[] colors = new[] - { - 0.0, 0.0, 0.0 - }; - - for (int color = 0; color < colors.Length; color++) - { - if (tc[color] < 0) - { - tc[color] += 1; - } - if (tc[color] > 1) - { - tc[color] -= 1; - } - - if (tc[color] < (1d / 6d)) - { - colors[color] = p + ((q - p) * 6 * tc[color]); - } - else if (tc[color] >= (1d / 6d) && tc[color] < (1d / 2d)) - { - colors[color] = q; - } - else if (tc[color] >= (1d / 2d) && tc[color] < (2d / 3d)) - { - colors[color] = p + ((q - p) * 6 * (2d / 3d - tc[color])); - } - else - { - colors[color] = p; - } - - colors[color] *= 255; - } - - return Color.FromArgb(alpha, (int)colors[0], (int)colors[1], (int)colors[2]); - } - - #endregion - - } -} diff --git a/Vendor/MechanikaDesign/ColorWheel/Properties/AssemblyInfo.cs b/Vendor/MechanikaDesign/ColorWheel/Properties/AssemblyInfo.cs deleted file mode 100644 index 52c4ae58..00000000 --- a/Vendor/MechanikaDesign/ColorWheel/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("ColorWheel")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("ColorWheel")] -[assembly: AssemblyCopyright("Copyright © 2015")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("0bfcd6ed-a4f8-47f9-b101-836ee495cd96")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")]