Nu/Nu.Math/Color.cs
/// <summary>
/// Clamp a color to the given minimum and maximum colors.
/// </summary>
/// <param name="color">Input color.</param>
/// <param name="min">Minimum color.</param>
/// <param name="max">Maximum color.</param>
/// <param name="result">The clamped color.</param>
Clamp a color to the given minimum and maximum colors.
Clamp a color to the given minimum and maximum colors .
public static void Clamp(ref Color color, ref Color min, ref Color max, out Color result)
        {
            result.R = color.R < min.R ? min.R : color.R > max.R ? max.R : color.R;
            result.G = color.G < min.G ? min.G : color.G > max.G ? max.G : color.G;
            result.B = color.B < min.B ? min.B : color.B > max.B ? max.B : color.B;
            result.A = color.A < min.A ? min.A : color.A > max.A ? max.A : color.A;
        }
public static void Clamp ( ref Color color , ref Color min , ref Color max , out Color result ) { result . R = color . R < min . R ? min . R : color . R > max . R ? max . R : color . R ; result . G = color . G < min . G ? min . G : color . G > max . G ? max . G : color . G ; result . B = color . B < min . B ? min . B : color . B > max . B ? max . B : color . B ; result . A = color . A < min . A ? min . A : color . A > max . A ? max . A : color . A ; }
Clamp a color to the given minimum and maximum colors.
Clamp a color to the given minimum and maximum colors .
Color
out
color
None
min
None
max
None
result
The clamped color.
The clamped color .