RGB to HEX java

class RGBToHex {
	public static void main(String[] args) {
		int r = 25;
		int g = 92;
		int b = 155;
		String hex = String.format("#%02X%02X%02X", r, g, b);
		System.out.println(hex);
	}
}

Output:

#195C9B
Content Protection by DMCA.com
Please Share