How to limit the color palette while rendering?

Ever found a solution?