static int from332(int x) { ret from332((byte) x); } static int from332(byte x) { 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; } static int from332(int r, int g, int b) { r = iround(r*255.0/7); g = iround(g*255.0/7); 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))); }