If you need values up to 255, you can't use anything smaller than an unsigned char.
Also, you might want to do something like this:
That way, in the future if you decide you need more than 255 shades/color, it will be much easier to change. Plus it would make the meaning of your code clearer.Code:typedef unsigned char color;