add function of change colors depend on the templates