Color codes and function interface

1. Added better color code support.
2. Improved function interface and implemented the color code support.