-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Fail early when setting Text color to a non-colorlike. #19571
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
Conversation
but |
All reactions
Sorry, something went wrong.
Otherwise, the error is only raised when drawing the artist, which is always confusing. Also add a general `_check_color_like` mechanism and use it for Line2D as well, instead of relying on a slightly strange `if not is_color_like(): check_in_list(get_named_colors_mapping())` call where the check_in_list *always* fails.
Yes...? |
All reactions
Sorry, something went wrong.
Thats what the original bug was failing on, wasn't it? |
All reactions
Sorry, something went wrong.
Given that the traceback ends with |
All reactions
-
👍 1 reaction
Sorry, something went wrong.
Don't see why this has to go in v3.4.1. @meeseeksdev backport to v3.4.x |
All reactions
Sorry, something went wrong.
… non-colorlike.
…571-on-v3.4.x Backport PR #19571 on branch v3.4.x (Fail early when setting Text color to a non-colorlike.)
Successfully merging this pull request may close these issues.
ValueError: Invalid RGBA argument: 'G'
Otherwise, the error is only raised when drawing the artist, which is
always confusing. Also add a general
_check_color_like
mechanism anduse it for Line2D as well, instead of relying on a slightly strange
if not is_color_like(): check_in_list(get_named_colors_mapping())
call where the check_in_list always fails.
Closes #19569 (well, likely the OP was confused about other stuff, but this should at least bring the error message closer to the relevant place).
PR Summary
PR Checklist
pytest
passes).flake8
on changed files to check).flake8-docstrings
and runflake8 --docstring-convention=all
).doc/users/next_whats_new/
(follow instructions in README.rst there).doc/api/next_api_changes/
(follow instructions in README.rst there).