Here you can find the source of color(int val)
Parameter | Description |
---|---|
val | Color value 0-15 |
public static String color(int val)
//package com.java2s; //License from project: Mozilla Public License public class Main { /** The character used in mc to color code chat */ public static final char COLOR_CHARACTER = '\u00a7'; /**/*from w w w . ja va 2 s . c o m*/ * @param val Color value 0-15 * @return Returns a formatted String for a minecraft color */ public static String color(int val) { return new StringBuilder().append(COLOR_CHARACTER).append(Integer.toHexString(val)).toString(); } }