Added Span-overload for MinMax

This commit is contained in:
DarthAffe committed 2024-07-11 00:19:03 +02:00
1 parent d0f2e2d983
commit 9f313f77fb
1 file changed
+3
+3
View File
@@ -43,6 +43,9 @@ public static unsafe partial class PixelHelper
ArrayPool<T>.Shared.Return(array); 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) public static IMinMax MinMax<T>(this ReadOnlySpan<T> colors)
where T : struct, IColor where T : struct, IColor