Patch from Jeremy Michelson (with slight tweaks) - bug #48274 - fix erronious wrapping of byte colours in HSSFPalette.findSimilarColor