Skip to content

Commit

Permalink
determine breath val on selected val (KMKfw#865)
Browse files Browse the repository at this point in the history
Determine breath val on selected val

---------

Co-authored-by: xs5871 <60395129+xs5871@users.noreply.github.com>
  • Loading branch information
2 people authored and Alex Elias committed Nov 25, 2023
1 parent ab3087a commit ecc9763
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions kmk/extensions/rgb.py
Original file line number Diff line number Diff line change
Expand Up @@ -482,11 +482,11 @@ def effect_breathing(self):
# https://github.com/qmk/qmk_firmware/blob/9f1d781fcb7129a07e671a46461e501e3f1ae59d/quantum/rgblight.c#L806
sined = sin((self.pos / 255.0) * pi)
multip_1 = exp(sined) - self.breathe_center / e
multip_2 = self.val_limit / (e - 1 / e)
multip_2 = self.val / (e - 1 / e)

self.val = int(multip_1 * multip_2)
val = int(multip_1 * multip_2)
self.pos = (self.pos + self._step) % 256
self.set_hsv_fill(self.hue, self.sat, self.val)
self.set_hsv_fill(self.hue, self.sat, val)

def effect_breathing_rainbow(self):
self.increase_hue(self._step)
Expand Down

0 comments on commit ecc9763

Please sign in to comment.