From 94bb69d45839317ddb2ca13cbe0dac86be0ea7bc Mon Sep 17 00:00:00 2001 From: q Date: Fri, 11 Oct 2024 16:42:23 +0300 Subject: [PATCH] single 8bit colors --- reporting/qolop | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/reporting/qolop b/reporting/qolop index 1565fb5..7b64a4c 100755 --- a/reporting/qolop +++ b/reporting/qolop @@ -1,5 +1,5 @@ #!/bin/bash -_qColVersion() { echo Version 2020.09.27.0; } +_qColVersion() { echo Version 2024.10.11.0; } _qColHelp() { _qColVersion @@ -14,6 +14,7 @@ Functions: - _qParse: Print ANSI color by english words ex. "red", "lightgreen", "gray on blue" - _qPos: Move cursor - _qRGB, _qRGBbg: Set color with 8bit integer triplet +- _q8bit, _q8bitbg: set color with single 8bit int - _qClr: Clear screen - _qReset: Reset terminal @@ -212,6 +213,15 @@ _qRGBbg() { printf '\033[48;2;%d;%d;%dm' "$1" "$2" "$3" } +_q8bit() { + printf '\033[38;5;%dm' "$1" +} + +_q8bitbg() { + printf '\033[48;5;%dm' "$1" +} + + _qReset() { # Reset terminal printf '\033c'