Integrated color palette code (resolves #7).