mirror of
https://github.com/AlexMacocian/MonoGame.Extended.git
synced 2026-07-22 10:19:30 +00:00
17 lines
562 B
C#
17 lines
562 B
C#
using MonoGame.Extended;
|
|
|
|
namespace MonoGame.Extended.Particles
|
|
{
|
|
public static class FastRandomExtensions
|
|
{
|
|
public static void NextColor(this FastRandom random, out HslColor color, Range<HslColor> range)
|
|
{
|
|
var maxH = range.Max.H >= range.Min.H
|
|
? range.Max.H
|
|
: range.Max.H + 360;
|
|
color = new HslColor(random.NextSingle(range.Min.H, maxH),
|
|
random.NextSingle(range.Min.S, range.Max.S),
|
|
random.NextSingle(range.Min.L, range.Max.L));
|
|
}
|
|
}
|
|
} |