@@ -190,7 +190,7 @@ def autoplay(self, delay=0, loops=0, frames=0):
190
190
self ._register (_CONFIG_BANK , _AUTOPLAY2_REGISTER , delay % 64 )
191
191
self ._mode (_AUTOPLAY_MODE | self ._frame )
192
192
193
- def fade (self , fade_in = None , fade_out = None , pause = 26 ):
193
+ def fade (self , fade_in = None , fade_out = None , pause = 0 ):
194
194
"""
195
195
Start and stop the fade feature. If both fade_in and fade_out are None (the
196
196
default), the breath feature is used for fading. if fade_in is None, then
@@ -207,9 +207,13 @@ def fade(self, fade_in=None, fade_out=None, pause=26):
207
207
fade_in = fade_out
208
208
elif fade_out is None :
209
209
fade_out = fade_in
210
- fade_in = int (math .log (fade_in / 26 , 2 ))
211
- fade_out = int (math .log (fade_out / 26 , 2 ))
212
- pause = int (math .log (pause / 26 , 2 ))
210
+
211
+ if fade_in != 0 :
212
+ fade_in = int (math .log (fade_in / 26 , 2 ))
213
+ if fade_out != 0 :
214
+ fade_out = int (math .log (fade_out / 26 , 2 ))
215
+ if pause != 0 :
216
+ pause = int (math .log (pause / 26 , 2 ))
213
217
if not 0 <= fade_in <= 7 :
214
218
raise ValueError ("Fade in out of range" )
215
219
if not 0 <= fade_out <= 7 :
0 commit comments