More robust against malformed hints
std::clamp can assert when the minimum value is bigger than the maximum value, max(min(minimum, value), maximum) should be a bit more robust against such cases, and still return a valuse that is somewhat sensible and usable