gray code; plus one; sort colors