Skip to content

Commit f5e5a1e

Browse files
committed
fix orange color
1 parent d7b22ca commit f5e5a1e

File tree

2 files changed

+17
-18
lines changed

2 files changed

+17
-18
lines changed

src/main/java/bwapi/Color.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ public class Color {
88
public final static Color Blue = new Color(165);
99
public final static Color Teal = new Color(159);
1010
public final static Color Purple = new Color(164);
11-
public final static Color Orange = new Color(179);
11+
public final static Color Orange = new Color(156);
1212
public final static Color Brown = new Color(19);
1313
public final static Color White = new Color(255);
1414
public final static Color Yellow = new Color(135);
@@ -19,7 +19,7 @@ public class Color {
1919

2020
private static final RGBQUAD RGBRESERVE = new RGBQUAD(0, 0, 0, 0xFF);
2121

22-
private static final RGBQUAD defaultPalette[] = {
22+
private static final RGBQUAD[] defaultPalette = {
2323
new RGBQUAD(0, 0, 0), RGBRESERVE, RGBRESERVE, RGBRESERVE, RGBRESERVE, RGBRESERVE, RGBRESERVE, RGBRESERVE,
2424
RGBRESERVE, RGBRESERVE, RGBRESERVE, RGBRESERVE, RGBRESERVE, RGBRESERVE, RGBRESERVE, RGBRESERVE,
2525
new RGBQUAD(24, 36, 44), new RGBQUAD(72, 36, 20), new RGBQUAD(92, 44, 20), new RGBQUAD(112, 48, 20), new RGBQUAD(104, 60, 36), new RGBQUAD(124, 64, 24), new RGBQUAD(120, 76, 44), new RGBQUAD(168, 8, 8),
@@ -55,7 +55,7 @@ RGBRESERVE, RGBRESERVE, RGBRESERVE, RGBRESERVE, RGBRESERVE, RGBRESERVE, RGBRESER
5555
};
5656

5757
private static boolean rgbInitialized;
58-
private static byte closestColor[][][] = new byte[64][64][64];
58+
private static byte[][][] closestColor = new byte[64][64][64];
5959
public final int id;
6060

6161
public Color(final int r, final int g, final int b) {

src/main/java/bwapi/Player.java

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
import java.util.Set;
55
import java.util.stream.Collectors;
66

7-
import static bwapi.TextColor.*;
87
import static bwapi.UnitType.*;
98
import static bwapi.UpgradeType.*;
109
import static bwapi.WeaponType.*;
@@ -215,31 +214,31 @@ public Color getColor() {
215214
public TextColor getTextColor() {
216215
switch (playerData.getColor()) {
217216
case 111: // red
218-
return BrightRed;
217+
return TextColor.BrightRed;
219218
case 165: // blue
220-
return Blue;
219+
return TextColor.Blue;
221220
case 159: // teal
222-
return Teal;
221+
return TextColor.Teal;
223222
case 164: // purp
224-
return Purple;
225-
case 179: // oj
226-
return Orange;
223+
return TextColor.Purple;
224+
case 156: // orange with fix from @n00byEdge
225+
return TextColor.Orange;
227226
case 19: // brown
228-
return Brown;
227+
return TextColor.Brown;
229228
case 84: // white
230-
return PlayerWhite;
229+
return TextColor.PlayerWhite;
231230
case 135: // yellow
232-
return PlayerYellow;
231+
return TextColor.PlayerYellow;
233232
case 185: // green p9
234-
return DarkGreen;
233+
return TextColor.DarkGreen;
235234
case 136: // p10
236-
return LightYellow;
235+
return TextColor.LightYellow;
237236
case 134: // p11
238-
return Tan;
237+
return TextColor.Tan;
239238
case 51: // p12
240-
return GreyBlue;
239+
return TextColor.GreyBlue;
241240
default:
242-
return Default;
241+
return TextColor.Default;
243242
}
244243
}
245244

0 commit comments

Comments
 (0)