abstract out palette