add better support for different color modes