From 862c9ec7c41f065f4173af78cce66a2308b3b510 Mon Sep 17 00:00:00 2001 From: Knut Ahlers Date: Sun, 9 Aug 2020 15:29:51 +0200 Subject: [PATCH] Fix: Do not shadow key index Signed-off-by: Knut Ahlers --- cmd/streamdeck/display_exec.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cmd/streamdeck/display_exec.go b/cmd/streamdeck/display_exec.go index 3e556f8..f1c38d3 100644 --- a/cmd/streamdeck/display_exec.go +++ b/cmd/streamdeck/display_exec.go @@ -102,12 +102,12 @@ func (d displayElementExec) Display(ctx context.Context, idx int, attributes map tmpCol := color.RGBA{} - for idx, vp := range []*uint8{&tmpCol.R, &tmpCol.G, &tmpCol.B, &tmpCol.A} { - switch rgba[idx].(type) { + for cidx, vp := range []*uint8{&tmpCol.R, &tmpCol.G, &tmpCol.B, &tmpCol.A} { + switch rgba[cidx].(type) { case int: - *vp = uint8(rgba[idx].(int)) + *vp = uint8(rgba[cidx].(int)) case float64: - *vp = uint8(rgba[idx].(float64)) + *vp = uint8(rgba[cidx].(float64)) } }