[WIP][MAINT] Simplify the implementation of color module.

This PR improves the maintainability of this module.