Use a generic function for the `colorHelper`.

Instead of using a template. This is cleaner; I don't know why it didn't
come to my mind. I'm not sure if it's possible to make it work while
using the private specifier.