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

fix: MultiPurposeLabel text color #3485

Conversation

Kuchenpirat
Copy link
Collaborator

What type of PR is this?

  • bug

What this PR does / why we need it:

To determine the text Color of the MultiPurposeLabel Chip we expexted a 6 digit hex RGB-value.
If it was less than 4 the label was always white and since vuetify (which handles the Labels background color) does support multiple color spaces it was possible to end up with e.g a white label with white text.

This uses the already installed @sphinxxxx/color-conversion to support multiple color spaces. Additionaly i added an condition that always returns black text when the opacity of the background color is less than 30%.

This theoretically also alows for color to be written out. E.g writing "purple" in the color field.

Which issue(s) this PR fixes:

Fixes #3433

Special notes for your reviewer:

None

Testing

manual

@Kuchenpirat Kuchenpirat changed the title use color-conversion library to determine text color fix: MultipurposeLabel text color Apr 17, 2024
@Kuchenpirat Kuchenpirat changed the title fix: MultipurposeLabel text color fix: MultiPurposeLabel text color Apr 17, 2024
@michael-genson michael-genson merged commit 360b8e2 into mealie-recipes:mealie-next Apr 17, 2024
10 checks passed
@Kuchenpirat Kuchenpirat deleted the fix-MultiPurposeLabel-Background-Text-Color branch April 17, 2024 20:38
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.

Text color of food labels varies based on length of color code
2 participants