Java Color Create color(int val)

Here you can find the source of color(int val)

Description

color

License

Mozilla Public License

Parameter

Parameter Description
val Color value 0-15

Return

Returns a formatted String for a minecraft color

Declaration

public static String color(int val) 

Method Source Code

//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();
    }
}

Related

  1. color(float red, float green, float blue)
  2. Color(int index)
  3. color(int red, int green, int blue, int alpha)
  4. color(String color)
  5. color(String color, Object value)
  6. color(String msg)
  7. color(String msg)