Skip to content

ZeroDivisionError in Python-2.7.3/Lib/colorsys.py #7

Description

@valawilliams

line 77 in rgb_to_hls divides by 2.0-maxc-minc which is sometimes zero.
Fix by inserting before line 74
if (2.0-maxc-minc) == 0:
return(0.0, l, 0.0)
similar to lines 72-73.
Error also exists in python 3 library.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions