gh-102581: Add clipping in colorsys.py#149572
Closed
manoj-km24 wants to merge 6 commits intopython:mainfrom
Closed
gh-102581: Add clipping in colorsys.py#149572manoj-km24 wants to merge 6 commits intopython:mainfrom
manoj-km24 wants to merge 6 commits intopython:mainfrom
Conversation
…idity and consistency
…idity and consistency
Documentation build overview
93 files changed ·
|
Member
|
I don't think a consensus has been reached. Can you please stop opening PRs for which no core dev expressed their opinions yet please? Instead we should try to revive #106254 if necessary as uniform clipping seemed to be desired. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR addresses issue 102581 (link : #102581).
As discussed, adding an optional
clipargument seems to be an aggressive expansion of the API and hence mandatory clipping and documenting it accordingly seems to be the best option.Clipping is shown in function
yiq_to_rgb()but not in any others. This makes the module inconsistent. This PR clipsRGB,HLS,HSVvalues andY(fromYIQ) in the range [0,1]. As for I and Q, For a valid RGB input, I stays between[-0.5957,0.5957]and Q stays between[-0.5226,0.5226]. (Source : https://en.wikipedia.org/wiki/YIQ#Formulas).I can also update the documentation if needed.
colorsysreturning out of bounds values #102581