summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaymond Hogenson <rayhogenson@openmailbox.org>2016-09-27 23:50:53 -0400
committerRaymond Hogenson <rayhogenson@openmailbox.org>2016-09-27 23:50:53 -0400
commitdd7dd93d9e1ee2e0095f0fa403a499b69aa289a8 (patch)
treef5220564a5b6042709c7faa66e388d80a5dee4c8
parent7d0c89c9b7fd9789b3331dee7c785da6b37ccd85 (diff)
downloadbridge-dd7dd93d9e1ee2e0095f0fa403a499b69aa289a8.tar.zst
Scale the amount to change by the distance
This way it doesn't take too long to get to where we're trying to go, but this might actually make it look worse. The best thing to do here is to experiment with the bridge directly.
-rw-r--r--fish_render.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/fish_render.py b/fish_render.py
index 6d24167..4924016 100644
--- a/fish_render.py
+++ b/fish_render.py
@@ -34,8 +34,9 @@ class Light(object):
def update(self, fish):
"""Change color depending on where the fish is."""
if abs(self.transitioning_to - self.color) < self.step:
- self.step = random_change()
self.transitioning_to = pick_HSV().to_RGB()
+ self.step = (random_change()
+ * abs(self.color - self.transitioning_to))
new_background = transition(
self.color, self.transitioning_to, self.step
)