mirror of
https://github.com/AlexMacocian/MonoGame.Extended.git
synced 2026-07-24 12:06:37 +00:00
15 lines
536 B
C#
15 lines
536 B
C#
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));
|
|
}
|
|
}
|
|
} |