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

Parse colors with alpha channel #674

Closed
stefan-niedermann opened this issue Sep 1, 2020 · 2 comments
Closed

Parse colors with alpha channel #674

stefan-niedermann opened this issue Sep 1, 2020 · 2 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@stefan-niedermann
Copy link
Owner

For reference: nextcloud/deck#1545 (comment)

It might be possible to receive color with a format #rgba and #rrggbbaa. We need to make sure that our ColorUtil is capable of parsing a correct color in this cases (+ extend the UnitTests).

@stefan-niedermann stefan-niedermann added enhancement New feature or request good first issue Good for newcomers labels Sep 1, 2020
@juliushaertl
Copy link
Collaborator

We will just drop those for now in deck and apply the rgb values there, since both the frontend and database of deck currently only support plain colors without an alpha channel. However for the future it might make sense to already have this available in the app 😉

@stefan-niedermann
Copy link
Owner Author

Yeah, we get some very strange inputs here, while Nextcloud returns a format like #123456, the Deck app returns it without leading #, like 123456. In some weird cases, we also get formats like #123 from Nextcloud or 123 from Deck.

This tiny thing can break the whole sync (this usually pops up as an error, but when importing an account the very first time it can prevent the import at all). Therefore we have a util class and some unit tests to parse a color as good as possible.

I now added a simple case to strip all alpha information for now, so this will definitely make no issues in the near future 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants