-
Notifications
You must be signed in to change notification settings - Fork 55
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
Add table cell background color #231
base: master
Are you sure you want to change the base?
Add table cell background color #231
Conversation
@winhamwr Any chance you can take a look at this PR as well ? |
79ed846
to
4cf6299
Compare
background_fill = getattr(self, 'background_fill', None) | ||
|
||
# There is no need to set white background color | ||
if background_fill not in ('auto', 'FFFFFF'): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it make sense to reuse COLOR_FOR_DARK_BACKGROUND here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess we can use, word color is also in RRGGBB format, good catch 👍 .
aa503bf
to
2bf9a7b
Compare
2bf9a7b
to
fd31f4d
Compare
Related to #230.
Few notes about implementation. Currently we may have cases when cell background color is set to a dark color(like black). In Office this is handled automatically and they convert text into white(if there is not custom color set for text). I also tried to handle this case by checking the color brightness using this formula: http://alienryderflex.com/hsp.html. This way if we detect a dark color we convert text to custom white color.