-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathKnownWxyTests.cs
140 lines (121 loc) · 4.66 KB
/
KnownWxyTests.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
using NUnit.Framework;
using Wacton.Unicolour.Tests.Utils;
namespace Wacton.Unicolour.Tests;
public class KnownWxyTests
{
private const double Tolerance = 0.00000000001;
[Test]
public void Red()
{
var red = StandardRgb.Red;
TestUtils.AssertTriplet<Wxy>(red, new(611.2792816164048, 0.9167808317011886, 0.21267285140562237), Tolerance);
}
[Test]
public void Green()
{
var green = StandardRgb.Green;
TestUtils.AssertTriplet<Wxy>(green, new(549.1325521262072, 0.7344486823607274, 0.7151521552878177), Tolerance);
}
[Test]
public void Blue()
{
var blue = StandardRgb.Blue;
TestUtils.AssertTriplet<Wxy>(blue, new(464.30730389823566, 0.9249258072942851, 0.07217499330655955), Tolerance);
}
[Test]
public void Cyan()
{
var cyan = StandardRgb.Cyan;
TestUtils.AssertTriplet<Wxy>(cyan, new(491.48970978428736, 0.3211884743401833, 0.7873271485943772), Tolerance);
}
[Test]
public void Magenta()
{
var magenta = StandardRgb.Magenta;
TestUtils.AssertTriplet<Wxy>(magenta, new(-549.1325521262073, 0.6872746354096638, 0.28484784471218194), Tolerance);
}
[Test]
public void Yellow()
{
var yellow = StandardRgb.Yellow;
TestUtils.AssertTriplet<Wxy>(yellow, new(570.4622811675213, 0.7920870446740987, 0.9278250066934401), Tolerance);
}
[Test]
public void Black()
{
var black = StandardRgb.Black;
TestUtils.AssertTriplet<Wxy>(black, new(360.0, 0.0, 0.0), Tolerance);
}
[Test]
public void White()
{
var white = StandardRgb.White;
TestUtils.AssertTriplet<Wxy>(white, new(360.0, 0.0, 1.0), Tolerance);
}
[Test]
public void Grey()
{
var grey = StandardRgb.Grey;
TestUtils.AssertTriplet<Wxy>(grey, new(360.0, 0.0, 0.2140411404822325), Tolerance);
}
[Test]
public void UltravioletPositive()
{
var violet = new Unicolour(ColourSpace.Wxy, Spectral.MinWavelength, 0.5, 0.5);
var ultraviolet = new Unicolour(ColourSpace.Wxy, 300, 0.5, 0.5);
TestUtils.AssertTriplet(ultraviolet.Xyy.Triplet, violet.Xyy.Triplet, Tolerance);
}
[Test]
public void UltravioletNegative()
{
var violet = new Unicolour(ColourSpace.Wxy, Spectral.MinWavelength, 0.5, 0.5);
var ultraviolet = new Unicolour(ColourSpace.Wxy, -600, 0.5, 0.5);
TestUtils.AssertTriplet(ultraviolet.Xyy.Triplet, violet.Xyy.Triplet, Tolerance);
}
[Test]
public void UltravioletPositiveComplementary()
{
var complementary = XyzConfiguration.D65.Spectral.MinNegativeWavelength;
var violet = new Unicolour(ColourSpace.Wxy, complementary, 0.5, 0.5);
var ultraviolet = new Unicolour(ColourSpace.Wxy, 300, 0.5, 0.5);
TestUtils.AssertTriplet(ultraviolet.Xyy.Triplet, violet.Xyy.Triplet, Tolerance);
}
[Test]
public void UltravioletNegativeComplementary()
{
var complementary = XyzConfiguration.D65.Spectral.MinNegativeWavelength;
var violet = new Unicolour(ColourSpace.Wxy, complementary, 0.5, 0.5);
var ultraviolet = new Unicolour(ColourSpace.Wxy, -600, 0.5, 0.5);
TestUtils.AssertTriplet(ultraviolet.Xyy.Triplet, violet.Xyy.Triplet, Tolerance);
}
[Test]
public void InfraredPositive()
{
var red = new Unicolour(ColourSpace.Wxy, Spectral.MaxWavelength, 0.5, 0.5);
var infrared = new Unicolour(ColourSpace.Wxy, 750, 0.5, 0.5);
TestUtils.AssertTriplet(infrared.Xyy.Triplet, red.Xyy.Triplet, Tolerance);
}
[Test]
public void InfraredNegative()
{
var red = new Unicolour(ColourSpace.Wxy, Spectral.MaxWavelength, 0.5, 0.5);
var infrared = new Unicolour(ColourSpace.Wxy, -450, 0.5, 0.5);
TestUtils.AssertTriplet(infrared.Xyy.Triplet, red.Xyy.Triplet, Tolerance);
}
[Test]
public void InfraredPositiveComplementary()
{
var complementary = XyzConfiguration.D65.Spectral.MaxNegativeWavelength;
var red = new Unicolour(ColourSpace.Wxy, complementary, 0.5, 0.5);
var infrared = new Unicolour(ColourSpace.Wxy, 750, 0.5, 0.5);
TestUtils.AssertTriplet(infrared.Xyy.Triplet, red.Xyy.Triplet, Tolerance);
}
[Test]
public void InfraredNegativeComplementary()
{
var complementary = XyzConfiguration.D65.Spectral.MaxNegativeWavelength;
var red = new Unicolour(ColourSpace.Wxy, complementary, 0.5, 0.5);
var infrared = new Unicolour(ColourSpace.Wxy, -450, 0.5, 0.5);
TestUtils.AssertTriplet(infrared.Xyy.Triplet, red.Xyy.Triplet, Tolerance);
}
}