Skip to content

Commit 4671926

Browse files
committed
Merge branch 'dataset-standardisation' into 'main'
Standardise dataset collections See merge request Wacton/Unicolour!97
2 parents 084690d + aafd375 commit 4671926

24 files changed

+77
-77
lines changed

Unicolour.Datasets/ArtistPaint.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,7 @@ public static class ArtistPaint
494494
},
495495
K1, K2, nameof(TitaniumWhite));
496496

497-
public static IEnumerable<Pigment> All => new List<Pigment>
497+
public static IEnumerable<Pigment> All => new[]
498498
{
499499
BismuthVanadateYellow, BoneBlack,
500500
CadmiumOrange, CadmiumRedLight, CeruleanBlueChromium, CobaltBlue,

Unicolour.Datasets/Cividis.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ internal Cividis()
1010
public override Unicolour Map(double x) => InterpolateColourTable(Lookup, x);
1111
public override string ToString() => nameof(Cividis);
1212

13-
public static readonly Unicolour[] Lookup =
13+
public static readonly IEnumerable<Unicolour> Lookup = new Unicolour[]
1414
{
1515
new(Config, ColourSpace.Rgb, 0, 0.138068, 0.311105),
1616
new(Config, ColourSpace.Rgb, 0, 0.141013, 0.317579),

Unicolour.Datasets/Colourmap.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@ public IEnumerable<Unicolour> Palette(int count)
5050
return palette;
5151
}
5252

53-
protected static Unicolour InterpolateColourTable(Unicolour[] colourTable, double x)
53+
protected static Unicolour InterpolateColourTable(IEnumerable<Unicolour> colourTable, double x)
5454
{
55-
var (lowerColour, upperColour, mixAmount) = Lut.Lookup(colourTable, x);
55+
var (lowerColour, upperColour, mixAmount) = Lut.Lookup(colourTable.ToArray(), x);
5656
return lowerColour.Mix(upperColour, ColourSpace.Rgb, mixAmount);
5757
}
5858
}

Unicolour.Datasets/Crest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ internal Crest()
1010
public override Unicolour Map(double x) => InterpolateColourTable(Lookup, x);
1111
public override string ToString() => nameof(Crest);
1212

13-
public static readonly Unicolour[] Lookup =
13+
public static readonly IEnumerable<Unicolour> Lookup = new Unicolour[]
1414
{
1515
new(Config, ColourSpace.Rgb, 0.6468274, 0.80289262, 0.56592265),
1616
new(Config, ColourSpace.Rgb, 0.64233318, 0.80081141, 0.56639461),

Unicolour.Datasets/EbnerFairchild.cs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ public static class EbnerFairchild
99
public static readonly Unicolour White = new(Config, ColourSpace.Xyz, WhiteXyz.Tuple);
1010

1111
public static readonly Unicolour Hue0Ref = new(Config, ColourSpace.Xyz, 0.4092, 0.2812, 0.3060);
12-
public static readonly List<Unicolour> AllHue0 = new()
12+
public static readonly IEnumerable<Unicolour> AllHue0 = new[]
1313
{
1414
Hue0Ref,
1515
new(Config, ColourSpace.Xyz, 0.024951, 0.019086, 0.020329),
@@ -35,7 +35,7 @@ public static class EbnerFairchild
3535
};
3636

3737
public static readonly Unicolour Hue24Ref = new(Config, ColourSpace.Xyz, 0.3953, 0.2812, 0.1845);
38-
public static readonly List<Unicolour> AllHue24 = new()
38+
public static readonly IEnumerable<Unicolour> AllHue24 = new[]
3939
{
4040
Hue24Ref,
4141
new(Config, ColourSpace.Xyz, 0.024364, 0.019086, 0.014688),
@@ -61,7 +61,7 @@ public static class EbnerFairchild
6161
};
6262

6363
public static readonly Unicolour Hue48Ref = new(Config, ColourSpace.Xyz, 0.3577, 0.2812, 0.1125);
64-
public static readonly List<Unicolour> AllHue48 = new()
64+
public static readonly IEnumerable<Unicolour> AllHue48 = new[]
6565
{
6666
Hue48Ref,
6767
new(Config, ColourSpace.Xyz, 0.036781, 0.029891, 0.014811),
@@ -87,7 +87,7 @@ public static class EbnerFairchild
8787
};
8888

8989
public static readonly Unicolour Hue72Ref = new(Config, ColourSpace.Xyz, 0.5151, 0.4828, 0.1778);
90-
public static readonly List<Unicolour> AllHue72 = new()
90+
public static readonly IEnumerable<Unicolour> AllHue72 = new[]
9191
{
9292
Hue72Ref,
9393
new(Config, ColourSpace.Xyz, 0.033197, 0.029891, 0.011480),
@@ -113,7 +113,7 @@ public static class EbnerFairchild
113113
};
114114

115115
public static readonly Unicolour Hue96Ref = new(Config, ColourSpace.Xyz, 0.5184, 0.5668, 0.2112);
116-
public static readonly List<Unicolour> AllHue96 = new()
116+
public static readonly IEnumerable<Unicolour> AllHue96 = new[]
117117
{
118118
Hue96Ref,
119119
new(Config, ColourSpace.Xyz, 0.028909, 0.029891, 0.010142),
@@ -139,7 +139,7 @@ public static class EbnerFairchild
139139
};
140140

141141
public static readonly Unicolour Hue120Ref = new(Config, ColourSpace.Xyz, 0.3765, 0.4828, 0.1994);
142-
public static readonly List<Unicolour> AllHue120 = new()
142+
public static readonly IEnumerable<Unicolour> AllHue120 = new[]
143143
{
144144
Hue120Ref,
145145
new(Config, ColourSpace.Xyz, 0.023295, 0.029891, 0.012151),
@@ -165,7 +165,7 @@ public static class EbnerFairchild
165165
};
166166

167167
public static readonly Unicolour Hue144Ref = new(Config, ColourSpace.Xyz, 0.2873, 0.4828, 0.2109);
168-
public static readonly List<Unicolour> AllHue144 = new()
168+
public static readonly IEnumerable<Unicolour> AllHue144 = new[]
169169
{
170170
Hue144Ref,
171171
new(Config, ColourSpace.Xyz, 0.020570, 0.029891, 0.016832),
@@ -191,7 +191,7 @@ public static class EbnerFairchild
191191
};
192192

193193
public static readonly Unicolour Hue168Ref = new(Config, ColourSpace.Xyz, 0.3076, 0.4828, 0.4277);
194-
public static readonly List<Unicolour> AllHue168 = new()
194+
public static readonly IEnumerable<Unicolour> AllHue168 = new[]
195195
{
196196
Hue168Ref,
197197
new(Config, ColourSpace.Xyz, 0.021080, 0.029891, 0.027904),
@@ -217,7 +217,7 @@ public static class EbnerFairchild
217217
};
218218

219219
public static readonly Unicolour Hue192Ref = new(Config, ColourSpace.Xyz, 0.3488, 0.4828, 0.6019);
220-
public static readonly List<Unicolour> AllHue192 = new()
220+
public static readonly IEnumerable<Unicolour> AllHue192 = new[]
221221
{
222222
Hue192Ref,
223223
new(Config, ColourSpace.Xyz, 0.023453, 0.029891, 0.037174),
@@ -243,7 +243,7 @@ public static class EbnerFairchild
243243
};
244244

245245
public static readonly Unicolour Hue216Ref = new(Config, ColourSpace.Xyz, 0.3787, 0.4828, 0.7231);
246-
public static readonly List<Unicolour> AllHue216 = new()
246+
public static readonly IEnumerable<Unicolour> AllHue216 = new[]
247247
{
248248
Hue216Ref,
249249
new(Config, ColourSpace.Xyz, 0.024666, 0.029891, 0.044851),
@@ -269,7 +269,7 @@ public static class EbnerFairchild
269269
};
270270

271271
public static readonly Unicolour Hue240Ref = new(Config, ColourSpace.Xyz, 0.3421, 0.4075, 0.7197);
272-
public static readonly List<Unicolour> AllHue240 = new()
272+
public static readonly IEnumerable<Unicolour> AllHue240 = new[]
273273
{
274274
Hue240Ref,
275275
new(Config, ColourSpace.Xyz, 0.026197, 0.029891, 0.049052),
@@ -294,7 +294,7 @@ public static class EbnerFairchild
294294
};
295295

296296
public static readonly Unicolour Hue264Ref = new(Config, ColourSpace.Xyz, 0.3149, 0.3405, 0.6623);
297-
public static readonly List<Unicolour> AllHue264 = new()
297+
public static readonly IEnumerable<Unicolour> AllHue264 = new[]
298298
{
299299
Hue264Ref,
300300
new(Config, ColourSpace.Xyz, 0.027982, 0.029891, 0.086685),
@@ -320,7 +320,7 @@ public static class EbnerFairchild
320320
};
321321

322322
public static readonly Unicolour Hue288Ref = new(Config, ColourSpace.Xyz, 0.2051, 0.1842, 0.5713);
323-
public static readonly List<Unicolour> AllHue288 = new()
323+
public static readonly IEnumerable<Unicolour> AllHue288 = new[]
324324
{
325325
Hue288Ref,
326326
new(Config, ColourSpace.Xyz, 0.030398, 0.029891, 0.061233),
@@ -349,7 +349,7 @@ public static class EbnerFairchild
349349
};
350350

351351
public static readonly Unicolour Hue312Ref = new(Config, ColourSpace.Xyz, 0.2765, 0.1842, 0.6201);
352-
public static readonly List<Unicolour> AllHue312 = new()
352+
public static readonly IEnumerable<Unicolour> AllHue312 = new[]
353353
{
354354
Hue312Ref,
355355
new(Config, ColourSpace.Xyz, 0.037048, 0.029891, 0.059648),
@@ -379,7 +379,7 @@ public static class EbnerFairchild
379379
};
380380

381381
public static readonly Unicolour Hue336Ref = new(Config, ColourSpace.Xyz, 0.4562, 0.2812, 0.5520);
382-
public static readonly List<Unicolour> AllHue336 = new()
382+
public static readonly IEnumerable<Unicolour> AllHue336 = new[]
383383
{
384384
Hue336Ref,
385385
new(Config, ColourSpace.Xyz, 0.059792, 0.029891, 0.067983),

Unicolour.Datasets/Flare.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ internal Flare()
1010
public override Unicolour Map(double x) => InterpolateColourTable(Lookup, x);
1111
public override string ToString() => nameof(Flare);
1212

13-
public static readonly Unicolour[] Lookup =
13+
public static readonly IEnumerable<Unicolour> Lookup = new Unicolour[]
1414
{
1515
new(Config, ColourSpace.Rgb, 0.92907237, 0.68878959, 0.50411509),
1616
new(Config, ColourSpace.Rgb, 0.92891402, 0.68494686, 0.50173994),

Unicolour.Datasets/HungBerns.cs

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -58,23 +58,23 @@ public static class HungBerns
5858
public static readonly Unicolour MagentaRed75 = new(Config, ColourSpace.Xyz, 0.5677, 0.3553, 0.5313);
5959
public static readonly Unicolour MagentaRedRef = new(Config, ColourSpace.Xyz, 0.6436, 0.3553, 0.5366);
6060

61-
public static readonly List<Unicolour> AllRed = new() { Red25, Red50, Red75, RedRef };
62-
public static readonly List<Unicolour> AllRedYellow = new() { RedYellow25, RedYellow50, RedYellow75, RedYellowRef };
63-
public static readonly List<Unicolour> AllYellow = new() { Yellow25, Yellow50, Yellow75, YellowRef };
64-
public static readonly List<Unicolour> AllYellowGreen = new() { YellowGreen25, YellowGreen50, YellowGreen75, YellowGreenRef };
65-
public static readonly List<Unicolour> AllGreen = new() { Green25, Green50, Green75, GreenRef };
66-
public static readonly List<Unicolour> AllGreenCyan = new() { GreenCyan25, GreenCyan50, GreenCyan75, GreenCyanRef };
67-
public static readonly List<Unicolour> AllCyan = new() { Cyan25, Cyan50, Cyan75, CyanRef };
68-
public static readonly List<Unicolour> AllCyanBlue = new() { CyanBlue25, CyanBlue50, CyanBlue75, CyanBlueRef };
69-
public static readonly List<Unicolour> AllBlue = new() { Blue25, Blue50, Blue75, BlueRef };
70-
public static readonly List<Unicolour> AllBlueMagenta = new() { BlueMagenta25, BlueMagenta50, BlueMagenta75, BlueMagentaRef };
71-
public static readonly List<Unicolour> AllMagenta = new() { Magenta25, Magenta50, Magenta75, MagentaRef };
72-
public static readonly List<Unicolour> AllMagentaRed = new() { MagentaRed25, MagentaRed50, MagentaRed75, MagentaRedRef };
61+
public static readonly IEnumerable<Unicolour> AllRed = new[] { Red25, Red50, Red75, RedRef };
62+
public static readonly IEnumerable<Unicolour> AllRedYellow = new[] { RedYellow25, RedYellow50, RedYellow75, RedYellowRef };
63+
public static readonly IEnumerable<Unicolour> AllYellow = new[] { Yellow25, Yellow50, Yellow75, YellowRef };
64+
public static readonly IEnumerable<Unicolour> AllYellowGreen = new[] { YellowGreen25, YellowGreen50, YellowGreen75, YellowGreenRef };
65+
public static readonly IEnumerable<Unicolour> AllGreen = new[] { Green25, Green50, Green75, GreenRef };
66+
public static readonly IEnumerable<Unicolour> AllGreenCyan = new[] { GreenCyan25, GreenCyan50, GreenCyan75, GreenCyanRef };
67+
public static readonly IEnumerable<Unicolour> AllCyan = new[] { Cyan25, Cyan50, Cyan75, CyanRef };
68+
public static readonly IEnumerable<Unicolour> AllCyanBlue = new[] { CyanBlue25, CyanBlue50, CyanBlue75, CyanBlueRef };
69+
public static readonly IEnumerable<Unicolour> AllBlue = new[] { Blue25, Blue50, Blue75, BlueRef };
70+
public static readonly IEnumerable<Unicolour> AllBlueMagenta = new[] { BlueMagenta25, BlueMagenta50, BlueMagenta75, BlueMagentaRef };
71+
public static readonly IEnumerable<Unicolour> AllMagenta = new[] { Magenta25, Magenta50, Magenta75, MagentaRef };
72+
public static readonly IEnumerable<Unicolour> AllMagentaRed = new[] { MagentaRed25, MagentaRed50, MagentaRed75, MagentaRedRef };
7373

74-
public static readonly List<Unicolour> All25 = new() { Red25, RedYellow25, Yellow25, YellowGreen25, Green25, GreenCyan25, Cyan25, CyanBlue25, Blue25, BlueMagenta25, Magenta25, MagentaRed25 };
75-
public static readonly List<Unicolour> All50 = new() { Red50, RedYellow50, Yellow50, YellowGreen50, Green50, GreenCyan50, Cyan50, CyanBlue50, Blue50, BlueMagenta50, Magenta50, MagentaRed50 };
76-
public static readonly List<Unicolour> All75 = new() { Red75, RedYellow75, Yellow75, YellowGreen75, Green75, GreenCyan75, Cyan75, CyanBlue75, Blue75, BlueMagenta75, Magenta75, MagentaRed75 };
77-
public static readonly List<Unicolour> AllRef = new() { RedRef, RedYellowRef, YellowRef, YellowGreenRef, GreenRef, GreenCyanRef, CyanRef, CyanBlueRef, BlueRef, BlueMagentaRef, MagentaRef, MagentaRedRef };
74+
public static readonly IEnumerable<Unicolour> All25 = new[] { Red25, RedYellow25, Yellow25, YellowGreen25, Green25, GreenCyan25, Cyan25, CyanBlue25, Blue25, BlueMagenta25, Magenta25, MagentaRed25 };
75+
public static readonly IEnumerable<Unicolour> All50 = new[] { Red50, RedYellow50, Yellow50, YellowGreen50, Green50, GreenCyan50, Cyan50, CyanBlue50, Blue50, BlueMagenta50, Magenta50, MagentaRed50 };
76+
public static readonly IEnumerable<Unicolour> All75 = new[] { Red75, RedYellow75, Yellow75, YellowGreen75, Green75, GreenCyan75, Cyan75, CyanBlue75, Blue75, BlueMagenta75, Magenta75, MagentaRed75 };
77+
public static readonly IEnumerable<Unicolour> AllRef = new[] { RedRef, RedYellowRef, YellowRef, YellowGreenRef, GreenRef, GreenCyanRef, CyanRef, CyanBlueRef, BlueRef, BlueMagentaRef, MagentaRef, MagentaRedRef };
7878

7979
public static IEnumerable<Unicolour> All => new List<Unicolour>()
8080
.Concat(AllRed)

Unicolour.Datasets/Icefire.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ internal Icefire()
1010
public override Unicolour Map(double x) => InterpolateColourTable(Lookup, x);
1111
public override string ToString() => nameof(Icefire);
1212

13-
public static readonly Unicolour[] Lookup =
13+
public static readonly IEnumerable<Unicolour> Lookup = new Unicolour[]
1414
{
1515
new(Config, ColourSpace.Rgb, 0.73936227, 0.90443867, 0.85757238),
1616
new(Config, ColourSpace.Rgb, 0.72888063, 0.89639109, 0.85488394),

Unicolour.Datasets/Inferno.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ internal Inferno()
1010
public override Unicolour Map(double x) => InterpolateColourTable(Lookup, x);
1111
public override string ToString() => nameof(Inferno);
1212

13-
public static readonly Unicolour[] Lookup =
13+
public static readonly IEnumerable<Unicolour> Lookup = new Unicolour[]
1414
{
1515
new(Config, ColourSpace.Rgb, 0.001462, 0.000466, 0.013866),
1616
new(Config, ColourSpace.Rgb, 0.002267, 0.00127, 0.01857),

Unicolour.Datasets/MacAdam.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@ public static class MacAdam
55
{
66
private static readonly Configuration Config = new(RgbConfiguration.StandardRgb, XyzConfiguration.D65);
77

8-
public static readonly Unicolour[] Limits10 = MacAdamLimits.Get(0.10).Select(chromaticity => new Unicolour(Config, chromaticity, 0.10)).ToArray();
9-
public static readonly Unicolour[] Limits20 = MacAdamLimits.Get(0.20).Select(chromaticity => new Unicolour(Config, chromaticity, 0.20)).ToArray();
10-
public static readonly Unicolour[] Limits30 = MacAdamLimits.Get(0.30).Select(chromaticity => new Unicolour(Config, chromaticity, 0.30)).ToArray();
11-
public static readonly Unicolour[] Limits40 = MacAdamLimits.Get(0.40).Select(chromaticity => new Unicolour(Config, chromaticity, 0.40)).ToArray();
12-
public static readonly Unicolour[] Limits50 = MacAdamLimits.Get(0.50).Select(chromaticity => new Unicolour(Config, chromaticity, 0.50)).ToArray();
13-
public static readonly Unicolour[] Limits60 = MacAdamLimits.Get(0.60).Select(chromaticity => new Unicolour(Config, chromaticity, 0.60)).ToArray();
14-
public static readonly Unicolour[] Limits70 = MacAdamLimits.Get(0.70).Select(chromaticity => new Unicolour(Config, chromaticity, 0.70)).ToArray();
15-
public static readonly Unicolour[] Limits80 = MacAdamLimits.Get(0.80).Select(chromaticity => new Unicolour(Config, chromaticity, 0.80)).ToArray();
16-
public static readonly Unicolour[] Limits90 = MacAdamLimits.Get(0.90).Select(chromaticity => new Unicolour(Config, chromaticity, 0.90)).ToArray();
17-
public static readonly Unicolour[] Limits95 = MacAdamLimits.Get(0.95).Select(chromaticity => new Unicolour(Config, chromaticity, 0.95)).ToArray();
8+
public static readonly IEnumerable<Unicolour> Limits10 = MacAdamLimits.Get(0.10).Select(chromaticity => new Unicolour(Config, chromaticity, 0.10)).ToArray();
9+
public static readonly IEnumerable<Unicolour> Limits20 = MacAdamLimits.Get(0.20).Select(chromaticity => new Unicolour(Config, chromaticity, 0.20)).ToArray();
10+
public static readonly IEnumerable<Unicolour> Limits30 = MacAdamLimits.Get(0.30).Select(chromaticity => new Unicolour(Config, chromaticity, 0.30)).ToArray();
11+
public static readonly IEnumerable<Unicolour> Limits40 = MacAdamLimits.Get(0.40).Select(chromaticity => new Unicolour(Config, chromaticity, 0.40)).ToArray();
12+
public static readonly IEnumerable<Unicolour> Limits50 = MacAdamLimits.Get(0.50).Select(chromaticity => new Unicolour(Config, chromaticity, 0.50)).ToArray();
13+
public static readonly IEnumerable<Unicolour> Limits60 = MacAdamLimits.Get(0.60).Select(chromaticity => new Unicolour(Config, chromaticity, 0.60)).ToArray();
14+
public static readonly IEnumerable<Unicolour> Limits70 = MacAdamLimits.Get(0.70).Select(chromaticity => new Unicolour(Config, chromaticity, 0.70)).ToArray();
15+
public static readonly IEnumerable<Unicolour> Limits80 = MacAdamLimits.Get(0.80).Select(chromaticity => new Unicolour(Config, chromaticity, 0.80)).ToArray();
16+
public static readonly IEnumerable<Unicolour> Limits90 = MacAdamLimits.Get(0.90).Select(chromaticity => new Unicolour(Config, chromaticity, 0.90)).ToArray();
17+
public static readonly IEnumerable<Unicolour> Limits95 = MacAdamLimits.Get(0.95).Select(chromaticity => new Unicolour(Config, chromaticity, 0.95)).ToArray();
1818

1919
public static IEnumerable<Unicolour> All => new List<Unicolour>()
2020
.Concat(Limits10)

0 commit comments

Comments
 (0)