util: add ANSI escape codes for rgb and background rgb

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1226>
This commit is contained in:
Peter Hutterer 2025-06-11 15:05:44 +10:00
parent 1850ea18f4
commit 2dcfda2ebc

View file

@ -64,6 +64,9 @@
#define ANSI_RIGHT "\x1B[%dC" #define ANSI_RIGHT "\x1B[%dC"
#define ANSI_LEFT "\x1B[%dD" #define ANSI_LEFT "\x1B[%dD"
#define ANSI_RGB(r, g, b) "\x1B[38;2;" #r ";" #g ";" #b "m"
#define ANSI_RGB_BG(r, g, b) "\x1B[48;2;" #r ";" #g ";" #b "m"
#define CASE_RETURN_STRING(a) case a: return #a #define CASE_RETURN_STRING(a) case a: return #a
/** /**