mirror of https://github.com/SixLabors/ImageSharp
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
1.0 KiB
39 lines
1.0 KiB
// Copyright (c) Six Labors and contributors.
|
|
// Licensed under the Apache License, Version 2.0.
|
|
|
|
using System.Numerics;
|
|
using SixLabors.ImageSharp.ColorSpaces;
|
|
using Xunit;
|
|
|
|
namespace SixLabors.ImageSharp.Tests.Colorspaces
|
|
{
|
|
/// <summary>
|
|
/// Tests the <see cref="Hsl"/> struct.
|
|
/// </summary>
|
|
public class HslTests
|
|
{
|
|
[Fact]
|
|
public void HslConstructorAssignsFields()
|
|
{
|
|
const float h = 275F;
|
|
const float s = .64F;
|
|
const float l = .87F;
|
|
var hsl = new Hsl(h, s, l);
|
|
|
|
Assert.Equal(h, hsl.H);
|
|
Assert.Equal(s, hsl.S);
|
|
Assert.Equal(l, hsl.L);
|
|
}
|
|
|
|
[Fact]
|
|
public void HslEquality()
|
|
{
|
|
var x = default(Hsl);
|
|
var y = new Hsl(Vector3.One);
|
|
Assert.Equal(default(Hsl), default(Hsl));
|
|
Assert.Equal(new Hsl(1, 0, 1), new Hsl(1, 0, 1));
|
|
Assert.Equal(new Hsl(Vector3.One), new Hsl(Vector3.One));
|
|
Assert.False(x.Equals(y));
|
|
}
|
|
}
|
|
}
|