|
1 | | -// Part of fCraft | Copyright 2009-2015 Matvei Stefarov <me@matvei.org> | BSD-3 | See LICENSE.txt //Copyright (c) 2011-2013 Jon Baker, Glenn Marien and Lao Tszy <Jonty800@gmail.com> //Copyright (c) <2012-2014> <LeChosenOne, DingusBungus> | ProCraft Copyright 2014-2016 Joseph Beauvais <123DMWM@gmail.com> |
2 | | -using System.Collections.Generic; |
3 | | -using System.Windows.Forms; |
4 | | -using SysCol = System.Drawing.Color; |
5 | | -using fCraft; |
| 1 | +// Part of fCraft | Copyright 2009-2015 Matvei Stefarov <me@matvei.org> | BSD-3 | See LICENSE.txt | ProCraft Copyright 2014-2016 Joseph Beauvais <123DMWM@gmail.com> |
| 2 | +using System.Windows.Forms; |
| 3 | +using SysCol = System.Drawing.Color; |
6 | 4 |
|
7 | 5 | namespace fCraft.ConfigGUI { |
8 | | - internal sealed partial class ColorPicker : Form { |
| 6 | + internal sealed class ColorPicker : Form { |
9 | 7 | public char ColorCode; |
10 | 8 |
|
11 | 9 | internal static SysCol LookupColor( char colCode, out SysCol textCol ) { |
@@ -36,31 +34,21 @@ static double Map( double c ) { |
36 | 34 | return System.Math.Pow( (c + 0.055) / 1.055, 2.4 ); |
37 | 35 | } |
38 | 36 |
|
39 | | - |
40 | | - internal struct ColorPair { |
41 | | - public ColorPair( SysCol foreground, SysCol background ) { |
42 | | - Foreground = foreground; |
43 | | - Background = background; |
44 | | - } |
45 | | - public System.Drawing.Color Foreground; |
46 | | - public System.Drawing.Color Background; |
47 | | - } |
48 | | - |
49 | 37 |
|
50 | 38 | public ColorPicker( string title, char oldColorCode ) { |
51 | 39 | ColorCode = oldColorCode; |
52 | 40 | StartPosition = FormStartPosition.CenterParent; |
53 | 41 |
|
54 | 42 | SuspendLayout(); |
55 | 43 | for( char code = '0'; code <= '9'; code++ ) |
56 | | - MakeButton(code); |
| 44 | + MakeButton( code ); |
57 | 45 | for( char code = 'a'; code <= 'f'; code++ ) |
58 | | - MakeButton(code); |
59 | | - |
| 46 | + MakeButton( code ); |
60 | 47 | for( int i = 0; i < Color.ExtColors.Length; i++ ) { |
61 | 48 | if( Color.ExtColors[i].Undefined ) continue; |
62 | | - MakeButton(Color.ExtColors[i].Code); |
| 49 | + MakeButton( Color.ExtColors[i].Code ); |
63 | 50 | } |
| 51 | + |
64 | 52 | MakeCancelButton(); |
65 | 53 | MakeWindow( title ); |
66 | 54 | ResumeLayout( false ); |
@@ -130,8 +118,8 @@ void MakeWindow(string title) { |
130 | 118 | } |
131 | 119 |
|
132 | 120 |
|
133 | | - static string ColorName(char colCode) { |
134 | | - char[] a = Color.GetName(colCode).ToCharArray(); |
| 121 | + static string ColorName( char colCode ) { |
| 122 | + char[] a = Color.GetName( colCode ).ToCharArray(); |
135 | 123 | a[0] = char.ToUpper( a[0] ); |
136 | 124 | return new string( a ); |
137 | 125 | } |
|
0 commit comments