static int from332(byte x) { int r = (x >> 5) & 7; int g = (x >> 2) & 7; int b = x & 3; ret from332(r, g, b); } static int from332(int r, int g, int b) { int r = iround(r*255.0/7); int g = iround(g*255.0/7); int b = iround(b*255.0/3); ret (r << 16) | (g << 8) | b; } static int from332(S s) { ret from332(parseInt(s.charAt(0)), parseInt(s.charAt(1)), parseInt(s.charAt(2))); }