static int clampInt(int min, int max, int input) { if (input < min) { return min; } else if (input > max) { return max; } return input; }