added helper function
sanitizing colors in the compiler