Last active
March 23, 2017 10:09
-
-
Save samuelstein/3d4428cded1e8ed05700bfc3a6de94be to your computer and use it in GitHub Desktop.
Convert RGB triplet to HEX
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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