diff --git a/cmd/streamdeck/display_exec.go b/cmd/streamdeck/display_exec.go index 21440e1..dc8cc44 100644 --- a/cmd/streamdeck/display_exec.go +++ b/cmd/streamdeck/display_exec.go @@ -62,6 +62,19 @@ func (d displayElementExec) Display(ctx context.Context, idx int, attributes att } // Initialize background + if attributes.BackgroundColor != nil { + if len(attributes.BackgroundColor) != 4 { + return errors.New("Background color definition needs 4 hex values") + } + + if err := ctx.Err(); err != nil { + // Page context was cancelled, do not draw + return err + } + + imgRenderer.DrawBackgroundColor(attributes.BackgroundToColor()) + } + if attributes.Image != "" { if err = imgRenderer.DrawBackgroundFromFile(attributes.Image); err != nil { return errors.Wrap(err, "Unable to draw background from disk")