MattIPv4 / PyDMXControl

A Python 3 module to control DMX using OpenDMX or uDMX - Featuring fixture profiles, built-in effects and a web control panel.
https://pypi.org/project/PyDMXControl/
GNU General Public License v3.0
114 stars 22 forks source link

Refactor Colors using itertools #31

Closed oxy closed 4 years ago

oxy commented 4 years ago

Improve code readability by using itertools.zip_longest(), zip() and moving clamp() to a separate static method.

Does not change behaviour.

oxy commented 4 years ago

Clamp as of right now returns an integer, but to clamp percentage means it'll have to return floats too. Should I define a type Number = Union[int, float] above for the function?

MattIPv4 commented 4 years ago

You can just set the return type to be the union, not point creating a custom type for it.

oxy commented 4 years ago

Tests on Scrutinizer have completed a long time ago but still show as pending, there's some kind of bug.