mirror of https://github.com/SixLabors/ImageSharp
10 changed files with 47 additions and 101 deletions
@ -1,25 +1,19 @@ |
|||||
// Copyright (c) Six Labors.
|
// Copyright (c) Six Labors.
|
||||
// Licensed under the Six Labors Split License.
|
// Licensed under the Six Labors Split License.
|
||||
|
|
||||
using BenchmarkDotNet.Attributes; |
using BenchmarkDotNet.Attributes; |
||||
|
|
||||
using SixLabors.ImageSharp.PixelFormats; |
using SixLabors.ImageSharp.PixelFormats; |
||||
|
using SystemColor = System.Drawing.Color; |
||||
|
|
||||
namespace SixLabors.ImageSharp.Benchmarks; |
namespace SixLabors.ImageSharp.Benchmarks; |
||||
|
|
||||
using SystemColor = System.Drawing.Color; |
|
||||
|
|
||||
public class ColorEquality |
public class ColorEquality |
||||
{ |
{ |
||||
[Benchmark(Baseline = true, Description = "System.Drawing Color Equals")] |
[Benchmark(Baseline = true, Description = "System.Drawing Color Equals")] |
||||
public bool SystemDrawingColorEqual() |
public bool SystemDrawingColorEqual() |
||||
{ |
=> SystemColor.FromArgb(128, 128, 128, 128).Equals(SystemColor.FromArgb(128, 128, 128, 128)); |
||||
return SystemColor.FromArgb(128, 128, 128, 128).Equals(SystemColor.FromArgb(128, 128, 128, 128)); |
|
||||
} |
|
||||
|
|
||||
[Benchmark(Description = "ImageSharp Color Equals")] |
[Benchmark(Description = "ImageSharp Color Equals")] |
||||
public bool ColorEqual() |
public bool ColorEqual() |
||||
{ |
=> new Rgba32(128, 128, 128, 128).Equals(new Rgba32(128, 128, 128, 128)); |
||||
return new Rgba32(128, 128, 128, 128).Equals(new Rgba32(128, 128, 128, 128)); |
|
||||
} |
|
||||
} |
} |
||||
|
|||||
Loading…
Reference in new issue