static byte to332(Color color) { ret to332(colorToInt(color)); } static byte to332(int rgb) { int r = (rgb >> 16) & 0xFF; int g = (rgb >> 8) & 0xFF; int b = rgb & 0xFF; //ret (byte) (((r >> 5) << 5) | ((g >> 5) << 2) | (b >> 6)); ret (byte) ((iround(r*7.0/255) << 5) | (iround(g*7.0/255) << 2) | (iround(b*3.0/255))); }