Fix palette conversion error.
Color values were not properly clamped.