Maybe someone know of a way in Java (Android) to apply HUE to a color code?
For example if I have #1589FF and apply 180 HUE, I should get #FF8B14.
This should do the trick:
Color c = new Color(0x15, 0x89, 0xFF);
// Get saturation and brightness.
float[] hsbVals = new float[3];
Color.RGBtoHSB(c.getRed(), c.getGreen(), c.getBlue(), hsbVals);
// Pass .5 (= 180 degrees) as HUE
c = new Color(Color.HSBtoRGB(0.5f, hsbVals[1], hsbVals[2]));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With