Change color matrix to be global for efficiency.