It works like a charm but for one thing... [SOLVED]

Hey guys, it's been long time since I last paid a visit. I hope you're all doing fine given the present circumstances and looking after yourselves and your loved ones.

A while back I was helped with generating a colour code system for a lock puzzle - it worked really well and I trimmed it down to this:

game.plain_code = ""
game.coloured_code = ""
for (i, 1, 4) {
  randomcolour = PickOneString(c_list)
  game.plain_code = Trim(game.plain_code) + " " + randomcolour
  game.coloured_code = Trim(game.coloured_code) + " " + "{colour:" + randomcolour + ":" + randomcolour + "}"
}
msg ("The plain code is " + game.plain_code)
msg ("And the coloured code is " + game.coloured_code)

The problem I have now is when it prints out in colour and the colour matches the background you can't see it. Before I used pictures as backgrounds and was acceptable, but now I just want plain black or white backgrounds.

How and where in this code can I use the "background-color: thistle" to seperate background from foreground please?

I have tried:

game.coloured_code = Trim(game.coloured_code) + " " + "{background-color: thistle; colour:" + randomcolour + ":" + randomcolour + "}"

but all I get is the code printed to the screen.

Thanks in advance guys,

-=Darchy=-


It's okay guys, I was having a durrrr moment. I used {back:thistle} and it works perfectly:

The code line now reads:

game.coloured_code = Trim(game.coloured_code) + " " + "{back: thistle: colour:" + randomcolour + ":" + randomcolour + "}"

Log in to post a reply.

Support

Forums