NanoXLSX.Core 3.0.0-rc.3
Loading...
Searching...
No Matches
ColorScheme.cs
1/*
2 * NanoXLSX is a small .NET library to generate and read XLSX (Microsoft Excel 2007 or newer) files in an easy and native way
3 * Copyright Raphael Stoeckli © 2025
4 * This library is licensed under the MIT License.
5 * You find a copy of the license in project folder or on: http://opensource.org/licenses/MIT
6 */
7
8using System.Collections.Generic;
10
12{
17 {
21 public string Name { get; set; }
22
26 public IColor Dark1 { get; set; }
30 public IColor Light1 { get; set; }
34 public IColor Dark2 { get; set; }
38 public IColor Light2 { get; set; }
42 public IColor Accent1 { get; set; }
46 public IColor Accent2 { get; set; }
50 public IColor Accent3 { get; set; }
54 public IColor Accent4 { get; set; }
58 public IColor Accent5 { get; set; }
62 public IColor Accent6 { get; set; }
66 public IColor Hyperlink { get; set; }
70 public IColor FollowedHyperlink { get; set; }
71
78 public ColorScheme()
79 {
80 // NoOp
81 }
82
88 public override bool Equals(object obj)
89 {
90 return obj is ColorScheme scheme &&
91 Name == scheme.Name &&
92 EqualityComparer<IColor>.Default.Equals(Dark1, scheme.Dark1) &&
93 EqualityComparer<IColor>.Default.Equals(Light1, scheme.Light1) &&
94 EqualityComparer<IColor>.Default.Equals(Dark2, scheme.Dark2) &&
95 EqualityComparer<IColor>.Default.Equals(Light2, scheme.Light2) &&
96 EqualityComparer<IColor>.Default.Equals(Accent1, scheme.Accent1) &&
97 EqualityComparer<IColor>.Default.Equals(Accent2, scheme.Accent2) &&
98 EqualityComparer<IColor>.Default.Equals(Accent3, scheme.Accent3) &&
99 EqualityComparer<IColor>.Default.Equals(Accent4, scheme.Accent4) &&
100 EqualityComparer<IColor>.Default.Equals(Accent5, scheme.Accent5) &&
101 EqualityComparer<IColor>.Default.Equals(Accent6, scheme.Accent6) &&
102 EqualityComparer<IColor>.Default.Equals(Hyperlink, scheme.Hyperlink) &&
103 EqualityComparer<IColor>.Default.Equals(FollowedHyperlink, scheme.FollowedHyperlink);
104 }
105
112 public override int GetHashCode()
113 {
114 unchecked
115 {
116 int hashCode = -1016302979;
117 hashCode = hashCode * -1521134295 + EqualityComparer<string>.Default.GetHashCode(Name);
118 hashCode = hashCode * -1521134295 + EqualityComparer<IColor>.Default.GetHashCode(Dark1);
119 hashCode = hashCode * -1521134295 + EqualityComparer<IColor>.Default.GetHashCode(Light1);
120 hashCode = hashCode * -1521134295 + EqualityComparer<IColor>.Default.GetHashCode(Dark2);
121 hashCode = hashCode * -1521134295 + EqualityComparer<IColor>.Default.GetHashCode(Light2);
122 hashCode = hashCode * -1521134295 + EqualityComparer<IColor>.Default.GetHashCode(Accent1);
123 hashCode = hashCode * -1521134295 + EqualityComparer<IColor>.Default.GetHashCode(Accent2);
124 hashCode = hashCode * -1521134295 + EqualityComparer<IColor>.Default.GetHashCode(Accent3);
125 hashCode = hashCode * -1521134295 + EqualityComparer<IColor>.Default.GetHashCode(Accent4);
126 hashCode = hashCode * -1521134295 + EqualityComparer<IColor>.Default.GetHashCode(Accent5);
127 hashCode = hashCode * -1521134295 + EqualityComparer<IColor>.Default.GetHashCode(Accent6);
128 hashCode = hashCode * -1521134295 + EqualityComparer<IColor>.Default.GetHashCode(Hyperlink);
129 hashCode = hashCode * -1521134295 + EqualityComparer<IColor>.Default.GetHashCode(FollowedHyperlink);
130 return hashCode;
131 }
132 }
133
134 }
135}
IColor Accent2
Theme color that defines the accent2 attribute of a theme.
override int GetHashCode()
Returns a hash code for this instance.
IColor Accent5
Theme color that defines the accent5 attribute of a theme.
IColor Accent6
Theme color that defines the accent6 attribute of a theme.
IColor Light2
Theme color that defines the light2 (bg2) attribute of a theme.
override bool Equals(object obj)
Returns whether two instances are the same.
IColor Accent4
Theme color that defines the accent4 attribute of a theme.
IColor Light1
Theme color that defines the light1 (bg1) attribute of a theme.
IColor Dark1
Theme color that defines the dark1 (t1) attribute of a theme.
IColor FollowedHyperlink
Theme color that defines the followedHyperlink attribute of a theme.
IColor Dark2
Theme color that defines the dark2 (t2) attribute of a theme.
IColor Accent1
Theme color that defines the accent1 attribute of a theme.
IColor Accent3
Theme color that defines the accent3 attribute of a theme.
string Name
Name of the color scheme.
ColorScheme()
Default constructor.
IColor Hyperlink
Theme color that defines the hyperlink attribute of a theme.
Interface to represent a color scheme that consists of 12 colors (IColor).
Interface to represent non typed color, either defined by the system or the user.
Definition IColor.cs:14