Allow all color types for PixelArray methods and mask.from_threshold #3164
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I understand why slice-assignment of pixelarrays limits the allowed types, but this was likely not intended for the
replace()
andextract()
methods, as they were typehinted withColorValue
but don't currently allow all color values.This PR adds a C function specifically for those methods, making the typehints true.
The same thing applies to
mask.from_threshold
.If you think they should not accept all color types, I can change the PR to change the typehints instead, of course.