Emit dedicated bright terminal color codes if supported
[babeltrace.git] / src / plugins / text / details / colors.h
index 5b142f557bb6898700e855301546a245189801fd..304708052d31be5068a1b0ad5d9f5214df6f5761 100644 (file)
@@ -33,7 +33,7 @@ const char *color_reset(struct details_write_ctx *ctx)
        const char *code = "";
 
        if (ctx->details_comp->cfg.with_color) {
-               code = BT_COMMON_COLOR_RESET;
+               code = bt_common_color_reset();
        }
 
        return code;
@@ -45,7 +45,7 @@ const char *color_bold(struct details_write_ctx *ctx)
        const char *code = "";
 
        if (ctx->details_comp->cfg.with_color) {
-               code = BT_COMMON_COLOR_BOLD;
+               code = bt_common_color_bold();
        }
 
        return code;
@@ -57,7 +57,7 @@ const char *color_fg_default(struct details_write_ctx *ctx)
        const char *code = "";
 
        if (ctx->details_comp->cfg.with_color) {
-               code = BT_COMMON_COLOR_FG_DEFAULT;
+               code = bt_common_color_fg_default();
        }
 
        return code;
@@ -69,7 +69,7 @@ const char *color_fg_red(struct details_write_ctx *ctx)
        const char *code = "";
 
        if (ctx->details_comp->cfg.with_color) {
-               code = BT_COMMON_COLOR_FG_RED;
+               code = bt_common_color_fg_red();
        }
 
        return code;
@@ -81,7 +81,7 @@ const char *color_fg_green(struct details_write_ctx *ctx)
        const char *code = "";
 
        if (ctx->details_comp->cfg.with_color) {
-               code = BT_COMMON_COLOR_FG_GREEN;
+               code = bt_common_color_fg_green();
        }
 
        return code;
@@ -93,7 +93,7 @@ const char *color_fg_yellow(struct details_write_ctx *ctx)
        const char *code = "";
 
        if (ctx->details_comp->cfg.with_color) {
-               code = BT_COMMON_COLOR_FG_YELLOW;
+               code = bt_common_color_fg_yellow();
        }
 
        return code;
@@ -105,7 +105,7 @@ const char *color_fg_blue(struct details_write_ctx *ctx)
        const char *code = "";
 
        if (ctx->details_comp->cfg.with_color) {
-               code = BT_COMMON_COLOR_FG_BLUE;
+               code = bt_common_color_fg_blue();
        }
 
        return code;
@@ -117,7 +117,7 @@ const char *color_fg_magenta(struct details_write_ctx *ctx)
        const char *code = "";
 
        if (ctx->details_comp->cfg.with_color) {
-               code = BT_COMMON_COLOR_FG_MAGENTA;
+               code = bt_common_color_fg_magenta();
        }
 
        return code;
@@ -129,7 +129,7 @@ const char *color_fg_cyan(struct details_write_ctx *ctx)
        const char *code = "";
 
        if (ctx->details_comp->cfg.with_color) {
-               code = BT_COMMON_COLOR_FG_CYAN;
+               code = bt_common_color_fg_cyan();
        }
 
        return code;
@@ -141,7 +141,91 @@ const char *color_fg_light_gray(struct details_write_ctx *ctx)
        const char *code = "";
 
        if (ctx->details_comp->cfg.with_color) {
-               code = BT_COMMON_COLOR_FG_LIGHT_GRAY;
+               code = bt_common_color_fg_light_gray();
+       }
+
+       return code;
+}
+
+static inline
+const char *color_fg_bright_red(struct details_write_ctx *ctx)
+{
+       const char *code = "";
+
+       if (ctx->details_comp->cfg.with_color) {
+               code = bt_common_color_fg_bright_red();
+       }
+
+       return code;
+}
+
+static inline
+const char *color_fg_bright_green(struct details_write_ctx *ctx)
+{
+       const char *code = "";
+
+       if (ctx->details_comp->cfg.with_color) {
+               code = bt_common_color_fg_bright_green();
+       }
+
+       return code;
+}
+
+static inline
+const char *color_fg_bright_yellow(struct details_write_ctx *ctx)
+{
+       const char *code = "";
+
+       if (ctx->details_comp->cfg.with_color) {
+               code = bt_common_color_fg_bright_yellow();
+       }
+
+       return code;
+}
+
+static inline
+const char *color_fg_bright_blue(struct details_write_ctx *ctx)
+{
+       const char *code = "";
+
+       if (ctx->details_comp->cfg.with_color) {
+               code = bt_common_color_fg_bright_blue();
+       }
+
+       return code;
+}
+
+static inline
+const char *color_fg_bright_magenta(struct details_write_ctx *ctx)
+{
+       const char *code = "";
+
+       if (ctx->details_comp->cfg.with_color) {
+               code = bt_common_color_fg_bright_magenta();
+       }
+
+       return code;
+}
+
+static inline
+const char *color_fg_bright_cyan(struct details_write_ctx *ctx)
+{
+       const char *code = "";
+
+       if (ctx->details_comp->cfg.with_color) {
+               code = bt_common_color_fg_bright_cyan();
+       }
+
+       return code;
+}
+
+static inline
+const char *color_fg_bright_light_gray(struct details_write_ctx *ctx)
+{
+       const char *code = "";
+
+       if (ctx->details_comp->cfg.with_color) {
+               code = bt_common_color_fg_bright_light_gray();
        }
 
        return code;
@@ -153,7 +237,7 @@ const char *color_bg_default(struct details_write_ctx *ctx)
        const char *code = "";
 
        if (ctx->details_comp->cfg.with_color) {
-               code = BT_COMMON_COLOR_BG_DEFAULT;
+               code = bt_common_color_bg_default();
        }
 
        return code;
@@ -165,7 +249,7 @@ const char *color_bg_red(struct details_write_ctx *ctx)
        const char *code = "";
 
        if (ctx->details_comp->cfg.with_color) {
-               code = BT_COMMON_COLOR_BG_RED;
+               code = bt_common_color_bg_red();
        }
 
        return code;
@@ -177,7 +261,7 @@ const char *color_bg_green(struct details_write_ctx *ctx)
        const char *code = "";
 
        if (ctx->details_comp->cfg.with_color) {
-               code = BT_COMMON_COLOR_BG_GREEN;
+               code = bt_common_color_bg_green();
        }
 
        return code;
@@ -189,7 +273,7 @@ const char *color_bg_yellow(struct details_write_ctx *ctx)
        const char *code = "";
 
        if (ctx->details_comp->cfg.with_color) {
-               code = BT_COMMON_COLOR_BG_YELLOW;
+               code = bt_common_color_bg_yellow();
        }
 
        return code;
@@ -201,7 +285,7 @@ const char *color_bg_blue(struct details_write_ctx *ctx)
        const char *code = "";
 
        if (ctx->details_comp->cfg.with_color) {
-               code = BT_COMMON_COLOR_BG_BLUE;
+               code = bt_common_color_bg_blue();
        }
 
        return code;
@@ -213,7 +297,7 @@ const char *color_bg_magenta(struct details_write_ctx *ctx)
        const char *code = "";
 
        if (ctx->details_comp->cfg.with_color) {
-               code = BT_COMMON_COLOR_BG_MAGENTA;
+               code = bt_common_color_bg_magenta();
        }
 
        return code;
@@ -225,7 +309,7 @@ const char *color_bg_cyan(struct details_write_ctx *ctx)
        const char *code = "";
 
        if (ctx->details_comp->cfg.with_color) {
-               code = BT_COMMON_COLOR_BG_CYAN;
+               code = bt_common_color_bg_cyan();
        }
 
        return code;
@@ -237,7 +321,7 @@ const char *color_bg_light_gray(struct details_write_ctx *ctx)
        const char *code = "";
 
        if (ctx->details_comp->cfg.with_color) {
-               code = BT_COMMON_COLOR_BG_LIGHT_GRAY;
+               code = bt_common_color_bg_light_gray();
        }
 
        return code;
This page took 0.026443 seconds and 4 git commands to generate.