How can I access to .Params inside range?

Hey! Does anybody know how can I access to .Params.backgroundColor inside range function?

Right now I use .Params.backgroundColor on the first line of my partial, but I also need to use it on the 15th line.

Here is a screenshot of my partial:

Here is a screenshot of the console when I use .Params.backgroundColor on the 15th line (I use it the same way I did it on the first line) — http://prntscr.com/ngrg3u.

Hugo version: Hugo Static Site Generator v0.55.3/extended darwin/amd64 BuildDate: unknown

1 Like

This might help: https://gohugo.io/templates/introduction/#1-define-a-variable-independent-of-context

1 Like

Thank you so much, it helped!