Update Extensions.cs

This commit is contained in:
W2.Wizard
2021-01-14 13:56:10 +01:00
parent 8e44e6b23c
commit 00c40e279c

View File

@@ -256,7 +256,7 @@ namespace FlaxEngine.Utilities
/// <returns>A random <see cref="byte"/> between min and max.</returns>
public static byte NextByte(this Random random, byte min = 0, byte max = byte.MaxValue)
{
return (byte)random.Next(min, max+1);
return (byte)random.Next(min, max == byte.MaxValue ? byte.MaxValue + 1 : max);
}
/// <summary>
@@ -354,7 +354,7 @@ namespace FlaxEngine.Utilities
}
/// <summary>
/// Generates a random <see cref="ColorHSV"/> using a single random value for hue.
/// Generates a random <see cref="ColorHSV"/>.
/// </summary>
/// <param name="random">An instance of <see cref="Random"/>.</param>
/// <param name="randomAlpha">Randomize the alpha value.</param>