[PATCH 1/1] Improve color mode detection