clamp

fun Int.clamp(min: Int, max: Int): Int

Clamps an integer between the given min and max