corrected the calculation of intermediate values in continuous color ranges.