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

Add hex value option to color methods #18

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

Conversation

conorschofield
Copy link

Added hex value option to foreground color and background color methods.

Changed parameter to accept either 3 rgb values or 1 hex value.

Added new test cases and successfully ran tests locally.

Python doesn't have a great way to have different number of parameters for a single function. Followed stack overflow thread

Added hex value option to foreground color and background color methods.

Changed parameter to accept either 3 rgb values or 1 hex value.

Python doesn't have a great way to have different number of parameters for a single function. Followed stack overflow thread: https://stackoverflow.com/questions/5079609/methods-with-the-same-name-in-one-class-in-python/74745600#74745600
@tynanford
Copy link
Collaborator

Thanks! Does this impact current users who might call the function like this?

widget.foreground_color(red=255,green=255,blue=255)

Or maybe even worse
widget.foreground_color(alpha=20,blue=255,red=255,green=255)

@conorschofield
Copy link
Author

This would impact current users calling the function with parameters named unfortunately. I can look into a way to maintain this functionality in Python.

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