[GH-ISSUE #720] Feature Request: Demo file for colors #526

Closed
opened 2026-03-04 01:05:45 +03:00 by kerem · 2 comments
Owner

Originally created by @marioemmanuel on GitHub (Apr 13, 2022).
Original GitHub issue: https://github.com/rivo/tview/issues/720

It would be useful to find a working example on changing Colors under the demo folder, for example how to change the background color of a form.

Originally created by @marioemmanuel on GitHub (Apr 13, 2022). Original GitHub issue: https://github.com/rivo/tview/issues/720 It would be useful to find a working example on changing Colors under the demo folder, for example how to change the background color of a form.
kerem closed this issue 2026-03-04 01:05:46 +03:00
Author
Owner

@rivo commented on GitHub (Apr 15, 2022):

You can call SetBackgroundColor() on any primitive, including forms. (Be aware, though, that this function returns a Box, not a Form, so you probably shouldn't chain it.)

<!-- gh-comment-id:1100292397 --> @rivo commented on GitHub (Apr 15, 2022): You can call [`SetBackgroundColor()`](https://pkg.go.dev/github.com/rivo/tview#Box.SetBackgroundColor) on any primitive, including forms. (Be aware, though, that this function returns a `Box`, not a `Form`, so you probably shouldn't chain it.)
Author
Owner

@marioemmanuel commented on GitHub (Apr 16, 2022):

In case it helps someone else, aside from rivo's comment, I also found the presentation demo files helpful to understand how colors are used in tview.

<!-- gh-comment-id:1100622646 --> @marioemmanuel commented on GitHub (Apr 16, 2022): In case it helps someone else, aside from rivo's comment, I also found the presentation demo files helpful to understand how colors are used in tview.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/tview#526
No description provided.