private void initHue() { float greenRotation = 39.182655f; if (!hueInitialized) { hueInitialized = true; preHue = new ColorMatrix(); preHue.rotateRed(45); preHue.rotateGreen(-greenRotation); float[] lum = new float[] { LUMA_R2, LUMA_G2, LUMA_B2, 1.0f }; preHue.transformVector(lum); float red = lum[0] / lum[2]; float green = lum[1] / lum[2]; preHue.shearBlue(red, green); postHue = new ColorMatrix(); postHue.shearBlue(-red, -green); postHue.rotateGreen(greenRotation); postHue.rotateRed(-45.0f); } }