Here you can find the source of colorText(final int color)
Parameter | Description |
---|---|
color | Color to convert |
public static String colorText(final int color)
//package com.java2s; //License from project: Open Source License public class Main { /**//from ww w . java 2s. c o m * Color to text representation * * @param color * Color to convert * @return Text representation */ public static String colorText(final int color) { final char[] characters = new char[8]; for (int i = 0, shift = 28; i < 8; i++, shift -= 4) { characters[i] = Integer.toHexString((color >> shift) & 0xF).charAt(0); } return new String(characters); } }