In addition to what nilamo said i dont believe your color variables are changing at all as you expect it to be. If you throw a couple prints around color is always the same and never seems to change in any of the draw methods.
Which leads me to believe that there might be an issue with your condition, or even before further of that. Didn't look too far into your code.
Which in turn, leads me to show you this...
https://python-forum.io/Thread-Basic-Nev...n-sequence
as it makes it hard to read for everyone and may introduce bugs. As well as not very pythonic.
Output:Progress: [███-----------------------------------------------] 7.3% Completecolor is (75, 75, 75)
color is (75, 75, 75)
color is (75, 75, 75)
color is (75, 75, 75)
Progress: [███-----------------------------------------------] 7.3% Completecolor is (75, 75, 75)
color is (75, 75, 75)
color is (75, 75, 75)
color is (75, 75, 75)
Progress: [███-----------------------------------------------] 7.4% Completecolor is (75, 75, 75)
color is (75, 75, 75)
color is (75, 75, 75)
color is (75, 75, 75)
Progress: [███-----------------------------------------------] 7.4% Completecolor is (75, 75, 75)
color is (75, 75, 75)
color is (75, 75, 75)
color is (75, 75, 75)
Progress: [███-----------------------------------------------] 7.4% Completecolor is (75, 75, 75)
color is (75, 75, 75)
color is (75, 75, 75)
color is (75, 75, 75)
Progress: [███-----------------------------------------------] 7.4% Completecolor is (75, 75, 75)
color is (75, 75, 75)
color is (75, 75, 75)
color is (75, 75, 75)
Progress: [███-----------------------------------------------] 7.4% Completecolor is (75, 75, 75)
color is (75, 75, 75)
color is (75, 75, 75)
color is (75, 75, 75)
Progress: [███-----------------------------------------------] 7.4% Completecolor is (75, 75, 75)
color is (75, 75, 75)
color is (75, 75, 75)
color is (75, 75, 75)
Progress: [███-----------------------------------------------] 7.4% Completecolor is (75, 75, 75)
color is (75, 75, 75)
color is (75, 75, 75)
color is (75, 75, 75)
If they are rapidly suppose to be changing from red to black and back, then it doesnt look like the color is changing at all in the first place. Which leads me to believe that there might be an issue with your condition, or even before further of that. Didn't look too far into your code.
Quote:for i in range(len(self.__o_nodes)): if self.__o_nodes[i].data >= 0: color = black else: color = red
Which in turn, leads me to show you this...
https://python-forum.io/Thread-Basic-Nev...n-sequence
as it makes it hard to read for everyone and may introduce bugs. As well as not very pythonic.
Recommended Tutorials: