diff --git a/components/home/HomeItem.bs b/components/home/HomeItem.bs index 882f6b5f5..04ea2ec81 100644 --- a/components/home/HomeItem.bs +++ b/components/home/HomeItem.bs @@ -21,9 +21,17 @@ sub init() m.showProgressBarField = m.top.findNode("showProgressBarField") ' Randomize the background colors + backdropColor = "#00a4db" ' set default in case global var is invalid + localGlobal = m.global + + if isValid(localGlobal) and isValid(localGlobal.constants) and isValid(localGlobal.constants.poster_bg_pallet) + posterBackgrounds = localGlobal.constants.poster_bg_pallet + backdropColor = posterBackgrounds[rnd(posterBackgrounds.count()) - 1] + end if + + ' update the backdrop node m.backdrop = m.top.findNode("backdrop") - posterBackgrounds = m.global.constants.poster_bg_pallet - m.backdrop.color = posterBackgrounds[rnd(posterBackgrounds.count()) - 1] + m.backdrop.color = backdropColor end sub