List of utility methods to do Color Create
int | color(float red, float green, float blue) Unlike new Color(r,g,b).getRGB(), 1-epsilon rounds to brightest. return 0xff000000 | (Math.max(0, Math.min((int) (red * 0x100), 0xff)) << 16) | (Math.max(0, Math.min((int) (green * 0x100), 0xff)) << 8) | Math.max(0, Math.min((int) (blue * 0x100), 0xff)); |
String | Color(int index) Color if (index >= colors.length) { return colors[0]; return colors[index]; |
int | color(int red, int green, int blue, int alpha) Puts back the four color components into a integer representation return ((alpha & 0xFF) << 24) | ((red & 0xFF) << 16) | ((green & 0xFF) << 8) | ((blue & 0xFF) << 0);
|
String | color(int val) color return new StringBuilder().append(COLOR_CHARACTER).append(Integer.toHexString(val)).toString(); |
String | color(String color) color if (color == null) { return "#FF0000"; } else if (color.startsWith("#")) { return color; } else { return "#" + color; |
String | color(String color, Object value) color return "<html><span color=" + color + ">" + value + "</span>"; |
String | color(String msg) Coloring message return msg.replaceAll("&([0-9a-fA-Fk-oK-OrR])", "\u00A7$1"); |
String | color(String msg) color return msg.replace('&', '\u00A7'); |
String | color(String s) color return translateAlternateColorCodes('&', s); |
String | color(String s) Colorizes a message. char[] b = s.toCharArray(); for (int i = 0; i < b.length - 1; ++i) { if (b[i] == '&' && "0123456789AaBbCcDdEeFfKkLlMmNnOoRr".indexOf(b[i + 1]) > -1) { b[i] = 167; b[i + 1] = Character.toLowerCase(b[i + 1]); return new String(b); ... |