1
mirror of https://github.com/CarmJos/EasyPlugin.git synced 2024-09-19 19:25:45 +00:00

feat(color): 为ColorParser支持RGB渐变颜色代码。

This commit is contained in:
Carm Jos 2022-11-27 22:58:00 +08:00
parent 9cff646226
commit 9ad80b4916

View File

@ -25,13 +25,13 @@ public class ColorParser {
public static final Pattern GRADIENT_PATTERN = Pattern.compile("&<&?#([\\da-fA-F]{6})>");
public static String parse(String text) {
return parseBaseColor(parseHexColor(text));
return parseBaseColor(parseHexColor(parseGradientColor(text)));
}
public static String[] parse(String... texts) {
return parse(Arrays.asList(texts)).toArray(new String[0]);
}
public static List<String> parse(List<String> texts) {
return texts.stream().map(ColorParser::parse).collect(Collectors.toList());
}