Pulled out palette code from BodinAlign into BodinPalette.