colors: add method to generate n distinct colors

(integrated from trunk branch change 76cb850 by Todd Whiteman <toddw@activestate.com>)