Improved random color assignment