From 07a685bb9a1edc6b804d722e118f8c2bba85b527 Mon Sep 17 00:00:00 2001 From: Linus Dierheimer Date: Mon, 14 Mar 2022 17:31:16 +0100 Subject: [PATCH] 16 Colors in TTY --- src/modules/colors.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/modules/colors.c b/src/modules/colors.c index 49848d8d3..c6b2f22f6 100644 --- a/src/modules/colors.c +++ b/src/modules/colors.c @@ -4,15 +4,22 @@ void ffPrintColors(FFinstance* instance) { ffPrintLogoLine(instance); + // 4%d: Set the background color + // 3%d: Set the foreground color for(uint8_t i = 0; i < 8; i++) - printf("\033[4%dm ", i); + printf("\033[4%d;3%dm███", i, i); - puts("\033[0m"); + puts(FASTFETCH_TEXT_MODIFIER_RESET); ffPrintLogoLine(instance); - for(uint8_t i = 8; i < 16; i++) - printf("\033[48;5;%dm ", i); + // 1: Set everything to bolt. This causes normal colors on some systems to be bright. + // 4%d: Set the backgound to the not bright color + // 3%d: Set the foreground to the not bright color + // 10%d: Set the background to the bright color + // 9%d: Set the foreground to the bright color + for(uint8_t i = 0; i < 8; i++) + printf("\033[1;4%d;3%d;10%d;9%dm███", i, i, i, i); - puts("\033[0m"); + puts(FASTFETCH_TEXT_MODIFIER_RESET); }