handling unsigned byte data correctly in color palette