Adds methods for retrieving colors

This commit adds methods and tests for retrieving colors. It also
refactors some code and adds documentation.