Skip to content

Commit ea44be1

Browse files
cleanup ColorPicker
1 parent 2279f13 commit ea44be1

File tree

2 files changed

+10
-23
lines changed

2 files changed

+10
-23
lines changed

ConfigGUI/ColorPicker.cs

Lines changed: 10 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
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;
64

75
namespace fCraft.ConfigGUI {
8-
internal sealed partial class ColorPicker : Form {
6+
internal sealed class ColorPicker : Form {
97
public char ColorCode;
108

119
internal static SysCol LookupColor( char colCode, out SysCol textCol ) {
@@ -36,31 +34,21 @@ static double Map( double c ) {
3634
return System.Math.Pow( (c + 0.055) / 1.055, 2.4 );
3735
}
3836

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-
4937

5038
public ColorPicker( string title, char oldColorCode ) {
5139
ColorCode = oldColorCode;
5240
StartPosition = FormStartPosition.CenterParent;
5341

5442
SuspendLayout();
5543
for( char code = '0'; code <= '9'; code++ )
56-
MakeButton(code);
44+
MakeButton( code );
5745
for( char code = 'a'; code <= 'f'; code++ )
58-
MakeButton(code);
59-
46+
MakeButton( code );
6047
for( int i = 0; i < Color.ExtColors.Length; i++ ) {
6148
if( Color.ExtColors[i].Undefined ) continue;
62-
MakeButton(Color.ExtColors[i].Code);
49+
MakeButton( Color.ExtColors[i].Code );
6350
}
51+
6452
MakeCancelButton();
6553
MakeWindow( title );
6654
ResumeLayout( false );
@@ -130,8 +118,8 @@ void MakeWindow(string title) {
130118
}
131119

132120

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();
135123
a[0] = char.ToUpper( a[0] );
136124
return new string( a );
137125
}

fCraft/Network/HttpUtil.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ static IPAddress LookupIPv4([NotNull] Uri uri) {
4242
Logger.Log(LogType.Warning, "HttpUtil.LookupIPv4: {0} does not have an IPv4 address!", uri.Host);
4343
} catch (UriFormatException) {
4444
Logger.Log(LogType.Warning, "Invalid URI: The hostname could not be parsed.");
45-
4645
}
4746

4847
lock (dnsLock) { cache[hostName] = ip; }

0 commit comments

Comments
 (0)