This commit is contained in:
@@ -6,15 +6,13 @@
|
||||
public readonly struct CellFill : IEquatable<CellFill>
|
||||
{
|
||||
/// <summary>Цвет фона.</summary>
|
||||
public ExColor? BackgroundColor { get; init; }
|
||||
public System.Drawing.Color? BackgroundColor { get; init; }
|
||||
|
||||
/// <summary>Создаёт элемент Fill для Open XML.</summary>
|
||||
public Fill? ToFill()
|
||||
{
|
||||
if (!BackgroundColor.HasValue || !BackgroundColor.Value.Color.HasValue)
|
||||
return null;
|
||||
if (BackgroundColor is not { } c) return null;
|
||||
|
||||
var c = BackgroundColor.Value.Color.Value;
|
||||
var fill = new Fill
|
||||
{
|
||||
PatternFill = new PatternFill
|
||||
@@ -37,7 +35,7 @@ public readonly struct CellFill : IEquatable<CellFill>
|
||||
Convert.ToByte(rgb.Substring(2, 2), 16),
|
||||
Convert.ToByte(rgb.Substring(4, 2), 16)
|
||||
);
|
||||
return new CellFill { BackgroundColor = new ExColor(color) };
|
||||
return new CellFill { BackgroundColor = color };
|
||||
}
|
||||
|
||||
public override bool Equals(object? obj) => obj is CellFill other && Equals(other);
|
||||
|
||||
Reference in New Issue
Block a user