I tried to set the background color by setting a global to pick a number.
I don’t seem to have the issue if I chose to make the background color a formula.
Only if I set the tu formula in the global.
I’m going to use the background color is the formula instead as it doesn’t return 0 (or hasn’t so far) but maybe something to check? I’ve been thinking of putting maths stuff I reuse often in globals so I’d love it if it avoided 0 in case I’m doing Thing /gv(value) . I’m not a maths person but I think that would be bad.
Formula is : $tu(rnd, 1/8, 1, 5)$ in global
Then in bg color of solid option is :
$if(gv(bgColor) = 1, #FF96D700, gv(bgColor) = 2, #FFE50046, gv(bgColor) = 3, #FFFFD100, gv(bgColor) = 4, #FF0A1DE, gv(bgColor) = 5, #FFA84895,
gv(bgColor) = 0, #FF96D700)$
Hi there,
Try these steps (see the animated GIF below), is that what you need?

I hope this would help.


Thank you for answering because I learned a better way to write the actual code.
I would rather get rid of the 0 altogether. A function that gives you a random number between 1 and 5 should not return 0 at all (thus eliminating the failsafe of specifying a value for 0 which means the hex color code value is represented twice, weighing the die, so to speak…)
Proof being even with the failsafe, my solution returns a black color in the screen even if I specify the green color code)
Hi there,
Here’s an alternative solution (see the animated GIF below).

By the way, the 4th color #FF0A1DE
is incorrect because it consists of 7-digit characters, it supposed to be 8-digit. Therefore, I change it to #FF00A1DE
I hope this would help.


Thank you so much! Yes when I copy off the booklet with all the new corporate branding I always have different ways of memorizing the 6 digits hex and get the yellow wrong in klwp because we add the other two for transparency setting !
But… your idea of setting colors individually as gv is deffo gonna help with that, I am soooo grateful !