我正在使用 Roo ruby gem 来解析 xlsx 文件。
有没有办法获得单元格的背景颜色?我已经查看了所有代码,但找不到如何去做。
使用 roo 打开电子表格非常简单:
spreadsheet = Roo::Excelx.new(file_path)
# Get me a sheet
sheet = spreadsheet.sheet("278")
# I happily thought excelx_format would return something that has
# to do with color, but it (sensibly) returns the cell format.
# In this case is GENERAL (no particular format)
puts sheet.excelx_format(6, 6)