Skip to content
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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

botzill
Copy link
Contributor

@botzill botzill commented Feb 9, 2017

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.

@botzill
Copy link
Contributor Author

botzill commented Feb 18, 2017

@winhamwr Any chance you can take a look at this PR as well ?

@botzill botzill force-pushed the issue-230-table-cell-background-color branch from 79ed846 to 4cf6299 Compare February 18, 2017 07:24
background_fill = getattr(self, 'background_fill', None)

# There is no need to set white background color
if background_fill not in ('auto', 'FFFFFF'):
Copy link
Contributor

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?

Copy link
Contributor Author

@botzill botzill Feb 23, 2017

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 👍 .

@botzill botzill force-pushed the issue-230-table-cell-background-color branch 2 times, most recently from aa503bf to 2bf9a7b Compare March 2, 2017 10:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants