Interface ColorConverter
public interface ColorConverter
Recognizes and converts the color formats accepted in configs, namely legacy codes,
named colors and hex values.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe background used when a hex color cannot be parsed.Every legacy color and decoration code the plugin recognizes.Every named adventure color, written as the MiniMessage tag that produces it. -
Method Summary
Modifier and TypeMethodDescription@Nullable StringChecks that a color is one this plugin understands.intparseHexToArgb(String hex) Converts a hex color to a packed ARGB integer.
-
Field Details
-
DEFAULT_BACKGROUND_COLOR
static final int DEFAULT_BACKGROUND_COLORThe background used when a hex color cannot be parsed.- See Also:
-
LEGACY_COLORS
-
NAMED_COLORS
-
-
Method Details
-
isCorrect
-
parseHexToArgb
Converts a hex color to a packed ARGB integer.- Parameters:
hex- the hex color, with or without a leading hash- Returns:
- the packed ARGB value, or
DEFAULT_BACKGROUND_COLORif the text is not valid hex
-