2011-09-12 49 views

回答

10

這應該做的伎倆:

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])); 
+0

謝謝,似乎工作! – Roger

+0

太好了。不客氣:-) – aioobe

+1

@aioobe這可能是書呆子的問題,但如何.5是180?公式是什麼? –