on-the-fly palette generation