├── .gitignore ├── ColorPicker.sln ├── ColorPicker ├── ColorPicker.csproj ├── MainForm.Designer.cs ├── MainForm.cs ├── MainForm.resx ├── Program.cs ├── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ ├── Resources.de.resx │ ├── Resources.resx │ ├── Settings.Designer.cs │ └── Settings.settings ├── Resources │ ├── appbar.close.png │ ├── appbar.draw.pixel.fill.grid.png │ ├── appbar.dropper.png │ ├── appbar.pin.png │ ├── dropper.ico │ └── pipette.cur └── app.config ├── LICENSE.txt └── readme.md /.gitignore: -------------------------------------------------------------------------------- 1 | # Folders 2 | [Oo]bj/ 3 | [Bb]in/ 4 | 5 | # Files 6 | *.DS_Store 7 | *.suo 8 | *.DS_Store 9 | [Tt]humbs.db -------------------------------------------------------------------------------- /ColorPicker.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2012 4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ColorPicker", "ColorPicker\ColorPicker.csproj", "{4C680536-F558-4A6C-9C18-09F09C0B4024}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug|x86 = Debug|x86 9 | Release|x86 = Release|x86 10 | EndGlobalSection 11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 12 | {4C680536-F558-4A6C-9C18-09F09C0B4024}.Debug|x86.ActiveCfg = Debug|x86 13 | {4C680536-F558-4A6C-9C18-09F09C0B4024}.Debug|x86.Build.0 = Debug|x86 14 | {4C680536-F558-4A6C-9C18-09F09C0B4024}.Release|x86.ActiveCfg = Release|x86 15 | {4C680536-F558-4A6C-9C18-09F09C0B4024}.Release|x86.Build.0 = Release|x86 16 | EndGlobalSection 17 | GlobalSection(SolutionProperties) = preSolution 18 | HideSolutionNode = FALSE 19 | EndGlobalSection 20 | EndGlobal 21 | -------------------------------------------------------------------------------- /ColorPicker/ColorPicker.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Debug 5 | x86 6 | 8.0.30703 7 | 2.0 8 | {4C680536-F558-4A6C-9C18-09F09C0B4024} 9 | WinExe 10 | Properties 11 | ColorPicker 12 | ColorPicker 13 | v3.5 14 | 512 15 | false 16 | publish\ 17 | true 18 | Disk 19 | false 20 | Foreground 21 | 7 22 | Days 23 | false 24 | false 25 | true 26 | 0 27 | 1.0.0.%2a 28 | false 29 | true 30 | 31 | 32 | AnyCPU 33 | true 34 | full 35 | false 36 | bin\Debug\ 37 | DEBUG;TRACE 38 | prompt 39 | 4 40 | 41 | 42 | x86 43 | pdbonly 44 | true 45 | bin\Release\ 46 | TRACE 47 | prompt 48 | 4 49 | 50 | 51 | Resources\dropper.ico 52 | 53 | 54 | ColorPicker.Program 55 | 56 | 57 | true 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | Form 70 | 71 | 72 | MainForm.cs 73 | 74 | 75 | 76 | 77 | True 78 | True 79 | Resources.resx 80 | 81 | 82 | True 83 | True 84 | Settings.settings 85 | 86 | 87 | MainForm.cs 88 | 89 | 90 | PublicResXFileCodeGenerator 91 | Designer 92 | Resources.Designer.cs 93 | 94 | 95 | 96 | 97 | 98 | 99 | SettingsSingleFileGenerator 100 | Settings.Designer.cs 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | False 111 | .NET Framework 3.5 SP1 Client Profile 112 | false 113 | 114 | 115 | False 116 | .NET Framework 3.5 SP1 117 | true 118 | 119 | 120 | False 121 | Windows Installer 3.1 122 | true 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 137 | -------------------------------------------------------------------------------- /ColorPicker/MainForm.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace ColorPicker 2 | { 3 | using ColorPicker.Properties; 4 | 5 | partial class MainForm 6 | { 7 | /// 8 | /// Erforderliche Designervariable. 9 | /// 10 | private System.ComponentModel.IContainer components = null; 11 | 12 | /// 13 | /// Verwendete Ressourcen bereinigen. 14 | /// 15 | /// True, wenn verwaltete Ressourcen gelöscht werden sollen; andernfalls False. 16 | protected override void Dispose(bool disposing) 17 | { 18 | if (disposing && (components != null)) 19 | { 20 | components.Dispose(); 21 | } 22 | base.Dispose(disposing); 23 | } 24 | 25 | #region Vom Windows Form-Designer generierter Code 26 | 27 | /// 28 | /// Erforderliche Methode für die Designerunterstützung. 29 | /// Der Inhalt der Methode darf nicht mit dem Code-Editor geändert werden. 30 | /// 31 | private void InitializeComponent() 32 | { 33 | this.components = new System.ComponentModel.Container(); 34 | this.txtHexFull = new System.Windows.Forms.TextBox(); 35 | this.txtHexShort = new System.Windows.Forms.TextBox(); 36 | this.txtRgbShort = new System.Windows.Forms.TextBox(); 37 | this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components); 38 | this.contextFloat = new System.Windows.Forms.ToolStripMenuItem(); 39 | this.contextByte = new System.Windows.Forms.ToolStripMenuItem(); 40 | this.tooltip = new System.Windows.Forms.ToolTip(this.components); 41 | this.btnClose = new System.Windows.Forms.Button(); 42 | this.btnPickColor = new System.Windows.Forms.Button(); 43 | this.chkPin = new System.Windows.Forms.CheckBox(); 44 | this.btnOpenColorPicker = new System.Windows.Forms.Button(); 45 | this.lbTitle = new System.Windows.Forms.Label(); 46 | this.contextMenuStrip1.SuspendLayout(); 47 | this.SuspendLayout(); 48 | // 49 | // txtHexFull 50 | // 51 | this.txtHexFull.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(33)))), ((int)(((byte)(33)))), ((int)(((byte)(33))))); 52 | this.txtHexFull.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; 53 | this.txtHexFull.ForeColor = System.Drawing.Color.White; 54 | this.txtHexFull.Location = new System.Drawing.Point(100, 40); 55 | this.txtHexFull.Margin = new System.Windows.Forms.Padding(5); 56 | this.txtHexFull.Name = "txtHexFull"; 57 | this.txtHexFull.Size = new System.Drawing.Size(100, 20); 58 | this.txtHexFull.TabIndex = 1; 59 | this.txtHexFull.Text = "#000000"; 60 | this.tooltip.SetToolTip(this.txtHexFull, global::ColorPicker.Properties.Resources.DoubleToCopy); 61 | this.txtHexFull.Click += new System.EventHandler(this.TextBoxSelectAll); 62 | this.txtHexFull.TextChanged += new System.EventHandler(this.txtHexFull_TextChanged); 63 | this.txtHexFull.DoubleClick += new System.EventHandler(this.TextBoxCopyToClipboard); 64 | this.txtHexFull.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.txtHexFull_KeyPress); 65 | this.txtHexFull.Leave += new System.EventHandler(this.txtHexFull_Leave); 66 | // 67 | // txtHexShort 68 | // 69 | this.txtHexShort.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(33)))), ((int)(((byte)(33)))), ((int)(((byte)(33))))); 70 | this.txtHexShort.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; 71 | this.txtHexShort.ForeColor = System.Drawing.Color.White; 72 | this.txtHexShort.Location = new System.Drawing.Point(100, 70); 73 | this.txtHexShort.Margin = new System.Windows.Forms.Padding(5); 74 | this.txtHexShort.Name = "txtHexShort"; 75 | this.txtHexShort.Size = new System.Drawing.Size(100, 20); 76 | this.txtHexShort.TabIndex = 2; 77 | this.txtHexShort.Text = "000000"; 78 | this.tooltip.SetToolTip(this.txtHexShort, global::ColorPicker.Properties.Resources.DoubleToCopy); 79 | this.txtHexShort.Click += new System.EventHandler(this.TextBoxSelectAll); 80 | this.txtHexShort.TextChanged += new System.EventHandler(this.txtHexShort_TextChanged); 81 | this.txtHexShort.DoubleClick += new System.EventHandler(this.TextBoxCopyToClipboard); 82 | this.txtHexShort.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.txtHexFull_KeyPress); 83 | this.txtHexShort.Leave += new System.EventHandler(this.txtHexShort_Leave); 84 | // 85 | // txtRgbShort 86 | // 87 | this.txtRgbShort.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(33)))), ((int)(((byte)(33)))), ((int)(((byte)(33))))); 88 | this.txtRgbShort.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; 89 | this.txtRgbShort.ContextMenuStrip = this.contextMenuStrip1; 90 | this.txtRgbShort.ForeColor = System.Drawing.Color.White; 91 | this.txtRgbShort.Location = new System.Drawing.Point(100, 100); 92 | this.txtRgbShort.Margin = new System.Windows.Forms.Padding(5); 93 | this.txtRgbShort.Name = "txtRgbShort"; 94 | this.txtRgbShort.ReadOnly = true; 95 | this.txtRgbShort.Size = new System.Drawing.Size(100, 20); 96 | this.txtRgbShort.TabIndex = 3; 97 | this.txtRgbShort.Text = "0, 0, 0"; 98 | this.tooltip.SetToolTip(this.txtRgbShort, global::ColorPicker.Properties.Resources.DoubleToCopy); 99 | this.txtRgbShort.Click += new System.EventHandler(this.TextBoxSelectAll); 100 | this.txtRgbShort.DoubleClick += new System.EventHandler(this.TextBoxCopyToClipboard); 101 | // 102 | // contextMenuStrip1 103 | // 104 | this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { 105 | this.contextFloat, 106 | this.contextByte}); 107 | this.contextMenuStrip1.Name = "contextMenuStrip1"; 108 | this.contextMenuStrip1.Size = new System.Drawing.Size(149, 48); 109 | // 110 | // contextFloat 111 | // 112 | this.contextFloat.Name = "contextFloat"; 113 | this.contextFloat.Size = new System.Drawing.Size(148, 22); 114 | this.contextFloat.Text = global::ColorPicker.Properties.Resources.RangeFloat; 115 | this.contextFloat.Click += new System.EventHandler(this.contextFloat_Click); 116 | // 117 | // contextByte 118 | // 119 | this.contextByte.Name = "contextByte"; 120 | this.contextByte.Size = new System.Drawing.Size(148, 22); 121 | this.contextByte.Text = global::ColorPicker.Properties.Resources.RangeByte; 122 | this.contextByte.Click += new System.EventHandler(this.contextByte_Click); 123 | // 124 | // btnClose 125 | // 126 | this.btnClose.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(33)))), ((int)(((byte)(33)))), ((int)(((byte)(33))))); 127 | this.btnClose.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(100)))), ((int)(((byte)(100)))), ((int)(((byte)(100))))); 128 | this.btnClose.FlatAppearance.BorderSize = 0; 129 | this.btnClose.FlatAppearance.MouseDownBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(188)))), ((int)(((byte)(21)))), ((int)(((byte)(21))))); 130 | this.btnClose.FlatAppearance.MouseOverBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(225)))), ((int)(((byte)(42)))), ((int)(((byte)(42))))); 131 | this.btnClose.FlatStyle = System.Windows.Forms.FlatStyle.Flat; 132 | this.btnClose.Image = global::ColorPicker.Properties.Resources.appbar_close; 133 | this.btnClose.Location = new System.Drawing.Point(210, -1); 134 | this.btnClose.Margin = new System.Windows.Forms.Padding(0, 0, 0, 10); 135 | this.btnClose.Name = "btnClose"; 136 | this.btnClose.Size = new System.Drawing.Size(36, 25); 137 | this.btnClose.TabIndex = 6; 138 | this.tooltip.SetToolTip(this.btnClose, global::ColorPicker.Properties.Resources.CloseText); 139 | this.btnClose.UseVisualStyleBackColor = false; 140 | this.btnClose.Click += new System.EventHandler(this.btnClose_Click); 141 | // 142 | // btnPickColor 143 | // 144 | this.btnPickColor.BackColor = System.Drawing.Color.Transparent; 145 | this.btnPickColor.BackgroundImage = global::ColorPicker.Properties.Resources.appbar_dropper; 146 | this.btnPickColor.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center; 147 | this.btnPickColor.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(100)))), ((int)(((byte)(100)))), ((int)(((byte)(100))))); 148 | this.btnPickColor.FlatAppearance.MouseDownBackColor = System.Drawing.Color.Transparent; 149 | this.btnPickColor.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Transparent; 150 | this.btnPickColor.FlatStyle = System.Windows.Forms.FlatStyle.Flat; 151 | this.btnPickColor.Location = new System.Drawing.Point(10, 40); 152 | this.btnPickColor.Margin = new System.Windows.Forms.Padding(5); 153 | this.btnPickColor.Name = "btnPickColor"; 154 | this.btnPickColor.Size = new System.Drawing.Size(80, 80); 155 | this.btnPickColor.TabIndex = 6; 156 | this.btnPickColor.TabStop = false; 157 | this.tooltip.SetToolTip(this.btnPickColor, global::ColorPicker.Properties.Resources.PickText); 158 | this.btnPickColor.UseVisualStyleBackColor = false; 159 | this.btnPickColor.MouseDown += new System.Windows.Forms.MouseEventHandler(this.btnPickColor_MouseDown); 160 | this.btnPickColor.MouseUp += new System.Windows.Forms.MouseEventHandler(this.btnPickColor_MouseUp); 161 | // 162 | // chkPin 163 | // 164 | this.chkPin.Appearance = System.Windows.Forms.Appearance.Button; 165 | this.chkPin.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(33)))), ((int)(((byte)(33)))), ((int)(((byte)(33))))); 166 | this.chkPin.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(100)))), ((int)(((byte)(100)))), ((int)(((byte)(100))))); 167 | this.chkPin.FlatAppearance.BorderSize = 0; 168 | this.chkPin.FlatAppearance.CheckedBackColor = System.Drawing.SystemColors.MenuHighlight; 169 | this.chkPin.FlatAppearance.MouseOverBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); 170 | this.chkPin.FlatStyle = System.Windows.Forms.FlatStyle.Flat; 171 | this.chkPin.Image = global::ColorPicker.Properties.Resources.appbar_pin; 172 | this.chkPin.Location = new System.Drawing.Point(210, 86); 173 | this.chkPin.Margin = new System.Windows.Forms.Padding(5); 174 | this.chkPin.Name = "chkPin"; 175 | this.chkPin.Size = new System.Drawing.Size(36, 36); 176 | this.chkPin.TabIndex = 5; 177 | this.tooltip.SetToolTip(this.chkPin, global::ColorPicker.Properties.Resources.OnTop); 178 | this.chkPin.UseVisualStyleBackColor = false; 179 | this.chkPin.CheckedChanged += new System.EventHandler(this.chkPin_CheckedChanged); 180 | // 181 | // btnOpenColorPicker 182 | // 183 | this.btnOpenColorPicker.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(33)))), ((int)(((byte)(33)))), ((int)(((byte)(33))))); 184 | this.btnOpenColorPicker.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(100)))), ((int)(((byte)(100)))), ((int)(((byte)(100))))); 185 | this.btnOpenColorPicker.FlatAppearance.BorderSize = 0; 186 | this.btnOpenColorPicker.FlatAppearance.MouseDownBackColor = System.Drawing.SystemColors.MenuHighlight; 187 | this.btnOpenColorPicker.FlatAppearance.MouseOverBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); 188 | this.btnOpenColorPicker.FlatStyle = System.Windows.Forms.FlatStyle.Flat; 189 | this.btnOpenColorPicker.Image = global::ColorPicker.Properties.Resources.appbar_draw_pixel_fill_grid; 190 | this.btnOpenColorPicker.Location = new System.Drawing.Point(210, 40); 191 | this.btnOpenColorPicker.Margin = new System.Windows.Forms.Padding(5); 192 | this.btnOpenColorPicker.Name = "btnOpenColorPicker"; 193 | this.btnOpenColorPicker.Size = new System.Drawing.Size(36, 36); 194 | this.btnOpenColorPicker.TabIndex = 4; 195 | this.tooltip.SetToolTip(this.btnOpenColorPicker, global::ColorPicker.Properties.Resources.Choose); 196 | this.btnOpenColorPicker.UseVisualStyleBackColor = false; 197 | this.btnOpenColorPicker.Click += new System.EventHandler(this.btnOpenColorChooser_Click); 198 | // 199 | // lbTitle 200 | // 201 | this.lbTitle.AutoSize = true; 202 | this.lbTitle.BackColor = System.Drawing.Color.Transparent; 203 | this.lbTitle.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 204 | this.lbTitle.ForeColor = System.Drawing.Color.White; 205 | this.lbTitle.Location = new System.Drawing.Point(5, 6); 206 | this.lbTitle.Margin = new System.Windows.Forms.Padding(5, 0, 0, 10); 207 | this.lbTitle.Name = "lbTitle"; 208 | this.lbTitle.Size = new System.Drawing.Size(94, 21); 209 | this.lbTitle.TabIndex = 9; 210 | this.lbTitle.Text = "Color Picker"; 211 | this.lbTitle.MouseDown += new System.Windows.Forms.MouseEventHandler(this.MainForm_MouseDown); 212 | // 213 | // MainForm 214 | // 215 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 216 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 217 | this.AutoSize = true; 218 | this.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; 219 | this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(22)))), ((int)(((byte)(22)))), ((int)(((byte)(22))))); 220 | this.ClientSize = new System.Drawing.Size(255, 131); 221 | this.Controls.Add(this.lbTitle); 222 | this.Controls.Add(this.btnClose); 223 | this.Controls.Add(this.btnPickColor); 224 | this.Controls.Add(this.txtRgbShort); 225 | this.Controls.Add(this.txtHexShort); 226 | this.Controls.Add(this.txtHexFull); 227 | this.Controls.Add(this.chkPin); 228 | this.Controls.Add(this.btnOpenColorPicker); 229 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; 230 | this.Icon = global::ColorPicker.Properties.Resources.dropper; 231 | this.Name = "MainForm"; 232 | this.Padding = new System.Windows.Forms.Padding(5); 233 | this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Show; 234 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; 235 | this.Text = "Color Picker"; 236 | this.MouseDown += new System.Windows.Forms.MouseEventHandler(this.MainForm_MouseDown); 237 | this.contextMenuStrip1.ResumeLayout(false); 238 | this.ResumeLayout(false); 239 | this.PerformLayout(); 240 | 241 | } 242 | 243 | #endregion 244 | 245 | private System.Windows.Forms.Button btnOpenColorPicker; 246 | private System.Windows.Forms.CheckBox chkPin; 247 | private System.Windows.Forms.TextBox txtHexFull; 248 | private System.Windows.Forms.TextBox txtHexShort; 249 | private System.Windows.Forms.TextBox txtRgbShort; 250 | private System.Windows.Forms.Button btnPickColor; 251 | private System.Windows.Forms.ToolTip tooltip; 252 | private System.Windows.Forms.Button btnClose; 253 | private System.Windows.Forms.Label lbTitle; 254 | private System.Windows.Forms.ContextMenuStrip contextMenuStrip1; 255 | private System.Windows.Forms.ToolStripMenuItem contextFloat; 256 | private System.Windows.Forms.ToolStripMenuItem contextByte; 257 | } 258 | } 259 | 260 | -------------------------------------------------------------------------------- /ColorPicker/MainForm.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Drawing; 3 | using System.Drawing.Imaging; 4 | using System.Linq; 5 | using System.Windows.Forms; 6 | using System.Runtime.InteropServices; 7 | using System.Globalization; 8 | 9 | namespace ColorPicker 10 | { 11 | 12 | public partial class MainForm : Form 13 | { 14 | private Screen screen; 15 | private readonly Timer getColor; 16 | private bool txtHexFullBlocked = false; 17 | private bool txtHexShortBlocked = false; 18 | // Sample 19 | private Bitmap sampleBitmap = null; 20 | private bool hasSampled = false; 21 | private const int sampleSize = 5; 22 | private readonly Color[,] previewColors; 23 | private Color _sampleColor = Color.Black; 24 | private Color sampleColor 25 | { 26 | get { return _sampleColor; } 27 | set 28 | { 29 | _sampleColor = value; 30 | this.BackColor = _sampleColor; 31 | } 32 | } 33 | // Sample preview 34 | private const int previewSize = 80; 35 | private const int previewX = 10; 36 | private const int previewY = 40; 37 | // Move form dependencies 38 | public const int WM_NCLBUTTONDOWN = 0xA1; 39 | public const int HT_CAPTION = 0x2; 40 | [DllImportAttribute("user32.dll")] 41 | public static extern int SendMessage(IntPtr hWnd, int Msg, int wParam, int lParam); 42 | [DllImportAttribute("user32.dll")] 43 | public static extern bool ReleaseCapture(); 44 | 45 | public MainForm() 46 | { 47 | InitializeComponent(); 48 | SetStyle(ControlStyles.SupportsTransparentBackColor, true); 49 | 50 | chkPin.Checked = Properties.Settings.Default.StayOnTop; 51 | this.TopMost = chkPin.Checked; 52 | 53 | // Setup get color timer 54 | getColor = new Timer { Interval = 10 }; 55 | getColor.Tick += new EventHandler(GetColorTick); 56 | 57 | previewColors = new Color[previewSize, previewSize]; 58 | } 59 | 60 | /// 61 | /// Populates textboxes with correct color values. 62 | /// 63 | private void TranslateColor() 64 | { 65 | if (!hasSampled) return; 66 | 67 | try 68 | { 69 | string htmlColor = ColorTranslator.ToHtml(sampleColor); 70 | htmlColor = htmlColor.StartsWith("#") ? htmlColor : htmlColor.ToLower(); 71 | if (!txtHexFullBlocked) txtHexFull.Text = htmlColor; 72 | if (!txtHexShortBlocked) txtHexShort.Text = htmlColor.StartsWith("#") ? htmlColor.Substring(1) : htmlColor; 73 | 74 | if (Properties.Settings.Default.UseFloat) 75 | { 76 | string tmpR = (sampleColor.R / 255f).ToString("0.##f", CultureInfo.GetCultureInfo("en-us")); 77 | string tmpG = (sampleColor.G / 255f).ToString("0.##f", CultureInfo.GetCultureInfo("en-us")); 78 | string tmpB = (sampleColor.B / 255f).ToString("0.##f", CultureInfo.GetCultureInfo("en-us")); 79 | txtRgbShort.Text = string.Format("{0}, {1}, {2}", tmpR, tmpG, tmpB); 80 | } 81 | else 82 | { 83 | txtRgbShort.Text = string.Format("{0}, {1}, {2}", sampleColor.R, sampleColor.G, sampleColor.B); 84 | } 85 | } 86 | finally { } 87 | } 88 | 89 | /// 90 | /// Returns the sample region. 91 | /// 92 | /// Screen to sample from. 93 | /// Mouse x position. 94 | /// Mouse y position. 95 | /// 96 | private Bitmap GetSampleRegion(Screen screen, int mouseX, int mouseY) 97 | { 98 | var bmp = new Bitmap(sampleSize, sampleSize, PixelFormat.Format32bppArgb); 99 | Graphics gfxScreenshot = Graphics.FromImage(bmp); 100 | gfxScreenshot.CopyFromScreen(mouseX - sampleSize / 2, mouseY - sampleSize / 2, 0, 0, new Size(sampleSize, sampleSize)); 101 | gfxScreenshot.Save(); 102 | gfxScreenshot.Dispose(); 103 | return bmp; 104 | } 105 | 106 | /// 107 | /// Gets the contrast color based on specified color. 108 | /// 109 | /// Color to compare to. 110 | /// A white or dark gray color based on color. 111 | private Color GetContrastColor(Color color) 112 | { 113 | int yiq = ((color.R * 299) + (color.G * 587) + (color.B)) / 1000; 114 | if (yiq >= 131.5) 115 | return Color.FromArgb(255, 33, 33, 33); 116 | else 117 | return Color.White; 118 | } 119 | 120 | /// 121 | /// Opens the color chooser dialog. 122 | /// 123 | private void OpenColorChooserDialog() 124 | { 125 | var colorDialog = new ColorDialog { Color = sampleColor, FullOpen = true }; 126 | if (colorDialog.ShowDialog() == DialogResult.OK) 127 | { 128 | sampleColor = colorDialog.Color; 129 | TranslateColor(); 130 | } 131 | } 132 | 133 | protected override void OnPaint(PaintEventArgs paintEvnt) 134 | { 135 | Graphics gfx = paintEvnt.Graphics; 136 | Brush brush; 137 | Pen pen = new Pen(Color.FromArgb(255, 255, 0, 0), 2); 138 | int blockSize = previewSize / sampleSize; 139 | 140 | // Update UI for color contrast 141 | lbTitle.ForeColor = GetContrastColor(sampleColor); 142 | btnPickColor.FlatAppearance.BorderColor = GetContrastColor(sampleColor); 143 | 144 | // Draw magnified preview 145 | for (int i = 0; i < sampleSize; i++) 146 | { 147 | for (int j = 0; j < sampleSize; j++) 148 | { 149 | if (sampleBitmap != null) 150 | { 151 | previewColors[i, j] = sampleBitmap.GetPixel(i, j); 152 | } 153 | brush = new SolidBrush(previewColors[i, j]); 154 | gfx.FillRectangle(brush, new Rectangle(previewX + i * blockSize, previewY + j * blockSize, blockSize, blockSize)); 155 | 156 | } 157 | } 158 | 159 | // Draw preview border 160 | if (hasSampled) 161 | { 162 | gfx.DrawRectangle(pen, previewX + blockSize * (sampleSize / 2), previewY + blockSize * (sampleSize / 2), blockSize, blockSize); 163 | } 164 | 165 | // Clean up 166 | if (sampleBitmap != null) 167 | { 168 | sampleBitmap.Dispose(); 169 | sampleBitmap = null; 170 | } 171 | } 172 | 173 | void GetColorTick(object sender, EventArgs e) 174 | { 175 | try 176 | { 177 | // Get color sample from screen 178 | int mouseX = MousePosition.X; 179 | int mouseY = MousePosition.Y; 180 | screen = Screen.FromRectangle(new Rectangle(MousePosition.X, MousePosition.Y, 1, 1)); 181 | sampleBitmap = GetSampleRegion(screen, mouseX, mouseY); 182 | Color newColor = sampleBitmap.GetPixel(sampleSize / 2, sampleSize / 2); 183 | // Set color sample and update form 184 | sampleColor = newColor; 185 | TranslateColor(); 186 | if (this.BackColor == newColor) this.Invalidate(new Rectangle(previewX, previewY, previewSize, previewSize)); 187 | } 188 | finally { } 189 | } 190 | 191 | private void chkPin_CheckedChanged(object sender, EventArgs e) 192 | { 193 | this.TopMost = chkPin.Checked; 194 | Properties.Settings.Default.StayOnTop = chkPin.Checked; 195 | Properties.Settings.Default.Save(); 196 | } 197 | 198 | private void btnOpenColorChooser_Click(object sender, EventArgs e) 199 | { 200 | OpenColorChooserDialog(); 201 | } 202 | 203 | private void btnPickColor_MouseDown(object sender, MouseEventArgs e) 204 | { 205 | getColor.Start(); 206 | var cv = new CursorConverter(); 207 | var cursor = (Cursor)cv.ConvertFrom(Properties.Resources.pipette); 208 | if (!hasSampled) 209 | { 210 | btnPickColor.BackgroundImage = null; 211 | hasSampled = true; 212 | } 213 | this.Cursor = cursor; 214 | } 215 | 216 | private void btnPickColor_MouseUp(object sender, MouseEventArgs e) 217 | { 218 | getColor.Stop(); 219 | this.Cursor = Cursors.Default; 220 | 221 | // Clean up 222 | if (sampleBitmap != null) 223 | { 224 | sampleBitmap.Dispose(); 225 | sampleBitmap = null; 226 | } 227 | System.GC.Collect(); 228 | } 229 | 230 | private void txtHexFull_TextChanged(object sender, EventArgs e) 231 | { 232 | if (txtHexFull.Text.Length == 7 && txtHexFull.Text.StartsWith("#")) 233 | { 234 | sampleColor = ColorTranslator.FromHtml(txtHexFull.Text); 235 | TranslateColor(); 236 | } 237 | else if (txtHexFull.Text.Length == 4 && txtHexFull.Text.StartsWith("#")) 238 | { 239 | sampleColor = ColorTranslator.FromHtml(txtHexFull.Text); 240 | txtHexFullBlocked = true; 241 | TranslateColor(); 242 | } 243 | } 244 | 245 | private void txtHexShort_TextChanged(object sender, EventArgs e) 246 | { 247 | try 248 | { 249 | if (txtHexShort.Text.Length == 6) 250 | { 251 | sampleColor = ColorTranslator.FromHtml("#" + txtHexShort.Text); 252 | TranslateColor(); 253 | } 254 | else if (txtHexShort.Text.Length == 3) 255 | { 256 | sampleColor = ColorTranslator.FromHtml("#" + txtHexShort.Text); 257 | txtHexShortBlocked = true; 258 | TranslateColor(); 259 | } 260 | } 261 | catch (FormatException fex) 262 | { 263 | sampleColor = Color.Black; 264 | TranslateColor(); 265 | } 266 | } 267 | 268 | private void txtHexFull_Leave(object sender, EventArgs e) 269 | { 270 | txtHexFullBlocked = false; 271 | } 272 | 273 | private void txtHexShort_Leave(object sender, EventArgs e) 274 | { 275 | txtHexShortBlocked = false; 276 | } 277 | 278 | private void txtHexFull_KeyPress(object sender, KeyPressEventArgs e) 279 | { 280 | var keys = new int[] { 'a', 'b', 'c', 'd', 'e', 'f', 'A', 'B', 'C', 'D', 'E', 'F', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '\b', '#' }; 281 | if (!keys.Contains(e.KeyChar)) 282 | e.Handled = true; 283 | } 284 | 285 | private void TextBoxSelectAll(object sender, EventArgs e) 286 | { 287 | ((TextBox)sender).SelectAll(); 288 | } 289 | 290 | private void TextBoxCopyToClipboard(object sender, EventArgs e) 291 | { 292 | Clipboard.SetText(((TextBox)sender).Text); 293 | } 294 | 295 | private void btnClose_Click(object sender, EventArgs e) 296 | { 297 | this.Close(); 298 | } 299 | 300 | private void MainForm_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e) 301 | { 302 | // Drag form to move 303 | if (e.Button == MouseButtons.Left) 304 | { 305 | ReleaseCapture(); 306 | SendMessage(Handle, WM_NCLBUTTONDOWN, HT_CAPTION, 0); 307 | } 308 | } 309 | 310 | protected override bool ProcessCmdKey(ref Message msg, Keys keyData) 311 | { 312 | // Escape to close 313 | if (keyData == Keys.Escape) 314 | { 315 | this.Close(); 316 | return true; 317 | } 318 | return base.ProcessCmdKey(ref msg, keyData); 319 | } 320 | 321 | private void contextFloat_Click(object sender, EventArgs e) 322 | { 323 | Properties.Settings.Default.UseFloat = true; 324 | Properties.Settings.Default.Save(); 325 | TranslateColor(); 326 | } 327 | 328 | private void contextByte_Click(object sender, EventArgs e) 329 | { 330 | Properties.Settings.Default.UseFloat = false; 331 | Properties.Settings.Default.Save(); 332 | TranslateColor(); 333 | } 334 | } 335 | } 336 | -------------------------------------------------------------------------------- /ColorPicker/MainForm.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | 17, 17 122 | 123 | 124 | 105, 17 125 | 126 | -------------------------------------------------------------------------------- /ColorPicker/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Windows.Forms; 3 | 4 | namespace ColorPicker 5 | { 6 | static class Program 7 | { 8 | [STAThread] 9 | static void Main() 10 | { 11 | Application.EnableVisualStyles(); 12 | Application.SetCompatibleTextRenderingDefault(false); 13 | Application.Run(new MainForm()); 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /ColorPicker/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | using System.Resources; 4 | 5 | // Allgemeine Informationen über eine Assembly werden über die folgenden 6 | // Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern, 7 | // die mit einer Assembly verknüpft sind. 8 | [assembly: AssemblyTitle("Color Picker")] 9 | [assembly: AssemblyDescription("A dead-simple color picker.")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("Color Picker")] 13 | [assembly: AssemblyCopyright("")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Durch Festlegen von ComVisible auf "false" werden die Typen in dieser Assembly unsichtbar 18 | // für COM-Komponenten. Wenn Sie auf einen Typ in dieser Assembly von 19 | // COM zugreifen müssen, legen Sie das ComVisible-Attribut für diesen Typ auf "true" fest. 20 | [assembly: ComVisible(false)] 21 | 22 | // Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird 23 | [assembly: Guid("4432e204-b1fc-4fcb-9f96-5a40abcd3f12")] 24 | 25 | // Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten: 26 | // 27 | // Hauptversion 28 | // Nebenversion 29 | // Buildnummer 30 | // Revision 31 | // 32 | // Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern 33 | // übernehmen, indem Sie "*" eingeben: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.2.0")] 36 | [assembly: AssemblyFileVersion("1.0.2.0")] 37 | [assembly: NeutralResourcesLanguageAttribute("en-us")] 38 | -------------------------------------------------------------------------------- /ColorPicker/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.18052 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace ColorPicker.Properties { 12 | using System; 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | public class Resources { 26 | 27 | private static global::System.Resources.ResourceManager resourceMan; 28 | 29 | private static global::System.Globalization.CultureInfo resourceCulture; 30 | 31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 32 | internal Resources() { 33 | } 34 | 35 | /// 36 | /// Returns the cached ResourceManager instance used by this class. 37 | /// 38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 39 | public static global::System.Resources.ResourceManager ResourceManager { 40 | get { 41 | if (object.ReferenceEquals(resourceMan, null)) { 42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ColorPicker.Properties.Resources", typeof(Resources).Assembly); 43 | resourceMan = temp; 44 | } 45 | return resourceMan; 46 | } 47 | } 48 | 49 | /// 50 | /// Overrides the current thread's CurrentUICulture property for all 51 | /// resource lookups using this strongly typed resource class. 52 | /// 53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 54 | public static global::System.Globalization.CultureInfo Culture { 55 | get { 56 | return resourceCulture; 57 | } 58 | set { 59 | resourceCulture = value; 60 | } 61 | } 62 | 63 | /// 64 | /// Looks up a localized resource of type System.Drawing.Bitmap. 65 | /// 66 | public static System.Drawing.Bitmap appbar_close { 67 | get { 68 | object obj = ResourceManager.GetObject("appbar_close", resourceCulture); 69 | return ((System.Drawing.Bitmap)(obj)); 70 | } 71 | } 72 | 73 | /// 74 | /// Looks up a localized resource of type System.Drawing.Bitmap. 75 | /// 76 | public static System.Drawing.Bitmap appbar_draw_pixel_fill_grid { 77 | get { 78 | object obj = ResourceManager.GetObject("appbar_draw_pixel_fill_grid", resourceCulture); 79 | return ((System.Drawing.Bitmap)(obj)); 80 | } 81 | } 82 | 83 | /// 84 | /// Looks up a localized resource of type System.Drawing.Bitmap. 85 | /// 86 | public static System.Drawing.Bitmap appbar_dropper { 87 | get { 88 | object obj = ResourceManager.GetObject("appbar_dropper", resourceCulture); 89 | return ((System.Drawing.Bitmap)(obj)); 90 | } 91 | } 92 | 93 | /// 94 | /// Looks up a localized resource of type System.Drawing.Bitmap. 95 | /// 96 | public static System.Drawing.Bitmap appbar_pin { 97 | get { 98 | object obj = ResourceManager.GetObject("appbar_pin", resourceCulture); 99 | return ((System.Drawing.Bitmap)(obj)); 100 | } 101 | } 102 | 103 | /// 104 | /// Looks up a localized string similar to Choose color. 105 | /// 106 | public static string Choose { 107 | get { 108 | return ResourceManager.GetString("Choose", resourceCulture); 109 | } 110 | } 111 | 112 | /// 113 | /// Looks up a localized string similar to Close (Esc). 114 | /// 115 | public static string CloseText { 116 | get { 117 | return ResourceManager.GetString("CloseText", resourceCulture); 118 | } 119 | } 120 | 121 | /// 122 | /// Looks up a localized string similar to Double-Click to Copy. 123 | /// 124 | public static string DoubleToCopy { 125 | get { 126 | return ResourceManager.GetString("DoubleToCopy", resourceCulture); 127 | } 128 | } 129 | 130 | /// 131 | /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon). 132 | /// 133 | public static System.Drawing.Icon dropper { 134 | get { 135 | object obj = ResourceManager.GetObject("dropper", resourceCulture); 136 | return ((System.Drawing.Icon)(obj)); 137 | } 138 | } 139 | 140 | /// 141 | /// Looks up a localized string similar to Always on top. 142 | /// 143 | public static string OnTop { 144 | get { 145 | return ResourceManager.GetString("OnTop", resourceCulture); 146 | } 147 | } 148 | 149 | /// 150 | /// Looks up a localized string similar to Click & Drag to pick Color. 151 | /// 152 | public static string PickText { 153 | get { 154 | return ResourceManager.GetString("PickText", resourceCulture); 155 | } 156 | } 157 | 158 | /// 159 | /// Looks up a localized resource of type System.Byte[]. 160 | /// 161 | public static byte[] pipette { 162 | get { 163 | object obj = ResourceManager.GetObject("pipette", resourceCulture); 164 | return ((byte[])(obj)); 165 | } 166 | } 167 | 168 | /// 169 | /// Looks up a localized string similar to Range: 0 - 255. 170 | /// 171 | public static string RangeByte { 172 | get { 173 | return ResourceManager.GetString("RangeByte", resourceCulture); 174 | } 175 | } 176 | 177 | /// 178 | /// Looks up a localized string similar to Range: 0 - 1. 179 | /// 180 | public static string RangeFloat { 181 | get { 182 | return ResourceManager.GetString("RangeFloat", resourceCulture); 183 | } 184 | } 185 | 186 | /// 187 | /// Looks up a localized string similar to Color Picker. 188 | /// 189 | public static string Title { 190 | get { 191 | return ResourceManager.GetString("Title", resourceCulture); 192 | } 193 | } 194 | } 195 | } 196 | -------------------------------------------------------------------------------- /ColorPicker/Properties/Resources.de.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | Farbe wählen 122 | 123 | 124 | Schließen (Esc) 125 | 126 | 127 | Zum Kopieren Doppelklicken 128 | 129 | 130 | Immer im Vordergrund 131 | 132 | 133 | Klicken & Ziehen 134 | 135 | 136 | Bereich: 0 - 255 137 | 138 | 139 | Bereich: 0 - 1 140 | 141 | 142 | Color Picker 143 | 144 | -------------------------------------------------------------------------------- /ColorPicker/Properties/Resources.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | 122 | ..\Resources\pipette.cur;System.Byte[], mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 123 | 124 | 125 | ..\Resources\appbar.pin.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 126 | 127 | 128 | ..\Resources\appbar.close.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 129 | 130 | 131 | ..\Resources\appbar.draw.pixel.fill.grid.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 132 | 133 | 134 | ..\Resources\appbar.dropper.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 135 | 136 | 137 | ..\resources\dropper.ico;System.Drawing.Icon, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 138 | 139 | 140 | Choose color 141 | 142 | 143 | Close (Esc) 144 | 145 | 146 | Double-Click to Copy 147 | 148 | 149 | Always on top 150 | 151 | 152 | Click & Drag to pick Color 153 | 154 | 155 | Range: 0 - 255 156 | 157 | 158 | Range: 0 - 1 159 | 160 | 161 | Color Picker 162 | 163 | -------------------------------------------------------------------------------- /ColorPicker/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.18052 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace ColorPicker.Properties { 12 | 13 | 14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] 16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { 17 | 18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 19 | 20 | public static Settings Default { 21 | get { 22 | return defaultInstance; 23 | } 24 | } 25 | 26 | [global::System.Configuration.UserScopedSettingAttribute()] 27 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 28 | [global::System.Configuration.DefaultSettingValueAttribute("True")] 29 | public bool StayOnTop { 30 | get { 31 | return ((bool)(this["StayOnTop"])); 32 | } 33 | set { 34 | this["StayOnTop"] = value; 35 | } 36 | } 37 | 38 | [global::System.Configuration.UserScopedSettingAttribute()] 39 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 40 | [global::System.Configuration.DefaultSettingValueAttribute("False")] 41 | public bool UseFloat { 42 | get { 43 | return ((bool)(this["UseFloat"])); 44 | } 45 | set { 46 | this["UseFloat"] = value; 47 | } 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /ColorPicker/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | True 7 | 8 | 9 | False 10 | 11 | 12 | -------------------------------------------------------------------------------- /ColorPicker/Resources/appbar.close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/charliecm/ColorPicker/6b399ff642f491fc9d9d343e2fd21ee982cf28fa/ColorPicker/Resources/appbar.close.png -------------------------------------------------------------------------------- /ColorPicker/Resources/appbar.draw.pixel.fill.grid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/charliecm/ColorPicker/6b399ff642f491fc9d9d343e2fd21ee982cf28fa/ColorPicker/Resources/appbar.draw.pixel.fill.grid.png -------------------------------------------------------------------------------- /ColorPicker/Resources/appbar.dropper.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/charliecm/ColorPicker/6b399ff642f491fc9d9d343e2fd21ee982cf28fa/ColorPicker/Resources/appbar.dropper.png -------------------------------------------------------------------------------- /ColorPicker/Resources/appbar.pin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/charliecm/ColorPicker/6b399ff642f491fc9d9d343e2fd21ee982cf28fa/ColorPicker/Resources/appbar.pin.png -------------------------------------------------------------------------------- /ColorPicker/Resources/dropper.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/charliecm/ColorPicker/6b399ff642f491fc9d9d343e2fd21ee982cf28fa/ColorPicker/Resources/dropper.ico -------------------------------------------------------------------------------- /ColorPicker/Resources/pipette.cur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/charliecm/ColorPicker/6b399ff642f491fc9d9d343e2fd21ee982cf28fa/ColorPicker/Resources/pipette.cur -------------------------------------------------------------------------------- /ColorPicker/app.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 |
6 | 7 | 8 | 9 | 10 | 11 | True 12 | 13 | 14 | False 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2013 Charlie Chao 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | # Color Picker 2 | 3 | ![Screenshot](http://charliecm.github.io/ColorPicker/screenshot-gh.png) 4 | 5 | A dead-simple Windows color picker by [@charliecm](http://twitter.com/charliecm). 6 | 7 | Based on http://sourceforge.net/projects/colorfinder/. 8 | 9 | Icons from [ModernUIIcons.com](http://modernuiicons.com). 10 | 11 | German translation by [madpew](https://github.com/madpew). --------------------------------------------------------------------------------