Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Patternfill issue #1397

Closed
OssianEPPlus opened this issue Apr 3, 2024 · 0 comments
Closed

Patternfill issue #1397

OssianEPPlus opened this issue Apr 3, 2024 · 0 comments
Assignees
Labels
bug Something isn't working enhancement New feature or request

Comments

@OssianEPPlus
Copy link
Contributor

OssianEPPlus commented Apr 3, 2024

For ExcelFillXml the paths for fgColor and bgColor nodes are reversed as is correct for ExcelFillStyle.Solid but not other patternStyles.

As a continuation of this
Fill.PatternColor and Fill.BackgroundColor are also opposite from expectation when applying color to cell ranges.

code example:

using(var p = new ExcelPackage("MissMatchedColors.xlsx"))
{
    var sheet = p.Workbook.Worksheets.Add("missMatch");

    for (int i = 1; i < 20; i++)
    {
        sheet.Cells[i, 14].Value = i;
        sheet.Cells[i, 14].Style.Fill.PatternType = ExcelFillStyle.LightHorizontal;
        //This sets the pattern color.
        sheet.Cells[i, 14].Style.Fill.BackgroundColor.SetColor(Color.Red);
        //And this sets the background color.
        sheet.Cells[i, 14].Style.Fill.PatternColor.SetColor(Color.Blue);
    }

    p.Save();
}
@OssianEPPlus OssianEPPlus self-assigned this Apr 3, 2024
@OssianEPPlus OssianEPPlus changed the title Re-setting patterntypes unsets color fill If PatternType of cell is Solid. It's background color becomes foreground color when a new patterntype is applied Apr 3, 2024
@OssianEPPlus OssianEPPlus changed the title If PatternType of cell is Solid. It's background color becomes foreground color when a new patterntype is applied PatternColor and BackgroundColor are opposite from expected in most cases Apr 3, 2024
@OssianEPPlus OssianEPPlus added bug Something isn't working enhancement New feature or request labels Apr 3, 2024
@OssianEPPlus OssianEPPlus closed this as not planned Won't fix, can't repro, duplicate, stale Apr 3, 2024
@OssianEPPlus OssianEPPlus changed the title PatternColor and BackgroundColor are opposite from expected in most cases Patternfill issue Apr 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant