implemented clipping of out-of-range color range and values