SyntaxFix
Write A Post
Hire A Developer
Questions
You can use
String hex = String.format("#%02x%02x%02x", r, g, b);
Use capital X's if you want your resulting hex-digits to be capitalized (#FFFFFF vs. #ffffff).
#FFFFFF
#ffffff