Bug report
Bug description:
In the colorsys.py module, the conversion functions output values out of range if the given input is invalid. Example:
>>> import colorsys
>>> colorsys.rgb_to_hls(10,20,30)
(0.5833333333333334, 20.0, -0.5263157894736842)
In the above example, the output HLS color is invalid since l is in range [0,1]. This is also specified in the colorsys documentation.
This issue has already been discussed at : #102581
I believe it can be solved in many ways such as:
- Mandatory or optional clipping
- Raising errors
- Adding new functions inside the module that make validation mandatory along with the existing functions
- Modify the conversion functions to accept new arguments such as clip or validate
as discussed in the old issue. Whatever way it is, I am open for discussion and solving it with a PR.
CPython versions tested on:
3.13
Operating systems tested on:
Windows
Bug report
Bug description:
In the colorsys.py module, the conversion functions output values out of range if the given input is invalid. Example:
In the above example, the output HLS color is invalid since l is in range [0,1]. This is also specified in the colorsys documentation.
This issue has already been discussed at : #102581
I believe it can be solved in many ways such as:
as discussed in the old issue. Whatever way it is, I am open for discussion and solving it with a PR.
CPython versions tested on:
3.13
Operating systems tested on:
Windows