-
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
80 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package rgbanimations | ||
|
||
import keyboard "github.com/percyjw-2/tinygo-keyboard" | ||
|
||
func GetBansSpiralSatAnim() keyboard.RgbAnimation { | ||
return keyboard.RgbAnimation{ | ||
AnimationFunc: vialRGBBandSpiralSat, | ||
AnimationType: keyboard.VIALRGB_EFFECT_BAND_SPIRAL_SAT, | ||
} | ||
} | ||
|
||
func bandSpiralSatMath(matrix *keyboard.RGBMatrix, dx int16, dy int16, dist uint8, time uint16) (uint8, uint8, uint8) { | ||
s := Scale8(matrix.CurrentSaturation+dist-uint8(time)-Atan28(dy, dx), matrix.CurrentSaturation) | ||
return matrix.CurrentHue, s, matrix.CurrentValue | ||
} | ||
|
||
func vialRGBBandSpiralSat(matrix *keyboard.RGBMatrix) { | ||
effectRunnerDXDYDist(matrix, bandSpiralSatMath) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package rgbanimations | ||
|
||
import keyboard "github.com/percyjw-2/tinygo-keyboard" | ||
|
||
func GetBansSpiralValAnim() keyboard.RgbAnimation { | ||
return keyboard.RgbAnimation{ | ||
AnimationFunc: vialRGBBandSpiralVal, | ||
AnimationType: keyboard.VIALRGB_EFFECT_BAND_SPIRAL_VAL, | ||
} | ||
} | ||
|
||
func bandSpiralValMath(matrix *keyboard.RGBMatrix, dx int16, dy int16, dist uint8, time uint16) (uint8, uint8, uint8) { | ||
v := Scale8(matrix.CurrentValue+dist-uint8(time)-Atan28(dy, dx), matrix.CurrentValue) | ||
return matrix.CurrentHue, matrix.CurrentSaturation, v | ||
} | ||
|
||
func vialRGBBandSpiralVal(matrix *keyboard.RGBMatrix) { | ||
effectRunnerDXDYDist(matrix, bandSpiralValMath) | ||
} |