-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathLabColor.cs
More file actions
55 lines (34 loc) · 1.03 KB
/
LabColor.cs
File metadata and controls
55 lines (34 loc) · 1.03 KB
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
using Gsemac.Core;
namespace Gsemac.Drawing {
public struct LabColor {
// Public members
public double L => l;
public double A => a;
public double B => b;
public LabColor(double l, double a, double b) {
this.l = l;
this.a = a;
this.b = b;
}
public override bool Equals(object obj) {
return GetHashCode() == obj.GetHashCode();
}
public override int GetHashCode() {
return new HashCodeBuilder()
.WithValue(L)
.WithValue(A)
.WithValue(B)
.Build();
}
public static bool operator ==(LabColor left, LabColor right) {
return left.Equals(right);
}
public static bool operator !=(LabColor left, LabColor right) {
return !(left == right);
}
// Private members
private readonly double l;
private readonly double a;
private readonly double b;
}
}