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

poi-ooxml: add new API to add text transparency on XLSX #214

Open
wants to merge 1 commit into
base: trunk
Choose a base branch
from

Conversation

artragis
Copy link

@artragis artragis commented Jan 4, 2021

This API uses XSSFColor built with alpha channel to set up the right value.
We must take care of the fact Excel uses 1000th of percent and positive numbers

This API uses XSSFColor built with alpha channel to set up the right value.
We must take care of the fact Excel uses 1000th of percent and positive numbers
@@ -863,6 +864,41 @@ private boolean fetchParagraphProperty(ParagraphPropertyFetcher visitor){
return ok;
}

public void setTextFillColor(XSSFColor color) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you add a getTextFillColor?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Must I return null if no fill colour is found?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably best to return null if no value is set

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I will try to do so. But translating CTColors into XSSFColor may be hard, Is there any helper to do that in the project?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

XSSFColor has public static XSSFColor from(CTColor color, IndexedColorMap map) - you can use new DefaultIndexedColorMap()

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok I will try to build org.openxmlformats.schemas.spreadsheetml.x2006.main.CTColor from CTSolidColorFillProperties.

I'm wondering if we cannot create a sub interface for all those colors instead of CTColor

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