Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Convert RGB triplet to HEX
public static String toHexString(short[] triplet) {
return "#" + Integer.toHexString(new java.awt.Color(triplet[0], triplet[1], triplet[2]).getRGB()).substring(2);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment