change random color to a function