-
Notifications
You must be signed in to change notification settings - Fork 256
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
fill_color returns white #392
Comments
It's the same for me, on another sheet. It is #d9d9d9. I guess, grayscales are saved white, and their "brightness" gets reduced, in a separate value. |
I found same probrem. |
I found out the same – indexed colors are ignored.. I've composed such helper method to check color AND indexed color: class RubyXlUtils
class << self
def cell_color(cell)
return unless cell
color = cell.workbook.get_fill_color(cell.get_cell_xf)&.then { _1.last(6).downcase }
if color == 'ffffff'
color = cell_indexed_color(cell) || 'ffffff'
end
color
end
def cell_indexed_color(cell)
if (fill_id = cell.get_cell_xf.fill_id)
if (color_index = cell.workbook.fills[fill_id].pattern_fill&.fg_color&.indexed)
if (indexed_color = cell.workbook.stylesheet.colors&.indexed_colors&.dig(color_index))
indexed_color.rgb.last(6).downcase
end
end
end
end
end
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello,
With the attached xlsx, rubyXL tells me that cell A1 is white filled, whereas it is grey filled.
Did i missed something?
Thanks and regards
a.xlsx
The text was updated successfully, but these errors were encountered: