terminal rgb colors in qolop
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
#!/bin/bash
|
||||
_qColVersion() { echo Version 2019.06.21.0; }
|
||||
_qColVersion() { echo Version 2020.09.27.0; }
|
||||
|
||||
_qColHelp() {
|
||||
_qColVersion
|
||||
@@ -13,6 +13,7 @@ Functions:
|
||||
- _qCode: Print ANSI color codes by number sequence
|
||||
- _qParse: Print ANSI color by english words ex. "red", "lightgreen", "gray on blue"
|
||||
- _qPos: Move cursor
|
||||
- _qRGB, _qRGBbg: Set color with 8bit integer triplet
|
||||
- _qClr: Clear screen
|
||||
- _qReset: Reset terminal
|
||||
|
||||
@@ -39,8 +40,8 @@ Run qolop as script to print ANSI code table, or evaluate commands
|
||||
The first command produces string with ANSI commands, the
|
||||
second will escape the escape characters, so you can copy/paste
|
||||
it in to another echo -e command.
|
||||
|
||||
qolop c G
|
||||
|
||||
qolop c G
|
||||
qolop p green
|
||||
|
||||
produce the same output, just the color code
|
||||
@@ -191,6 +192,15 @@ _qPos() {
|
||||
return 1
|
||||
}
|
||||
|
||||
_qRGB() {
|
||||
# Foreground 8-bit RGB triplet
|
||||
printf '\033[38;2;%d;%d;%dm' "$1" "$2" "$3"
|
||||
}
|
||||
|
||||
_qRGBbg() {
|
||||
# Background 8-bit RGB triplet
|
||||
printf '\033[48;2;%d;%d;%dm' "$1" "$2" "$3"
|
||||
}
|
||||
|
||||
_qReset() {
|
||||
# Reset terminal
|
||||
@@ -270,6 +280,7 @@ ${_S}====================${_Z}
|
||||
9 st ${_st}Strike ${_Z} 36 c ${_c}Cyan ${_Z}36;1 C ${_C}Cyan ${_Z}46 bc ${_k}${_bc}Cyan ${_Z}
|
||||
29 so ${_so}Strike off ${_Z} 37 w ${_w}White ${_Z}37;1 W ${_W}White ${_Z}47 bw ${_k}${_bw}White ${_Z}
|
||||
Enter raw color code sequence with _qCode function
|
||||
Use RGB triplets with _qRGB and _qRGBbg functions
|
||||
${_S}Clearing and movement${_Z} ESC[X or ESC[1X
|
||||
${_S}=====================${_Z}
|
||||
2J CLR Clear screen
|
||||
|
||||
Reference in New Issue
Block a user