Is there a way to determine the closest hex values for foreground colours provided by tput ?
Asked
Active
Viewed 16 times
0
Vera
- 1,173
- 4
- 17
-
Hex is a base-16 numbering system. Do you mean 24-bit RGB? Or HLS? Or another encoding of colour? – roaima Apr 12 '23 at 22:57
-
In the format `ff0000` – Vera Apr 12 '23 at 23:04
-
RGB or HSL (sorry, not HLS) or some other encoding? – roaima Apr 12 '23 at 23:11
-
The hex, example `#ff0000`. – Vera Apr 12 '23 at 23:41
-
I wonder whether it is best to use `\e` or `\033`. – Vera Apr 13 '23 at 00:21
-
See the `tohex` function in accepted answer to the duplicate Q&A. Also check the answer by ThomasDickey there (he's the maintainer of xterm and ncurses (where your tput likely comes from)) – Stéphane Chazelas Apr 13 '23 at 05:47