removed color garbage from functions and made it one common color function