public final class Color extends Object
Starcraft uses a 256 color palette for rendering. Thus, the colors available are limited to this palette.
Modifier and Type | Field and Description |
---|---|
static Color |
Black
The color black.
|
static Color |
Blue
The default color for Player 2.
|
static Color |
Brown
The default color for Player 6.
|
static Color |
Cyan
The default color for Neutral (Player 12).
|
static Color |
Green
The alternate color for Player 7 on Ice tilesets.
|
static Color |
Grey
The color grey.
|
int |
id |
static Color |
Orange
The default color for Player 5.
|
static Color |
Purple
The default color for Player 4.
|
static Color |
Red
The default color for Player 1.
|
static Color |
Teal
The default color for Player 3.
|
static Color |
White
A bright white.
|
static Color |
Yellow
The default color for Player 8.
|
Constructor and Description |
---|
Color(int id)
A constructor that uses the color at the specified palette index.
|
Color(int red,
int green,
int blue)
A constructor that uses the color index in the palette that is closest to the
given rgb values.
|
Modifier and Type | Method and Description |
---|---|
int |
blue() |
boolean |
equals(Object o) |
int |
green() |
int |
hashCode() |
int |
red() |
String |
toString() |
public static final Color Red
public static final Color Blue
public static final Color Teal
public static final Color Purple
public static final Color Orange
public static final Color Brown
public static final Color White
public static final Color Yellow
public static final Color Green
public static final Color Cyan
public static final Color Black
public static final Color Grey
public final int id
public Color(int red, int green, int blue)
This function computes the distance of the RGB values and may not be accurate.
red
- The amount of red.green
- The amount of green.blue
- The amount of blue.public Color(int id)
id
- The index of the color in the 256-color palette.Copyright © 2022. All rights reserved.