Added Span-overload for MinMax

This commit is contained in:
Darth Affe 2024-07-11 00:19:03 +02:00
parent d0f2e2d983
commit 9f313f77fb

View File

@ -43,6 +43,9 @@ public static unsafe partial class PixelHelper
ArrayPool<T>.Shared.Return(array);
}
}
public static IMinMax MinMax<T>(this Span<T> colors)
where T : struct, IColor
=> T.ColorFormat.MinMax(MemoryMarshal.AsBytes(colors));
public static IMinMax MinMax<T>(this ReadOnlySpan<T> colors)
where T : struct, IColor