Added an invertPalette function to render_text.h