update color change algorithm
Merge branch 'master' into gh-pages