handing over byte array to function via pointer

If you do not use an array index, it is already a pointer.

rgbTo8Bit(buf);