Pinta.ImageManipulation.Utility.Clamp C# (CSharp) Method

Clamp() public static method

public static Clamp ( double x, double min, double max ) : double
x double
min double
max double
return double
		public static double Clamp (double x, double min, double max)
		{
			if (x < min) {
				return min;
			} else if (x > max) {
				return max;
			} else {
				return x;
			}
		}

Same methods

Utility::Clamp ( float x, float min, float max ) : float
Utility::Clamp ( int x, int min, int max ) : int