returns this if it is between min and max (inclusive) otherwise returns min or max whichever is closer
min
max
int limitTo(int min, int max) => (this as num)._limitTo(min, max).toInt();