Fix bug in getColor() and legend when range is too narrow (less than 3 values)