Ncurses gives me blue color in MacOs for RBG tuple init_color(COLOR_NAVY_BLUE, 0, 0, 139);
which is desired. But when running the same program on linux color is yellow. Why colors are different and how can I make it unified across platforms?
Both MacOs and linux terminals: xterm-256color.
Asked
Active
Viewed 81 times
0

Mateusz Wojtczak
- 1,621
- 1
- 12
- 28
-
"linux terminal" is vague: what you're talking about wouldn't work for Linux console. Other terminal emulators in Linux would have different behavior. – Thomas Dickey Mar 01 '20 at 15:09
-
The preferences for the Terminal app on macOS, or xterm on Linux or most emulators let you custom configure the color palette for the standard set of basic colors like RGB(0xf, 0, 0), RGB(0,0x8, 0), RGB(0, 0, 0xf), RGB(0, 0xf, 0xf) ... unused 12 bit color... example :-). In fact when I went with a terminal color with a black background the other day, dmesg output on Linux was unreadable until I edited the palette. But ultimately it is the end user that will decide the colors and the conformity among their terminal emulator(s) of choice. – clearlight Mar 01 '20 at 15:45
-
not all terminals allow colors to be redefined. additionally, not all terminals support more than 3 or 4 bit color (8 and 16 colors). Because of this, you cannot expect colors to be the same on every platform. – Rafael Mar 01 '20 at 18:36