Allow color setting
This commit is contained in:
parent
a915977cea
commit
0a28f0b93c
|
@ -32,6 +32,11 @@ var previousEffect queue.QueueItem
|
||||||
|
|
||||||
var msDelay = 0
|
var msDelay = 0
|
||||||
|
|
||||||
|
func isColorSet(c RGBcolor) bool {
|
||||||
|
// Any color so long as it's NOT black!
|
||||||
|
return c[0] != 0 || c[1] != 0 || c[2] != 0
|
||||||
|
}
|
||||||
|
|
||||||
func foreverLoop() {
|
func foreverLoop() {
|
||||||
for /*ever*/ {
|
for /*ever*/ {
|
||||||
time.Sleep(time.Duration(msDelay) * time.Millisecond) //25fps
|
time.Sleep(time.Duration(msDelay) * time.Millisecond) //25fps
|
||||||
|
@ -169,7 +174,11 @@ func main() {
|
||||||
case "line":
|
case "line":
|
||||||
rearranged = remapping.SliceRearrange(PanelWidth, PanelHeight, true, remapping.XYGridToLinear(PanelWidth, PanelHeight, patterns.ZigZag(PanelWidth, PanelHeight)))
|
rearranged = remapping.SliceRearrange(PanelWidth, PanelHeight, true, remapping.XYGridToLinear(PanelWidth, PanelHeight, patterns.ZigZag(PanelWidth, PanelHeight)))
|
||||||
case "plasma":
|
case "plasma":
|
||||||
|
if isColorSet(currentEffect.SeedColour) {
|
||||||
|
rearranged = remapping.SliceRearrange(PanelWidth, PanelHeight, true, remapping.XYGridToLinear(PanelWidth, PanelHeight, patterns.PlasmaPanelSingleColor(PanelWidth, PanelHeight, currentEffect.Speed, currentEffect.SeedColour)))
|
||||||
|
} else {
|
||||||
rearranged = remapping.SliceRearrange(PanelWidth, PanelHeight, true, remapping.XYGridToLinear(PanelWidth, PanelHeight, patterns.PlasmaPanel(PanelWidth, PanelHeight, currentEffect.Speed)))
|
rearranged = remapping.SliceRearrange(PanelWidth, PanelHeight, true, remapping.XYGridToLinear(PanelWidth, PanelHeight, patterns.PlasmaPanel(PanelWidth, PanelHeight, currentEffect.Speed)))
|
||||||
|
}
|
||||||
case "red":
|
case "red":
|
||||||
rearranged = remapping.SliceRearrange(PanelWidth, PanelHeight, false, remapping.XYGridToLinear(PanelWidth, PanelHeight, patterns.RedPanel(PanelWidth, PanelHeight)))
|
rearranged = remapping.SliceRearrange(PanelWidth, PanelHeight, false, remapping.XYGridToLinear(PanelWidth, PanelHeight, patterns.RedPanel(PanelWidth, PanelHeight)))
|
||||||
case "random":
|
case "random":
|
||||||
|
|
Loading…
Reference in New Issue