-
Notifications
You must be signed in to change notification settings - Fork 193
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
Allows setting/resetting entity.rgb
to None
#1116
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.
This is not the correct way.
If you rally need this feature implement the @rgb.deleter
method and check if the attrib true_color
exists otherwise a DXFAttributeError
will be raised.
Thanks for reviewing, I'll update accordingly |
Hi, @mozman , could you please review again? |
Set RGB true color as (r, g , b) tuple e.g. (12, 34, 56). | ||
Also allows setting/resetting rgb to None. | ||
""" | ||
if rgb is None: |
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.
This case should raise a TypeError, None is not a valid input or revert everything because the previous version raised the TypeError automatically.
- implement DXFGraphic.rgb deleter method. - add tests for DXFGraphic.rgb - update docs and changelog
@kkkkkom thanks for the idea, to speed up the process I added all the necessary changes myself |
Thanks! |
Hi, @mozman , could you please review this minor merge request?
I think we should allow
entity.rgb
to be set/reset toNone
.Many entity rgbs are initially
None
by default, and this change will allow users/developers to temporarily set rgb and reset it back without causing an error.pytest has passed clean locally.