fixed a bug where color values were flowing out of 0 <= x <= 1 boundary