text_box with color #1139
Unanswered
obfuscoder
asked this question in
General
Replies: 2 comments 1 reply
-
It's necessary to use formatted_text_box and put the color on each fragment. formatted_text_box([{ text: 'foobar', color: 'FF0000' }]) You could introduce a convenience function that wraps text_box: def text_box_with_color string, opts = {}
fragments = [{ text: string, color: opts.delete(:color) }]
formatted_text_box fragments, opts
end
text_box_with_color 'foobar', color: 'FF0000' |
Beta Was this translation helpful? Give feedback.
0 replies
-
But how you get a background color? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am using text_box as it allows me to define a box which the text resides in and will never escape from. I also want to change the color of the font. However, the color option is not supported and I have no idea how I would be able to change the color while using text_box. The documentation does not provide a solution to this problem.
I would recommend either to enhance the documentation to explain, how coloring of the text can be achieved or add support for that option to that method.
Beta Was this translation helpful? Give feedback.
All reactions