function rubberbandIfOutOfBounds(position, min, max, constant = 0.15) {
    if (constant === 0) return clamp(position, min, max)
    if (position < min) return -rubberband(min - position, max - min, constant) + min
    if (position > max) return +rubberband(position - max, max - min, constant) + max
    return position
}
Calculates the rubberbanding effect from a given `position` value, two bounds `min`, `max` and an elasticity `constant`.