diff --git a/examples/custom_starlight.py b/examples/custom_starlight.py
index 36b20050a724dc4bcf3984acbd9e66407c990a8b..995ac7c0c5fbec6166cd96cfc4c1c6dccd2feb49 100644
--- a/examples/custom_starlight.py
+++ b/examples/custom_starlight.py
@@ -48,16 +48,15 @@ def starlight_key(device, row, col, active):
 
     elapsed = 0
     while elapsed < fade_time:
-        elapsed = time.time() - start_time
         value = 1 - elapsed / fade_time
         rgb = colorsys.hsv_to_rgb(hue, 1, value)
         color = tuple(map(lambda x: int(256 * x), rgb))
 
         device.fx.advanced.matrix[row, col] = color
 
-        value -= 0.01
         # print(device, color)
         time.sleep(1 / 60)
+        elapsed = time.time() - start_time
 
     device.fx.advanced.matrix[row, col] = (0, 0, 0)
     active[(row, col)] = False