8using System.Collections.Generic;
85 get => backgroundColor;
104 get => foregroundColor;
143 public Fill(
string foreground,
string background)
181 StringBuilder sb =
new StringBuilder();
182 sb.Append(
"\"Fill\": {\n");
187 AddPropertyAsJson(sb,
"HashCode", this.
GetHashCode(),
true);
189 return sb.ToString();
218 int hashCode = -1564173520;
219 hashCode = hashCode * -1521134295 + EqualityComparer<string>.Default.GetHashCode(
BackgroundColor);
220 hashCode = hashCode * -1521134295 + EqualityComparer<string>.Default.GetHashCode(
ForegroundColor);
221 hashCode = hashCode * -1521134295 +
IndexedColor.GetHashCode();
222 hashCode = hashCode * -1521134295 +
PatternFill.GetHashCode();
234 return obj is
Fill fill &&
271 #region staticMethods
277 internal static string GetPatternName(
PatternValue pattern)
289 output =
"mediumGray";
292 output =
"lightGray";
310 internal static PatternValue GetPatternEnum(
string name)
Class represents an abstract style component.
FillType
Enum for the type of the color, used by the Fill class.
@ PatternColor
Color defines a pattern color.
@ FillColor
Color defines a solid fill color.
Fill CopyFill()
Method to copy the current object to a new one with casting.
override bool Equals(object obj)
Returns whether two instances are the same.
string BackgroundColor
Gets or sets the background color of the fill. The value is expressed as hex string with the format A...
Fill()
Default constructor.
static readonly PatternValue DefaultPatternFill
Default pattern.
override int GetHashCode()
Returns a hash code for this instance.
void SetColor(string value, FillType fillType)
Sets the color and the depending on fill type.
override string ToString()
Override toString method.
static readonly int DefaultIndexedColor
Default index color.
static readonly string DefaultColor
Default Color (foreground or background).
Fill(string value, FillType fillType)
Constructor with color value and fill type.
int IndexedColor
Gets or sets the indexed color (Default is 64).
override AbstractStyle Copy()
Method to copy the current object to a new one without casting.
PatternValue
Enum for the pattern values, used by the Fill class.
@ MediumGray
Medium gray fill.
@ Gray0625
6.25% gray fill
@ None
No pattern (default).
@ DarkGray
Dark gray fill.
@ Solid
Solid fill (for colors).
@ LightGray
Light gray fill.
string ForegroundColor
Gets or sets the foreground color of the fill. The value is expressed as hex string with the format A...
PatternValue PatternFill
Gets or sets the pattern type of the fill (Default is none).
Fill(string foreground, string background)
Constructor with foreground and background color.
Class providing static methods to parse string values to specific types or to print object as languag...
static string ToUpper(string input)
Transforms a string to upper case with null check and invariant culture.
Class providing general validator methods.
static void ValidateColor(string hexCode, bool useAlpha, bool allowEmpty=false)
Validates the passed string, whether it is a valid RGB or ARGB value that can be used for Fills or Fo...