Package games.stendhal.common.constants
Enum Class SkinColor
- All Implemented Interfaces:
Serializable
,Comparable<SkinColor>
,Constable
Acceptable colors that can be used for skin.
- Author:
- AntumDeluge, kiheru
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic SkinColor
fromInteger(int color)
Find the nearest skin color corresponding to an integer color value.int
getColor()
Get the corresponding color RGB.static boolean
isValidColor(int color)
Check if an integer color corresponds to a valid skin color.static SkinColor
Returns the enum constant of this class with the specified name.static SkinColor[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
COLOR1
-
COLOR2
-
COLOR3
-
COLOR4
-
COLOR5
-
COLOR6
-
COLOR7
-
COLOR8
-
COLOR9
-
COLOR10
-
COLOR11
-
COLOR12
-
COLOR13
-
COLOR14
-
COLOR15
-
COLOR16
-
-
Field Details
-
DARK
public static final int DARK- See Also:
- Constant Field Values
-
LIGHT
public static final int LIGHT- See Also:
- Constant Field Values
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
fromInteger
Find the nearest skin color corresponding to an integer color value. The lookup is done based on the hue and saturation, ignoring lightness.- Parameters:
color
- color as RGB int- Returns:
- skin color corresponding to the integer value
-
getColor
public int getColor()Get the corresponding color RGB.- Returns:
- color
-
isValidColor
public static boolean isValidColor(int color)Check if an integer color corresponds to a valid skin color.- Parameters:
color
- color to be checked- Returns:
true
if the color is a valid skin color, otherwisefalse
-