clean up palette
clean up rgb
Do some meta programming for perf