static int from332(byte x) { /*int r = ((x >> 5) & 7) << 5; int g = ((x >> 2) & 7) << 5; int b = (x & 3) << 6;*/ int r = iround(((x >> 5) & 7)*255.0/7); int g = iround(((x >> 2) & 7)*255.0/7); int b = iround((x & 3)*255.0/3); ret (r << 16) | (g << 8) | b; }