Playername color on background
Posted: 22 October 2020, 21:37
I have a gamestate turn description like this:
${you} must guess: Which of the four words does ${player_name} have?
Unfortunately ${player_name} is not colorized automatically, so I do it manually:
But this makes problems for example with white color on white backgrounds. BGA already solved this, but is there an API function for this? To compute an optional background color, if needed? That would be nice!
${you} must guess: Which of the four words does ${player_name} have?
Unfortunately ${player_name} is not colorized automatically, so I do it manually:
Code: Select all
function argGuess() {
$players = $this->getPlayers();
$p = $players[$this->getActivePlayerId()];
return [
"active_player_id" => $p["id"],
"player_name" => '<span style="color:#' . $p["color"] . ';">' . $p["name"] . '</span>',
];
}