Skip to content

Change background color of element in Gridbox #438

Answered by ArthurSonzogni
abdurj asked this question in Q&A
Discussion options

You must be logged in to vote

You can apply the bgcolor function.

Using the pipe operator:

auto colored_element = element | bgcolor(Color::Red);

Or as a function:

auto colored_element = bgcolor(Color::Red, element);

In your example, you can use |= to apply the bgcolor and replace the element with the new version in the array.

rows[0][0] |= bgcolor(Color::Red);

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@abdurj
Comment options

Answer selected by abdurj
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants