Closed mantielero closed 1 year ago
There's patternFillStyle that's accepting fgColor
.
I didn't make the bgColor
public because I didn't see its effect when assigning its color while leaving the fgColor
default (no color). Hence the patternFillStyle
only accepts fgColor
argument.
If you can see its differences, please do share the sceenshoots and if possible, please PR to make the bgColor
field public.
Exploring the XML content within a .xlsx file, I came up with the following (which seems to work):
import excelin
import std/colors
let (excel, sheet) = newExcel()
let row1 = sheet.row 1
row1["A"] = "prueba"
row1.style("A",
fill = fillStyle(
pattern = patternFillStyle(patternType = ptSolid, fgColor = $colRed)
)
)
excel.writeFile "test.xlsx"
Regards
You didn't have to check the XML content though if you did carefully read this example https://github.com/mashingan/excelin#cell-styling
I tend to disagree.
Searching in the page for the words ptSolid
and solid
shows no results. I don't think it is obvious for the library user to know that a flat color requires to set the pattern to ptSolid
.
I think it would be better to make an explicit example because it is the most common use case for headers.
In any case, thanks a lot for your amazing library.
I think it would be better to make an explicit example because it is the most common use case for headers.
Appreciated for the input, I'll refine the examples more to be explicit on the available APIs.
I just assumed people could immediately look for the docs, but it's definitely better to be explicit.
Thank you.
I see the pattern and gradient arguments in
fillStyle
. But how can I do a normal flat background?