generalize the functionality in textcolor.js
Move textcolor.js functionality to colors.js in core
Add missing documentation