-
-
Notifications
You must be signed in to change notification settings - Fork 36
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
formatRow Colors don't appear to work #177
Comments
Hi James. Which other named colours have you tested and found not to work? I've just checked AQUA, BLACK and BLUE and they all worked on ACF2016 with Java 11, e.g.
GREY is not a valid pre-defined colour in POI, you need to choose from: GREY_25_PERCENT There's a link to the full set of pre-set colours on the Formatting Options wiki page under That page is linked from the formatRow() wiki page, and all of the other functions which allow formatting options to be passed. It's also on the main wiki home page. I like your suggestion of a function to return the full set of pre-set colour names. Will look into that. |
I've added |
Thanks for the quick response! I tested the developer branch and the array of colors is awesome and will make it easier for developers to identify available colors without having to return to the online documentation (since it's always possible that these options may change.) When I viewed the online documentation in the wiki yesterday, it looked like this:
I didn't notice the link above under Before posting, I saw this comment from 2016 regarding using RGB and it worked. (I prefer this method anyway and will probably generate my own color palette function.) OPINION/DIFFERENT ISSUE: Regarding passing an invalid color as an option, what do you think about using a predefined fallback color versus throwing an error? IMHO, this is purely cosmetic and probably shouldn't be a showstopper... but you'd probably need to be aware of the full context so that white text on a white background isn't being outputted. (ie, maybe force a named color if RGB triplet is used and output format is XLS.) |
Thanks for the feedback. I've tried to make the link to the predefined colours more obvious on the formatting options page. As for the fallback colour... my gut reaction is to let the user (developer) handle the exception (which does tell you what you've done wrong) as they wish. Otherwise you could be left scratching your head as to why the colour you specified is ending up as something else. And as you say there are dangers in forcing an inappropriate colour, and complexities in trying to mitigate that. It's a good thought, but I think I prefer to leave things as they are. |
PS: I've amended the last commit in develop to improve the exception message if you use an invalid colour, so that it prompts you to use the new |
When using formatRow(), the color documentation doesn't provide much information. I've tested multiple named colors and have only found "GREEN" to work (when using v2.7.0 with ACF 2016 & Java 11.)
While reviewing some other reported issues, I saw that RGB triplet values worked. (This should be added to the documentation.)
Recommendation: Add a function to retrieve and display all possible "named" colors.
The text was updated successfully, but these errors were encountered: