x % 16 ==0 shouldn't use 256, + tests

Making the math be math.   0.5 opacity should be done with passing alpha officially.