-
-
Notifications
You must be signed in to change notification settings - Fork 183
added from_normalized() and get and set normalized methods for pygame.Color #2693
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For backward compatibility reasons, we cannot remove the normalize()
method. However, we can definitely add a new from_normalized()
class method, and a new normalized
property
Added it back |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot for the PR!
The implementation looks great!
A couple of things that need to be added:
- docs (see the comment about the color_doc.h file)
- tests, need to add those for the new property and classmethods, test file is
test/color_test.py
, just follow the existing tests for these properties and methods - type stubs, need to add those in
buildconfig/stubs/pygame/color.pyi
, again, just see how it is already done and follow that example
Also make sure you run |
in this commit, I changed the docs a little as requested also ran the python setup.py format which has changed some files for some reason, and hopefully made all the tests for the normalized representation
ok I have changed the docs a bit though I am not sure if this is how you wanteded it. So check it out again and tell me if it can be that way. Hopefully, I copied/made all the tests for the normalized representation if I have missed any pls tell me I am not sure I double checked but I may have missed one or two |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
I assume those other random files were formatted by python setup.py format
, since the changes are tiny, I assume it's fine to leave them in.
yeah exactly |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
this should add the feature requested in #2645
I added the
from_normalized()
method topygame.Color
also I added the getter and setter methods for thenormalized
parameter so you can change it