mirror of
https://github.com/AssetRipper/AssetRipper.TextureDecoder.git
synced 2026-11-13 04:26:30 -10:00
* Resolves #42 * Removes many of the nongeneric structs * Unit tests for ColorRGB32Half are disabled (#17)
19 lines
595 B
C#
19 lines
595 B
C#
using AssetRipper.TextureDecoder.Rgb;
|
|
|
|
namespace AssetRipper.TextureDecoder.Tests.Formats;
|
|
internal static class ColorRandom<TColor, TChannel> where TColor : unmanaged, IColor<TChannel> where TChannel : unmanaged
|
|
{
|
|
public static TChannel MakeRandomValue()
|
|
{
|
|
ulong value = TestContext.CurrentContext.Random.NextULong();
|
|
return NumericConversion.Convert<ulong, TChannel>(value);
|
|
}
|
|
|
|
public static TColor MakeRandomColor()
|
|
{
|
|
TColor color = default;
|
|
color.SetChannels(MakeRandomValue(), MakeRandomValue(), MakeRandomValue(), MakeRandomValue());
|
|
return color;
|
|
}
|
|
}
|