tests/Colourful.Tests/Spaces/HunterLab/XYZAndHunterLabConversionTest.cs
/// <summary>
/// Tests conversion from <see cref="HunterLabColor" /> to <see cref="XYZColor" /> (Illuminant C)
/// </summary>
Tests conversion from  to  (Illuminant C)
Tests conversion from to ( Illuminant C )
[Theory]
        [InlineData(0, 0, 0, 0, 0, 0)]
        [InlineData(100, 0, 0, 0.95047, 1, 1.08883)] 
        public void Convert_HunterLab_to_XYZ_D65(double l,
            double a,
            double b,
            double x,
            double y,
            double z)
        {
            var input = new HunterLabColor(in l, in a, in b);
            var converter = new ConverterBuilder()
                .FromHunterLab(Illuminants.C)
                .ToXYZ(Illuminants.D65)
                .Build();
            var output = converter.Convert(in input);
            Assert.Equal(x, output.X, DoubleComparerXYZPrecision);
            Assert.Equal(y, output.Y, DoubleComparerXYZPrecision);
            Assert.Equal(z, output.Z, DoubleComparerXYZPrecision);
        }
[ Theory ] [ InlineData ( 0 , 0 , 0 , 0 , 0 , 0 ) ] [ InlineData ( 100 , 0 , 0 , 0.95047 , 1 , 1.08883 ) ] public void Convert_HunterLab_to_XYZ_D65 ( double l , double a , double b , double x , double y , double z ) { var input = new HunterLabColor ( in l , in a , in b ) ; var converter = new ConverterBuilder ( ) . FromHunterLab ( Illuminants . C ) . ToXYZ ( Illuminants . D65 ) . Build ( ) ; var output = converter . Convert ( in input ) ; Assert . Equal ( x , output . X , DoubleComparerXYZPrecision ) ; Assert . Equal ( y , output . Y , DoubleComparerXYZPrecision ) ; Assert . Equal ( z , output . Z , DoubleComparerXYZPrecision ) ; }
Tests conversion from  to  (Illuminant C)
Tests conversion from to ( Illuminant C )
// D65 white point is HunterLab 100, 0, 0 (adaptation to C performed) // arrange // act // assert
l
double
a
double
b
double
x
double
y
double
z
double