[GH-ISSUE #10] How to make the color black and better colorful for nvitop? #8

Closed
opened 2026-05-05 03:21:34 -06:00 by gitea-mirror · 2 comments
Owner

Originally created by @monajalal on GitHub (Dec 14, 2021).
Original GitHub issue: https://github.com/XuehaiPan/nvitop/issues/10

Thanks a lot for the great repo. Is there a way to make the background black and also the text colors nicer like yours?

Screen Shot 2021-12-14 at 2 54 57 PM
Originally created by @monajalal on GitHub (Dec 14, 2021). Original GitHub issue: https://github.com/XuehaiPan/nvitop/issues/10 Thanks a lot for the great repo. Is there a way to make the background black and also the text colors nicer like yours? <img width="1232" alt="Screen Shot 2021-12-14 at 2 54 57 PM" src="https://user-images.githubusercontent.com/1892917/146070126-2021fbf4-2008-4e87-8a28-474f65ff1f52.png">
gitea-mirror 2026-05-05 03:21:34 -06:00
  • closed this issue
  • added the
    question
    label
Author
Owner

@XuehaiPan commented on GitHub (Dec 15, 2021):

How to make the color black?

@monajalal Hi, I notice that you are using a light color scheme for your terminal. Do you mean only make the background color of nvitop to black, and change back to light color scheme when you exit and return to the terminal? Or change the whole terminal in dark mode too when you are not running nvitop.

  1. dark background in nvitop, light background in terminal when not running nvitop.
  2. always dark background when running and not running nvitop.

If the answer is the former one, I think I can add a new option like --force-dark to invert the foreground and the background color in light terminal. Otherwise, please change your terminal color scheme to a dark one. (See the last section of this comment)


How to make the color better colorful for nvitop?

nvitop is developed on the curses module, which dynamically links to the system curses library (ncurses on Linux and PDCurses on Windows) at runtime. The ncurses library only supports 4-bit colors (black, red, green, yellow, blue, magenta, cyan, white).

nvitop does not support custom color themes yet. The GUI is rendered with commands like "add string s at (x, y) with color red". How red is the text looks is depending on your terminal color scheme:

Terminal Colorscheme
The terminal color scheme defines a mapping from 4-bit colors (black, red, ..., white) to 24-bit colors (the Color Palette above).

nvitop doesn't support 24-bit true color in RGB tuple (we are using ncurses library though).


If you want to change your terminal color scheme, have a look at the following repositories:

I'm using Tomorrow Night Eighties theme (Gogh Gallary).

NOTE: If you are using nvitop via SSH connection on a remote server, you should change the color theme of your local machine, not the remote one.

<!-- gh-comment-id:994297230 --> @XuehaiPan commented on GitHub (Dec 15, 2021): > How to make the color black? @monajalal Hi, I notice that you are using a light color scheme for your terminal. Do you mean only make the background color of `nvitop` to black, and change back to light color scheme when you exit and return to the terminal? Or change the whole terminal in dark mode too when you are not running `nvitop`. 1. dark background in `nvitop`, light background in terminal when not running `nvitop`. 2. always dark background when running and not running `nvitop`. If the answer is the former one, I think I can add a new option like `--force-dark` to invert the foreground and the background color in light terminal. Otherwise, please change your terminal color scheme to a dark one. (See the last section of this comment) ------ > How to make the color better colorful for `nvitop`? `nvitop` is developed on the `curses` module, which dynamically links to the system `curses` library (`ncurses` on Linux and `PDCurses` on Windows) at runtime. The `ncurses` library only supports 4-bit colors (_black, red, green, yellow, blue, magenta, cyan, white_). `nvitop` does not support custom color themes yet. The GUI is rendered with commands like _"add string `s` at `(x, y)` with color `red`"_. How red is the text looks is depending on your terminal color scheme: <p align="center"> <img width="100%" src="https://user-images.githubusercontent.com/16078332/146118441-89768f09-e8f7-4010-9b4a-0189b5a2014d.png" alt="Terminal Colorscheme"> </br> The terminal color scheme defines a mapping from 4-bit colors (black, red, ..., white) to 24-bit colors (the Color Palette above). </p> `nvitop` doesn't support 24-bit true color in RGB tuple (we are using `ncurses` library though). ------ If you want to change your terminal color scheme, have a look at the following repositories: - [Mayccoll/Gogh](https://github.com/Mayccoll/Gogh) - [mbadolato/iTerm2-Color-Schemes](https://github.com/mbadolato/iTerm2-Color-Schemes) I'm using `Tomorrow Night Eighties` theme ([Gogh Gallary](https://mayccoll.github.io/Gogh/)). **NOTE:** If you are using `nvitop` via SSH connection on a remote server, you should change the color theme of your local machine, not the remote one.
Author
Owner

@XuehaiPan commented on GitHub (Dec 17, 2021):

@monajalal Does the above comment resolve your issue? And can we close this now?

<!-- gh-comment-id:996395941 --> @XuehaiPan commented on GitHub (Dec 17, 2021): @monajalal Does the above comment resolve your issue? And can we close this now?
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: github-starred/nvitop#8
No description provided.