Moved some functions from ColorChannel.cpp to utils.cpp