/* Updates the color pallet to the display. 
This function should be called whenever a new color is selected on the pallet. It will then move the selection box to the newly chosen color.  */
static void update_pallet_selection(void)
/* Updates the color pallet to the display. 
This function should be called whenever a new color is selected on the pallet. It will then move the selection box to the newly chosen color.  */
static void update_pallet_selection(void)
{
	static uint8_t old_selected_color = 0;
	for (uint8_t i = 0; i < 3; i++) {
		gfx_draw_rect(
				(PALLET_COLOR_WIDTH * old_selected_color) + i,
				(gfx_get_height() - PALLET_HEIGHT) + i,
				PALLET_COLOR_WIDTH - (i * 2),
				PALLET_HEIGHT - (i * 2),
				pallet_colors[old_selected_color]);
	}
	for (uint8_t i = 0; i < 3; i++) {
		gfx_draw_rect(
				(PALLET_COLOR_WIDTH * selected_pallet_color) + i,
				(gfx_get_height() - PALLET_HEIGHT) + i,
				PALLET_COLOR_WIDTH - (i * 2),
				PALLET_HEIGHT - (i * 2),
				GFX_COLOR_GRAY);
	}
	old_selected_color = selected_pallet_color;
}