Some takeaways; 1. Adhere to a great style guide 2. Can you predict what the code does? Can you trace a path through the function calls, if statements and for loops? 3. Can you explain to someone what the code -means-? Why is it the way it is?
p = (170, .1, .6);
if p[1] > .5:
print("bright!")
elif p[2] > .5:
print("light")
That's ok, right? Pretty nice. I can see that it'll print "light".Good enough? No, not really. How are "bright" and "light" related to (170, .1, .6) and .5?
How about this?
color = Color(hue=170, saturation=.1, luminosity=.6)
if color.saturation > .5:
print("bright!")
elif color.luminosity > .5:
print("light!")
Far better! I know now that saturation is related to brightness, and that luminosity is related to lightness.
It takes about the same time to write, yet is far more legible.