Code: Select all
Procedure.l ColorStringToNumber(col.s)
Define.l ncol = 0
Define.s xcol = ""
If Left(col, 1) = "#"
Define.s xcol = LSet(col, 7, "0")
Define.a nR = Val("$" + Mid(xcol, 2, 2))
Define.a nG = Val("$" + Mid(xcol, 4, 2))
Define.a nB = Val("$" + Mid(xcol, 6, 2))
ncol = RGB(nR, nG, nB)
Else
ncol = ColorStringToNumber(ColorNameToHex(col)) ; omitted for brevity
EndIf
ProcedureReturn ncol
EndProcedure
Throughout libxlsxwriter colors are specified using a Html style RGB integer value. For example with a Format object:
Code: Select all
// typedef uint32_t lxw_color_t
format_set_font_color(format, 0x3030E0);
If somebody could point me in the right direction I'd be grateful
