Fix colorAt() so that it checks which gradient the supplied number belongs to.