List of utility methods to do Float Clamp
float | clamp(float x, float min, float max) clamp if (x > max) return max; if (x < min) return min; return x; |
float | clamp(float min, float max, float value) clamp final float clamp; if (value < min) { clamp = min; } else if (value > max) { clamp = max; } else { clamp = value; return clamp; |
byte | clampByte(float value) clamp Byte return (byte) clamp(Byte.MIN_VALUE, Byte.MAX_VALUE, value); |