mirror of
https://github.com/RGBCube/nu_scripts
synced 2025-08-02 15:17:47 +00:00
updated coloring with latest changes
This commit is contained in:
parent
1b6a2da5a1
commit
6c94250231
12 changed files with 204 additions and 230 deletions
|
@ -1,15 +1,16 @@
|
||||||
let term_cols = ((term size -w) - 1)
|
let term_cols = ((term size -w) - 1)
|
||||||
|
|
||||||
|
# let's itertate through each of the columns of our terminal
|
||||||
echo 0..$term_cols |
|
echo 0..$term_cols |
|
||||||
each {
|
each { |col|
|
||||||
let r = (255 - ($it * 255 / $term_cols) | math round)
|
let r = (255 - ($col * 255 / $term_cols) | math round)
|
||||||
let g = ($it * 510 / $term_cols | math round)
|
let g = ($col * 510 / $term_cols | math round)
|
||||||
let b = ($it * 255 / $term_cols | math round)
|
let b = ($col * 255 / $term_cols | math round)
|
||||||
if $g > 255 {
|
if $g > 255 {
|
||||||
let g = (510 - $g)
|
let g = (510 - $g)
|
||||||
echo (build-colorstr $r $g $b) | autoview
|
build-colorstr $r $g $b $col | autoview
|
||||||
} {
|
} {
|
||||||
echo (build-colorstr $r $g $b) | autoview
|
build-colorstr $r $g $b $col | autoview
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -17,23 +18,23 @@ def build-colorstr [
|
||||||
r:int # Red
|
r:int # Red
|
||||||
g:int # Green
|
g:int # Green
|
||||||
b:int # Blue
|
b:int # Blue
|
||||||
|
c:int # Column
|
||||||
] {
|
] {
|
||||||
# log (build-string "R=" $r " G=" $g " B=" $b)
|
# Heavy use of string interpolation below
|
||||||
let bg = (build-string (ansi rgb_bg) $r ';' $g ';' $b 'm')
|
let bg = $"(ansi rgb_bg)($r);($g);($b)m"
|
||||||
let fg = (build-string (ansi rgb_fg) (255 - $r) ';' (255 - $g) ';' (255 - $b) 'm')
|
let fg = $"(ansi rgb_fg)(255 - $r);(255 - $g);(255 - $b)m"
|
||||||
let idx = ($it mod 2)
|
let idx = ($c mod 2)
|
||||||
let slash_str = (if $idx == 0 {
|
let slash_str = (if $idx == 0 {
|
||||||
build-string "/" (ansi reset)
|
$"/(ansi reset)"
|
||||||
} {
|
} {
|
||||||
build-string "\" (ansi reset)
|
$"\(ansi reset)"
|
||||||
})
|
})
|
||||||
build-string $bg $fg $slash_str
|
$"($bg)($fg)($slash_str)"
|
||||||
# log (build-string $bg $fg $slash_str | debug)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# This is a first attempt and some type of logging
|
# This is a first attempt and some type of logging
|
||||||
def log [message:any] {
|
def log [message:any] {
|
||||||
let now = (date now | date format '%Y%m%d_%H%M%S.%f')
|
let now = (date now | date format '%Y%m%d_%H%M%S.%f')
|
||||||
let mess = (build-string $now '|DBG|' $message (char newline))
|
let mess = $"($now)|DBG|($message)(char nl)"
|
||||||
echo $mess | autoview
|
echo $mess | autoview
|
||||||
}
|
}
|
|
@ -1,24 +1,24 @@
|
||||||
def make_header [hi] {
|
def make_header [hi] {
|
||||||
if $hi == $true {
|
if $hi == $true {
|
||||||
let ansi100m = (echo '100m' | str lpad -l 11 -c ' ')
|
let ansi100m = ('100m' | str lpad -l 11 -c ' ')
|
||||||
let ansi101m = (echo '101m' | str lpad -l 9 -c ' ')
|
let ansi101m = ('101m' | str lpad -l 9 -c ' ')
|
||||||
let ansi102m = (echo '102m' | str lpad -l 9 -c ' ')
|
let ansi102m = ('102m' | str lpad -l 9 -c ' ')
|
||||||
let ansi103m = (echo '103m' | str lpad -l 9 -c ' ')
|
let ansi103m = ('103m' | str lpad -l 9 -c ' ')
|
||||||
let ansi104m = (echo '104m' | str lpad -l 9 -c ' ')
|
let ansi104m = ('104m' | str lpad -l 9 -c ' ')
|
||||||
let ansi105m = (echo '105m' | str lpad -l 9 -c ' ')
|
let ansi105m = ('105m' | str lpad -l 9 -c ' ')
|
||||||
let ansi106m = (echo '106m' | str lpad -l 9 -c ' ')
|
let ansi106m = ('106m' | str lpad -l 9 -c ' ')
|
||||||
let ansi107m = (echo '107m' | str lpad -l 9 -c ' ')
|
let ansi107m = ('107m' | str lpad -l 9 -c ' ')
|
||||||
echo [(char newline) $ansi100m $ansi101m $ansi102m $ansi103m $ansi104m $ansi105m $ansi106m $ansi107m (char newline)] | str collect
|
$"(char newline)($ansi100m)($ansi101m)($ansi102m)($ansi103m)($ansi104m)($ansi105m)($ansi106m)($ansi107m)(char newline)"
|
||||||
} {
|
} {
|
||||||
let ansi40m = (echo '40m' | str lpad -l 10 -c ' ')
|
let ansi40m = ('40m' | str lpad -l 10 -c ' ')
|
||||||
let ansi41m = (echo '41m' | str lpad -l 8 -c ' ')
|
let ansi41m = ('41m' | str lpad -l 8 -c ' ')
|
||||||
let ansi42m = (echo '42m' | str lpad -l 8 -c ' ')
|
let ansi42m = ('42m' | str lpad -l 8 -c ' ')
|
||||||
let ansi43m = (echo '43m' | str lpad -l 8 -c ' ')
|
let ansi43m = ('43m' | str lpad -l 8 -c ' ')
|
||||||
let ansi44m = (echo '44m' | str lpad -l 8 -c ' ')
|
let ansi44m = ('44m' | str lpad -l 8 -c ' ')
|
||||||
let ansi45m = (echo '45m' | str lpad -l 8 -c ' ')
|
let ansi45m = ('45m' | str lpad -l 8 -c ' ')
|
||||||
let ansi46m = (echo '46m' | str lpad -l 8 -c ' ')
|
let ansi46m = ('46m' | str lpad -l 8 -c ' ')
|
||||||
let ansi47m = (echo '47m' | str lpad -l 8 -c ' ')
|
let ansi47m = ('47m' | str lpad -l 8 -c ' ')
|
||||||
echo [(char newline) $ansi40m $ansi41m $ansi42m $ansi43m $ansi44m $ansi45m $ansi46m $ansi47m (char newline)] | str collect
|
$"(char newline)($ansi40m)($ansi41m)($ansi42m)($ansi43m)($ansi44m)($ansi45m)($ansi46m)($ansi47m)(char newline)"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -32,23 +32,19 @@ def mk_header [color_range:range] {
|
||||||
let hi_regular_pad = 9
|
let hi_regular_pad = 9
|
||||||
let lo_start_pad = 10
|
let lo_start_pad = 10
|
||||||
let lo_regular_pad = 8
|
let lo_regular_pad = 8
|
||||||
echo $color_range | each {
|
echo $color_range | each { |color|
|
||||||
let ansi_color = (echo [(build-string $it 'm')])
|
let ansi_color = $"($color)m"
|
||||||
if $it == $min_rng {
|
if $color == $min_rng {
|
||||||
if $min_rng == 100 {
|
if $min_rng == 100 {
|
||||||
let header = (echo $ansi_color | str lpad -l $hi_start_pad -c ' ')
|
($ansi_color | str lpad -l $hi_start_pad -c ' ')
|
||||||
echo $header
|
|
||||||
} {
|
} {
|
||||||
let header = (echo $ansi_color | str lpad -l $lo_start_pad -c ' ')
|
($ansi_color | str lpad -l $lo_start_pad -c ' ')
|
||||||
echo $header
|
|
||||||
}
|
}
|
||||||
} {
|
} {
|
||||||
if $min_rng >= 100 {
|
if $min_rng >= 100 {
|
||||||
let header = (echo $ansi_color | str lpad -l $hi_regular_pad -c ' ')
|
($ansi_color | str lpad -l $hi_regular_pad -c ' ')
|
||||||
echo $header
|
|
||||||
} {
|
} {
|
||||||
let header = (echo $ansi_color | str lpad -l $lo_regular_pad -c ' ')
|
($ansi_color | str lpad -l $lo_regular_pad -c ' ')
|
||||||
echo $header
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} | str collect
|
} | str collect
|
||||||
|
@ -57,18 +53,18 @@ def mk_header [color_range:range] {
|
||||||
|
|
||||||
def color_row_range [num:int bg_rg:range] {
|
def color_row_range [num:int bg_rg:range] {
|
||||||
let reset = (ansi reset)
|
let reset = (ansi reset)
|
||||||
let row_header = (build-string $num "m " (ansi reset))
|
let row_header = $"($num)m ($reset)"
|
||||||
let row_data = (echo $bg_rg | each {
|
let row_data = (echo $bg_rg | each { |back|
|
||||||
let row_name = (echo [(build-string $num ';' $it) "m"] | str collect)
|
let row_name = $"($num);($back)m"
|
||||||
let ansi_color = (ansi -e $row_name)
|
let ansi_color = (ansi -e $row_name)
|
||||||
echo [$ansi_color ' ' $row_name ' ' $reset] | str collect
|
$"($ansi_color) ($row_name) ($reset)"
|
||||||
} | append (char newline) | str collect)
|
} | append (char newline) | str collect)
|
||||||
echo [$row_header $row_data] | str collect
|
$"($row_header)($row_data)"
|
||||||
}
|
}
|
||||||
|
|
||||||
def create_color_tables [fg_range:range bg_range:range] {
|
def create_color_tables [fg_range:range bg_range:range] {
|
||||||
echo $fg_range | each {
|
echo $fg_range | each { |fg|
|
||||||
color_row_range $it $bg_range
|
color_row_range $fg $bg_range
|
||||||
} | str collect
|
} | str collect
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -78,7 +74,7 @@ def color_table [] {
|
||||||
create_color_tables 30..37 40..47
|
create_color_tables 30..37 40..47
|
||||||
|
|
||||||
# put a line between tables
|
# put a line between tables
|
||||||
echo (char newline)
|
char newline
|
||||||
|
|
||||||
#make_header $true
|
#make_header $true
|
||||||
mk_header 100..107
|
mk_header 100..107
|
||||||
|
|
|
@ -10,16 +10,13 @@
|
||||||
# done
|
# done
|
||||||
# echo ""
|
# echo ""
|
||||||
|
|
||||||
echo 0..8 | each {
|
echo 0..8 | each { |style|
|
||||||
let x = $it
|
let row = (echo 30..37 | each { |fg|
|
||||||
let row = (echo 30..37 | each {
|
let row = (echo 40..47 | each { |bg|
|
||||||
let i = $it
|
let color = $"($style);($fg);($bg)m"
|
||||||
let row = (echo 40..47 | each {
|
$"(ansi -e $color)($color)(ansi reset) "
|
||||||
let a = $it
|
|
||||||
let color = (build-string $x ';' $i ';' $a 'm')
|
|
||||||
echo [(ansi -e $color) $color (ansi reset) ' ']
|
|
||||||
} | str collect)
|
} | str collect)
|
||||||
echo [$row (char newline)] | str collect
|
$"($row)(char newline)"
|
||||||
} | str collect)
|
} | str collect)
|
||||||
echo [$row (char newline)] | str collect
|
$"($row)(char newline)"
|
||||||
} | str collect
|
} | str collect
|
|
@ -1,22 +1,24 @@
|
||||||
# this script will print a blue gradient on the screen
|
# this script will print a blue gradient on the screen
|
||||||
|
|
||||||
|
# We can get the terminal width and height now with term size
|
||||||
|
# but we like to use the script as a benchmark, so let's keep
|
||||||
|
# it a constant size for now
|
||||||
let height = 40 # really need to get the terminal height here
|
let height = 40 # really need to get the terminal height here
|
||||||
let width = 160 # really need to get the terminal width here
|
let width = 160 # really need to get the terminal width here
|
||||||
|
let stamp = 'Nu'
|
||||||
seq 0 $height | each {
|
seq 0 $height | each {
|
||||||
let row_data = (seq 0 $width | each {
|
let row_data = (seq 0 $width | each { |col|
|
||||||
let fgcolor = (iter_inc 2 2 $it)
|
let fgcolor = (iter_inc 2 2 $col)
|
||||||
if $fgcolor > 200 && $fgcolor < 210 {
|
if $fgcolor > 200 && $fgcolor < 210 {
|
||||||
echo [(ansi -e '48;2;0;0;') (build-string $fgcolor m) 'Nu' (ansi -e '0m')] | str collect
|
$"(ansi -e '48;2;0;0;')($fgcolor)m($stamp)(ansi -e '0m')"
|
||||||
} {
|
} {
|
||||||
echo [(ansi -e '48;2;0;0;') (build-string $fgcolor m) ' ' (ansi -e '0m')] | str collect
|
$"(ansi -e '48;2;0;0;')($fgcolor)m(char sp)(ansi -e '0m')"
|
||||||
}
|
}
|
||||||
} | str collect)
|
} | str collect)
|
||||||
echo [$row_data (char newline)] | str collect | autoview
|
$"($row_data)(char newline)" | autoview
|
||||||
} | str collect
|
} | str collect
|
||||||
|
|
||||||
def iter_inc [incr mult iter] {
|
def iter_inc [incr mult iter] {
|
||||||
# echo (build-string $incr + $mult * $iter) | math eval | math round
|
|
||||||
$incr + $mult * $iter
|
$incr + $mult * $iter
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -25,15 +27,15 @@ def iter_inc [incr mult iter] {
|
||||||
# ├────┼────────────────────┼───────────────────────────────────────────────────────────────────────────────────────────────────┤
|
# ├────┼────────────────────┼───────────────────────────────────────────────────────────────────────────────────────────────────┤
|
||||||
# │ 0 │ version │ 0.31.1 │
|
# │ 0 │ version │ 0.31.1 │
|
||||||
# │ 1 │ branch │ main │
|
# │ 1 │ branch │ main │
|
||||||
# │ 2 │ short_commit │ 3aa00b78 │
|
# │ 2 │ short_commit │ 751de20f │
|
||||||
# │ 3 │ commit_hash │ 3aa00b78f95b308a6d76eef086e018cd0e0252d0 │
|
# │ 3 │ commit_hash │ 751de20f938ed200ae6128a30d06a5dd24a4fd33 │
|
||||||
# │ 4 │ commit_date │ 2021-05-12 03:53:34 │
|
# │ 4 │ commit_date │ 2021-05-21 02:04:27 │
|
||||||
# │ 5 │ build_os │ windows-x86_64 │
|
# │ 5 │ build_os │ windows-x86_64 │
|
||||||
# │ 6 │ rust_version │ rustc 1.52.1 (9bc8c42bb 2021-05-09) │
|
# │ 6 │ rust_version │ rustc 1.52.1 (9bc8c42bb 2021-05-09) │
|
||||||
# │ 7 │ rust_channel │ stable (default) │
|
# │ 7 │ rust_channel │ stable (default) │
|
||||||
# │ 8 │ cargo_version │ cargo 1.52.0 (69767412a 2021-04-21) │
|
# │ 8 │ cargo_version │ cargo 1.52.0 (69767412a 2021-04-21) │
|
||||||
# │ 9 │ pkg_version │ 0.31.1 │
|
# │ 9 │ pkg_version │ 0.31.1 │
|
||||||
# │ 10 │ build_time │ 2021-05-12 07:37:45 │
|
# │ 10 │ build_time │ 2021-05-21 07:20:25 │
|
||||||
# │ 11 │ build_rust_channel │ release │
|
# │ 11 │ build_rust_channel │ release │
|
||||||
# │ 12 │ features │ clipboard-cli, ctrlc, default, directories, dirs, ptree, rustyline, term, trash, uuid, which, zip │
|
# │ 12 │ features │ clipboard-cli, ctrlc, default, directories, dirs, ptree, rustyline, term, trash, uuid, which, zip │
|
||||||
# ╰────┴────────────────────┴───────────────────────────────────────────────────────────────────────────────────────────────────╯
|
# ╰────┴────────────────────┴───────────────────────────────────────────────────────────────────────────────────────────────────╯
|
|
@ -1,19 +1,15 @@
|
||||||
def show_index_colors [] {
|
def show_index_colors [] {
|
||||||
let prefix = "48;5;"
|
let prefix = "48;5;"
|
||||||
let relet_color = "0m"
|
echo 1..256 | each { |idx|
|
||||||
echo 1..256 | each {
|
let cr = ($"($idx) % 16" | math eval)
|
||||||
let cr = (echo (build-string $it % 16) | math eval)
|
let color = $"(ansi -e $prefix)($idx)m"
|
||||||
let color = (echo [(ansi -e $prefix) (build-string $it) 'm'] | str collect)
|
let padded_number = ($"($idx)" | str lpad -l 3 -c '0')
|
||||||
let padded_number = (echo (build-string $it | str lpad -l 3 -c '0'))
|
|
||||||
if $cr == 0 {
|
if $cr == 0 {
|
||||||
echo [$color $padded_number ' ' (ansi -e $relet_color) (char newline)]
|
$"($color)($padded_number) (ansi -e 0m)(char newline)"
|
||||||
} {
|
} {
|
||||||
echo [$color $padded_number ' ' (ansi -e $relet_color)]
|
$"($color)($padded_number) (ansi -e 0m)"
|
||||||
}
|
}
|
||||||
} | str collect
|
} | str collect
|
||||||
}
|
}
|
||||||
|
|
||||||
show_index_colors
|
show_index_colors
|
||||||
|
|
||||||
#one-liner
|
|
||||||
#echo 0..255 | each {echo [(ansi -e '38;5;') (build-string $it) 'm' (build-string $it) ' ']} | str collect
|
|
|
@ -1,11 +1,11 @@
|
||||||
def show_index_colors [] {
|
def show_index_colors [] {
|
||||||
let prefix = "38;5;"
|
let prefix = "38;5;"
|
||||||
echo 1..256 | each {
|
echo 1..256 | each { |fg|
|
||||||
let cr = (echo (build-string $it % 16) | math eval)
|
let cr = ($"($fg) % 16" | math eval)
|
||||||
if $cr == 0 {
|
if $cr == 0 {
|
||||||
echo [(ansi -e $prefix) (build-string $it) 'm' (build-string $it | str lpad -l 3 -c '0') ' ' (char newline)]
|
$"(ansi -e $prefix)($fg)m($fg | into string | str lpad -l 3 -c '0') (char newline)"
|
||||||
} {
|
} {
|
||||||
echo [(ansi -e $prefix) (build-string $it) 'm' (build-string $it | str lpad -l 3 -c '0') ' ']
|
$"(ansi -e $prefix)($fg)m($fg | into string | str lpad -l 3 -c '0') "
|
||||||
}
|
}
|
||||||
} | str collect
|
} | str collect
|
||||||
}
|
}
|
||||||
|
@ -13,4 +13,4 @@ def show_index_colors [] {
|
||||||
show_index_colors
|
show_index_colors
|
||||||
|
|
||||||
#one-liner
|
#one-liner
|
||||||
#echo 0..255 | each {echo [(ansi -e '38;5;') (build-string $it) 'm' (build-string $it) ' ']} | str collect
|
#echo 0..255 | each { |fg| echo [(ansi -e '38;5;') ($fg | into string) 'm' ($fg | into string) ' ']} | str collect
|
|
@ -3,14 +3,15 @@
|
||||||
# different color
|
# different color
|
||||||
def show_index_colors [] {
|
def show_index_colors [] {
|
||||||
let prefix = "38;5;"
|
let prefix = "38;5;"
|
||||||
echo 1..256 | each {
|
echo 1..256 | each { |idx|
|
||||||
let cr = (echo (build-string $it % 16) | math eval)
|
let cr = ($"($idx) % 16" | math eval)
|
||||||
let color = (echo [(ansi -e $prefix) (build-string $it) 'm'] | str collect)
|
let color = ($"(ansi -e $prefix)($idx)m")
|
||||||
let padded_number = (echo (build-string $it | str lpad -l 3 -c '0'))
|
let padded_number = ($"($idx)" | str lpad -l 3 -c '0')
|
||||||
|
|
||||||
if $cr == 0 {
|
if $cr == 0 {
|
||||||
echo [$color $padded_number ' ' (char newline)]
|
$"($color)($padded_number) (char newline)"
|
||||||
} {
|
} {
|
||||||
echo [$color $padded_number ' ']
|
$"($color)($padded_number) "
|
||||||
}
|
}
|
||||||
} | str collect
|
} | str collect
|
||||||
}
|
}
|
||||||
|
@ -21,4 +22,4 @@ show_index_colors
|
||||||
# it all on one line which wraps in
|
# it all on one line which wraps in
|
||||||
# your terminal
|
# your terminal
|
||||||
|
|
||||||
#echo 1..256 | each {echo [(ansi -e '38;5;') (build-string $it) 'm' (build-string $it) ' ']} | str collect
|
#echo 1..256 | each { |idx| echo [(ansi -e '38;5;') (build-string $idx) 'm' (build-string $idx) ' ']} | str collect
|
|
@ -6,34 +6,24 @@
|
||||||
# sys.stdout.write(u"\u001b[38;5;" + code + "m " + code.ljust(4))
|
# sys.stdout.write(u"\u001b[38;5;" + code + "m " + code.ljust(4))
|
||||||
# print u"\u001b[0m"
|
# print u"\u001b[0m"
|
||||||
|
|
||||||
|
|
||||||
# Convert anything that's piped into it a string
|
|
||||||
def 'to str' [] {
|
|
||||||
each { build-string $it } | str collect
|
|
||||||
}
|
|
||||||
|
|
||||||
# Foreground Colors
|
# Foreground Colors
|
||||||
echo 0..16 | each {
|
echo 0..16 | each { |col|
|
||||||
let i = $it
|
let row = (echo 0..16 | each { |row|
|
||||||
let row = (echo 0..16 | each {
|
let code = ($col * 16 + $row)
|
||||||
let j = $it
|
|
||||||
let code = ($i * 16 + $j)
|
|
||||||
if $code < 256 {
|
if $code < 256 {
|
||||||
echo [(ansi -e '38;5;') (echo $code | to str) 'm' (echo $code | to str | str lpad -l 4 -c ' ')] | str collect
|
$"(ansi -e '38;5;')($code | into string)m($code | into string | str lpad -l 4 -c ' ')(ansi reset)"
|
||||||
} {} # Do nothing in the else
|
} {} # Do nothing in the else
|
||||||
} | str collect)
|
} | str collect)
|
||||||
echo [$row (char newline)] | str collect
|
$"($row)(char newline)"
|
||||||
} | str collect
|
} | str collect
|
||||||
|
|
||||||
# Background Colors
|
# Background Colors
|
||||||
echo 0..16 | each {
|
echo 0..16 | each { |col|
|
||||||
let i = $it
|
let row = (echo 0..16 | each { |row|
|
||||||
let row = (echo 0..16 | each {
|
let code = ($col * 16 + $row)
|
||||||
let j = $it
|
|
||||||
let code = ($i * 16 + $j)
|
|
||||||
if $code < 256 {
|
if $code < 256 {
|
||||||
echo [(ansi -e '48;5;') (echo $code | to str) 'm' (echo $code | to str | str lpad -l 4 -c ' ') (ansi reset)] | str collect
|
$"(ansi -e '48;5;')($code | into string)m($code | into string | str lpad -l 4 -c ' ')(ansi reset)"
|
||||||
} {} # do nothing in the else
|
} {} # do nothing in the else
|
||||||
} | str collect)
|
} | str collect)
|
||||||
echo [$row (char newline)] | str collect
|
$"($row)(char newline)"
|
||||||
} | str collect
|
} | str collect
|
||||||
|
|
|
@ -3,31 +3,29 @@
|
||||||
|
|
||||||
# This prints the column headers
|
# This prints the column headers
|
||||||
let nl = (char newline)
|
let nl = (char newline)
|
||||||
let plus = (echo [$nl ' + '] | str collect)
|
let plus = $"($nl) + "
|
||||||
let cols = (seq 0 35 | each { echo (build-string $it) | str lpad -c ' ' -l 3 } | str collect)
|
let cols = (seq 0 35 | each { |col| $"($col)" | str lpad -c ' ' -l 3 } | str collect)
|
||||||
echo [$plus $cols] | str collect
|
$"($plus)($cols)"
|
||||||
|
|
||||||
let ansi_bg = (ansi -e '48;5;')
|
let ansi_bg = (ansi -e '48;5;')
|
||||||
let ansi_reset = (ansi reset)
|
let ansi_reset = (ansi reset)
|
||||||
echo $nl $nl | str collect
|
$"($nl)($nl)"
|
||||||
|
|
||||||
# This prints the row headers
|
# This prints the row headers
|
||||||
let row_header = ' 0 '
|
let row_header = ' 0 '
|
||||||
let row_data = (seq 0 15 | each {
|
let row_data = (seq 0 15 | each { |row|
|
||||||
build-string $ansi_bg $it 'm' ' ' $ansi_reset ' '
|
$"($ansi_bg)($row)m ($ansi_reset)"
|
||||||
} | str collect)
|
} | str collect)
|
||||||
echo [$row_header $row_data $nl $nl] | str collect
|
$"($row_header)($row_data)($nl)($nl)"
|
||||||
|
|
||||||
# This is the meat of the script that prints the little squares of color
|
# This is the meat of the script that prints the little squares of color
|
||||||
seq 0 6 | each {
|
seq 0 6 | each { |row_idx|
|
||||||
let math_str = (build-string $it ' * 36 + 16')
|
let r = ($"($row_idx) * 36 + 16" | math eval)
|
||||||
let i = (echo $math_str | math eval)
|
let row_header = (echo $r | str from -d 0 | str lpad -c ' ' -l 4)
|
||||||
let row_header = (echo $i | str from -d 0 | str lpad -c ' ' -l 4)
|
let row_data = (seq 0 35 | each { |row|
|
||||||
let row_data = (seq 0 35 | each {
|
let val = ($"($r + $row)" | math eval | str from -d 0)
|
||||||
let math_str2 = (build-string $i + $it)
|
$"($ansi_bg)($val)m (ansi -e 'm') "
|
||||||
let val = (echo $math_str2 | math eval | str from -d 0)
|
|
||||||
echo [$ansi_bg $val 'm' ' ' (ansi -e 'm') ' ']
|
|
||||||
} | str collect)
|
} | str collect)
|
||||||
build-string $row_header ' ' $row_data $nl $nl
|
$"($row_header) ($row_data)($nl)($nl)"
|
||||||
} | str collect
|
} | str collect
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,7 @@
|
||||||
# Background Colors
|
# Background Colors
|
||||||
echo 40..47 100..107 49 | each {
|
echo 40..47 100..107 49 | each { |clbg|
|
||||||
let clbg = $it
|
|
||||||
# Foreground Colors
|
# Foreground Colors
|
||||||
echo 30..37 90..97 39 | each {
|
echo 30..37 90..97 39 | each { |clfg|
|
||||||
let clfg = $it
|
|
||||||
# 0 Normal
|
# 0 Normal
|
||||||
# 1 Bold or increased intensity
|
# 1 Bold or increased intensity
|
||||||
# 2 Faint or decreased intensity
|
# 2 Faint or decreased intensity
|
||||||
|
@ -14,19 +12,14 @@ echo 40..47 100..107 49 | each {
|
||||||
# 7 Reverse Video
|
# 7 Reverse Video
|
||||||
# 8 Conceal (not widely supported)
|
# 8 Conceal (not widely supported)
|
||||||
# 9 Strike-through
|
# 9 Strike-through
|
||||||
let row = (echo 0..9 | each {
|
let row = (echo 0..9 | each { |attr|
|
||||||
let attr = $it
|
let ansi_str = $"($attr);($clbg);($clfg)m"
|
||||||
let ansi_str = (echo [(make-str $attr) ';' (make-str $clbg) ';' (make-str $clfg) 'm'] | str collect)
|
$"(ansi -e $ansi_str) ($ansi_str) (ansi reset)"
|
||||||
echo [(ansi -e $ansi_str) ' ' $ansi_str ' ' (ansi reset)] | str collect
|
|
||||||
} | str collect)
|
} | str collect)
|
||||||
echo [$row (char newline)] | str collect | autoview
|
$"($row)(char newline)" | autoview
|
||||||
} | str collect
|
} | str collect
|
||||||
} | str collect
|
} | str collect
|
||||||
|
|
||||||
def make-str [item] {
|
|
||||||
echo $item | str from
|
|
||||||
}
|
|
||||||
|
|
||||||
# Bash Script
|
# Bash Script
|
||||||
# for clbg in {40..47} {100..107} 49 ; do
|
# for clbg in {40..47} {100..107} 49 ; do
|
||||||
# #Foreground
|
# #Foreground
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
source ../stdlib_candidate/nu_style.nu
|
source ../stdlib_candidate/nu_style.nu
|
||||||
|
|
||||||
# # Regular Colors
|
# # Regular Colors
|
||||||
echo ' Regular Colors' (char newline) (char newline) | str collect
|
$" Regular Colors (char newline) (char newline)"
|
||||||
# | Value | Color |
|
# | Value | Color |
|
||||||
# | -------- | ------ |
|
# | -------- | ------ |
|
||||||
# | \e[0;30m | Black |
|
# | \e[0;30m | Black |
|
||||||
|
@ -12,20 +12,20 @@ echo ' Regular Colors' (char newline) (char newline) | str collect
|
||||||
# | \e[0;35m | Purple |
|
# | \e[0;35m | Purple |
|
||||||
# | \e[0;36m | Cyan |
|
# | \e[0;36m | Cyan |
|
||||||
# | \e[0;37m | White |
|
# | \e[0;37m | White |
|
||||||
echo '| Value | Color | Name |' (char newline) | str collect
|
$"| Value | Color | Name | (char newline)"
|
||||||
echo '| ----- | ----- | --------- |' (char newline) | str collect
|
$"| ----- | ----- | --------- | (char newline)"
|
||||||
echo '|' (fg_black) ' 0;30m ' (relet) '| ' Black ' | fg_black |' (char newline) | str collect
|
$"| (fg_black)0;30m(relet) | Black | fg_black | (char newline)"
|
||||||
echo '|' (fg_red) ' 0;31m ' (relet) '| ' Red ' | fg_red |' (char newline) | str collect
|
$"| (fg_red)0;31m(relet) | Red | fg_red | (char newline)"
|
||||||
echo '|' (fg_green) ' 0;32m ' (relet) '| ' Green ' | fg_green |' (char newline) | str collect
|
$"| (fg_green)0;32m(relet) | Green | fg_green | (char newline)"
|
||||||
echo '|' (fg_yellow) ' 0;33m ' (relet) '| ' Yellow ' | fg_yellow |' (char newline) | str collect
|
$"| (fg_yellow)0;33m(relet) | Yellow | fg_yellow | (char newline)"
|
||||||
echo '|' (fg_blue) ' 0;34m ' (relet) '| ' Blue ' | fg_blue |' (char newline) | str collect
|
$"| (fg_blue)0;34m(relet) | Blue | fg_blue | (char newline)"
|
||||||
echo '|' (fg_purple) ' 0;35m ' (relet) '| ' Purple ' | fg_purple |' (char newline) | str collect
|
$"| (fg_purple)0;35m(relet) | Purple | fg_purple | (char newline)"
|
||||||
echo '|' (fg_cyan) ' 0;36m ' (relet) '| ' Cyan ' | fg_cyan |' (char newline) | str collect
|
$"| (fg_cyan)0;36m(relet) | Cyan | fg_cyan | (char newline)"
|
||||||
echo '|' (fg_white) ' 0;37m ' (relet) '| ' White ' | fg_white |' (char newline) | str collect
|
$"| (fg_white)0;37m(relet) | White | fg_white | (char newline)"
|
||||||
echo (char newline)
|
char newline
|
||||||
|
|
||||||
# # Bold
|
# # Bold
|
||||||
echo ' Bold Colors' (char newline) (char newline) | str collect
|
$" Bold Colors (char newline) (char newline)"
|
||||||
|
|
||||||
# | Value | Color |
|
# | Value | Color |
|
||||||
# | -------- | -------- |
|
# | -------- | -------- |
|
||||||
|
@ -38,20 +38,20 @@ echo ' Bold Colors' (char newline) (char newline) | str collect
|
||||||
# | \e[1;36m | Cyan |
|
# | \e[1;36m | Cyan |
|
||||||
# | \e[1;37m | White |
|
# | \e[1;37m | White |
|
||||||
# | \e[1m | No Color |
|
# | \e[1m | No Color |
|
||||||
echo '| Value | Color |' (char newline) | str collect
|
$"| Value | Color | (char newline)"
|
||||||
echo '| ----- | ----- |' (char newline) | str collect
|
$"| ----- | ----- | (char newline)"
|
||||||
echo '|' (fg_black) (bold_on) ' 1;30m ' (relet) '| ' Black ' |' (char newline) | str collect
|
$"| (fg_black)(bold_on)1;30m(relet) | Black | (char newline)"
|
||||||
echo '|' (fg_red) (bold_on) ' 1;31m ' (relet) '| ' Red ' |' (char newline) | str collect
|
$"| (fg_red)(bold_on)1;31m(relet) | Red | (char newline)"
|
||||||
echo '|' (fg_green) (bold_on) ' 1;32m ' (relet) '| ' Green ' |' (char newline) | str collect
|
$"| (fg_green)(bold_on)1;32m(relet) | Green | (char newline)"
|
||||||
echo '|' (fg_yellow) (bold_on) ' 1;33m ' (relet) '| ' Yellow ' |' (char newline) | str collect
|
$"| (fg_yellow)(bold_on)1;33m(relet) | Yellow | (char newline)"
|
||||||
echo '|' (fg_blue) (bold_on) ' 1;34m ' (relet) '| ' Blue ' |' (char newline) | str collect
|
$"| (fg_blue)(bold_on)1;34m(relet) | Blue | (char newline)"
|
||||||
echo '|' (fg_purple) (bold_on) ' 1;35m ' (relet) '| ' Purple ' |' (char newline) | str collect
|
$"| (fg_purple)(bold_on)1;35m(relet) | Purple | (char newline)"
|
||||||
echo '|' (fg_cyan) (bold_on) ' 1;36m ' (relet) '| ' Cyan ' |' (char newline) | str collect
|
$"| (fg_cyan)(bold_on)1;36m(relet) | Cyan | (char newline)"
|
||||||
echo '|' (fg_white) (bold_on) ' 1;37m ' (relet) '| ' White ' |' (char newline) | str collect
|
$"| (fg_white)(bold_on)1;37m(relet) | White | (char newline)"
|
||||||
echo (char newline)
|
char newline
|
||||||
|
|
||||||
# # Underline
|
# # Underline
|
||||||
echo ' Underline Colors' (char newline) (char newline) | str collect
|
$" Underline Colors (char newline) (char newline)"
|
||||||
|
|
||||||
# | Value | Color |
|
# | Value | Color |
|
||||||
# | -------- | -------- |
|
# | -------- | -------- |
|
||||||
|
@ -64,20 +64,20 @@ echo ' Underline Colors' (char newline) (char newline) | str collect
|
||||||
# | \e[4;36m | Cyan |
|
# | \e[4;36m | Cyan |
|
||||||
# | \e[4;37m | White |
|
# | \e[4;37m | White |
|
||||||
# | \e[4m | No Color |
|
# | \e[4m | No Color |
|
||||||
echo '| Value | Color |' (char newline) | str collect
|
$"| Value | Color | (char newline)"
|
||||||
echo '| ----- | ----- |' (char newline) | str collect
|
$"| ----- | ----- | (char newline)"
|
||||||
echo '|' (fg_black) (underline_on) ' 4;30m ' (relet) '| ' Black ' |' (char newline) | str collect
|
$"| (fg_black)(underline_on)4;30m(relet) | Black | (char newline)"
|
||||||
echo '|' (fg_red) (underline_on) ' 4;31m ' (relet) '| ' Red ' |' (char newline) | str collect
|
$"| (fg_red)(underline_on)4;31m(relet) | Red | (char newline)"
|
||||||
echo '|' (fg_green) (underline_on) ' 4;32m ' (relet) '| ' Green ' |' (char newline) | str collect
|
$"| (fg_green)(underline_on)4;32m(relet) | Green | (char newline)"
|
||||||
echo '|' (fg_yellow) (underline_on) ' 4;33m ' (relet) '| ' Yellow ' |' (char newline) | str collect
|
$"| (fg_yellow)(underline_on)4;33m(relet) | Yellow | (char newline)"
|
||||||
echo '|' (fg_blue) (underline_on) ' 4;34m ' (relet) '| ' Blue ' |' (char newline) | str collect
|
$"| (fg_blue)(underline_on)4;34m(relet) | Blue | (char newline)"
|
||||||
echo '|' (fg_purple) (underline_on) ' 4;35m ' (relet) '| ' Purple ' |' (char newline) | str collect
|
$"| (fg_purple)(underline_on)4;35m(relet) | Purple | (char newline)"
|
||||||
echo '|' (fg_cyan) (underline_on) ' 4;36m ' (relet) '| ' Cyan ' |' (char newline) | str collect
|
$"| (fg_cyan)(underline_on)4;36m(relet) | Cyan | (char newline)"
|
||||||
echo '|' (fg_white) (underline_on) ' 4;37m ' (relet) '| ' White ' |' (char newline) | str collect
|
$"| (fg_white)(underline_on)4;37m(relet) | White | (char newline)"
|
||||||
echo (char newline)
|
char newline
|
||||||
|
|
||||||
# # Background
|
# # Background
|
||||||
echo ' Background Colors' (char newline) (char newline) | str collect
|
$" Background Colors (char newline) (char newline)"
|
||||||
|
|
||||||
# | Value | Color |
|
# | Value | Color |
|
||||||
# | ------ | ------ |
|
# | ------ | ------ |
|
||||||
|
@ -89,17 +89,17 @@ echo ' Background Colors' (char newline) (char newline) | str collect
|
||||||
# | \e[45m | Purple |
|
# | \e[45m | Purple |
|
||||||
# | \e[46m | Cyan |
|
# | \e[46m | Cyan |
|
||||||
# | \e[47m | White |
|
# | \e[47m | White |
|
||||||
echo '| Value | Color |' (char newline) | str collect
|
$"| Value | Color | (char newline)"
|
||||||
echo '| ----- | ----- |' (char newline) | str collect
|
$"| ----- | ----- | (char newline)"
|
||||||
echo '|' (bg_black) ' 0;40m ' (relet) '| ' Black ' |' (char newline) | str collect
|
$"| (bg_black)0;40m(relet)| Black | (char newline)"
|
||||||
echo '|' (bg_red) ' 0;41m ' (relet) '| ' Red ' |' (char newline) | str collect
|
$"| (bg_red)0;41m(relet)| Red | (char newline)"
|
||||||
echo '|' (bg_green) ' 0;42m ' (relet) '| ' Green ' |' (char newline) | str collect
|
$"| (bg_green)0;42m(relet)| Green | (char newline)"
|
||||||
echo '|' (bg_yellow) ' 0;43m ' (relet) '| ' Yellow ' |' (char newline) | str collect
|
$"| (bg_yellow)0;43m(relet)| Yellow | (char newline)"
|
||||||
echo '|' (bg_blue) ' 0;44m ' (relet) '| ' Blue ' |' (char newline) | str collect
|
$"| (bg_blue)0;44m(relet)| Blue | (char newline)"
|
||||||
echo '|' (bg_purple) ' 0;45m ' (relet) '| ' Purple ' |' (char newline) | str collect
|
$"| (bg_purple)0;45m(relet)| Purple | (char newline)"
|
||||||
echo '|' (bg_cyan) ' 0;46m ' (relet) '| ' Cyan ' |' (char newline) | str collect
|
$"| (bg_cyan)0;46m(relet)| Cyan | (char newline)"
|
||||||
echo '|' (bg_white) ' 0;47m ' (relet) '| ' White ' |' (char newline) | str collect
|
$"| (bg_white)0;47m(relet)| White | (char newline)"
|
||||||
echo (char newline)
|
char newline
|
||||||
|
|
||||||
# # Expand Background Horizontally
|
# # Expand Background Horizontally
|
||||||
|
|
||||||
|
@ -108,7 +108,7 @@ echo (char newline)
|
||||||
# | \e[K | No Color |
|
# | \e[K | No Color |
|
||||||
|
|
||||||
# # High Intensty
|
# # High Intensty
|
||||||
echo ' High Intensity' (char newline) (char newline) | str collect
|
$" High Intensity (char newline) (char newline)"
|
||||||
|
|
||||||
# | Value | Color |
|
# | Value | Color |
|
||||||
# | -------- | ------ |
|
# | -------- | ------ |
|
||||||
|
@ -120,20 +120,20 @@ echo ' High Intensity' (char newline) (char newline) | str collect
|
||||||
# | \e[0;95m | Purple |
|
# | \e[0;95m | Purple |
|
||||||
# | \e[0;96m | Cyan |
|
# | \e[0;96m | Cyan |
|
||||||
# | \e[0;97m | White |
|
# | \e[0;97m | White |
|
||||||
echo '| Value | Color |' (char newline) | str collect
|
$"| Value | Color | (char newline)"
|
||||||
echo '| ----- | ----- |' (char newline) | str collect
|
$"| ----- | ----- | (char newline)"
|
||||||
echo '|' (fg_light_black) ' 0;90m ' (relet) '| ' Black ' |' (char newline) | str collect
|
$"| (fg_light_black)0;90m(relet) | Black | (char newline)"
|
||||||
echo '|' (fg_light_red) ' 0;91m ' (relet) '| ' Red ' |' (char newline) | str collect
|
$"| (fg_light_red)0;91m(relet) | Red | (char newline)"
|
||||||
echo '|' (fg_light_green) ' 0;92m ' (relet) '| ' Green ' |' (char newline) | str collect
|
$"| (fg_light_green)0;92m(relet) | Green | (char newline)"
|
||||||
echo '|' (fg_light_yellow) ' 0;93m ' (relet) '| ' Yellow ' |' (char newline) | str collect
|
$"| (fg_light_yellow)0;93m(relet) | Yellow | (char newline)"
|
||||||
echo '|' (fg_light_blue) ' 0;94m ' (relet) '| ' Blue ' |' (char newline) | str collect
|
$"| (fg_light_blue)0;94m(relet) | Blue | (char newline)"
|
||||||
echo '|' (fg_light_purple) ' 0;95m ' (relet) '| ' Purple ' |' (char newline) | str collect
|
$"| (fg_light_purple)0;95m(relet) | Purple | (char newline)"
|
||||||
echo '|' (fg_light_cyan) ' 0;96m ' (relet) '| ' Cyan ' |' (char newline) | str collect
|
$"| (fg_light_cyan)0;96m(relet) | Cyan | (char newline)"
|
||||||
echo '|' (fg_light_white) ' 0;97m ' (relet) '| ' White ' |' (char newline) | str collect
|
$"| (fg_light_white)0;97m(relet) | White | (char newline)"
|
||||||
echo (char newline)
|
char newline
|
||||||
|
|
||||||
# # Bold High Intensty
|
# # Bold High Intensty
|
||||||
echo ' Bold High Intensity' (char newline) (char newline) | str collect
|
$" Bold High Intensity (char newline) (char newline)"
|
||||||
|
|
||||||
# | Value | Color |
|
# | Value | Color |
|
||||||
# | -------- | ------ |
|
# | -------- | ------ |
|
||||||
|
@ -145,20 +145,20 @@ echo ' Bold High Intensity' (char newline) (char newline) | str collect
|
||||||
# | \e[1;95m | Purple |
|
# | \e[1;95m | Purple |
|
||||||
# | \e[1;96m | Cyan |
|
# | \e[1;96m | Cyan |
|
||||||
# | \e[1;97m | White |
|
# | \e[1;97m | White |
|
||||||
echo '| Value | Color |' (char newline) | str collect
|
$"| Value | Color | (char newline)"
|
||||||
echo '| ----- | ----- |' (char newline) | str collect
|
$"| ----- | ----- | (char newline)"
|
||||||
echo '|' (fg_light_black) (bold_on) ' 1;90m ' (relet) '| ' Black ' |' (char newline) | str collect
|
$"| (fg_light_black)(bold_on)1;90m(relet) | Black | (char newline)"
|
||||||
echo '|' (fg_light_red) (bold_on) ' 1;91m ' (relet) '| ' Red ' |' (char newline) | str collect
|
$"| (fg_light_red)(bold_on)1;91m(relet) | Red | (char newline)"
|
||||||
echo '|' (fg_light_green) (bold_on) ' 1;92m ' (relet) '| ' Green ' |' (char newline) | str collect
|
$"| (fg_light_green)(bold_on)1;92m(relet) | Green | (char newline)"
|
||||||
echo '|' (fg_light_yellow) (bold_on) ' 1;93m ' (relet) '| ' Yellow ' |' (char newline) | str collect
|
$"| (fg_light_yellow)(bold_on)1;93m(relet) | Yellow | (char newline)"
|
||||||
echo '|' (fg_light_blue) (bold_on) ' 1;94m ' (relet) '| ' Blue ' |' (char newline) | str collect
|
$"| (fg_light_blue)(bold_on)1;94m(relet) | Blue | (char newline)"
|
||||||
echo '|' (fg_light_purple) (bold_on) ' 1;95m ' (relet) '| ' Purple ' |' (char newline) | str collect
|
$"| (fg_light_purple)(bold_on)1;95m(relet) | Purple | (char newline)"
|
||||||
echo '|' (fg_light_cyan) (bold_on) ' 1;96m ' (relet) '| ' Cyan ' |' (char newline) | str collect
|
$"| (fg_light_cyan)(bold_on)1;96m(relet) | Cyan | (char newline)"
|
||||||
echo '|' (fg_light_white) (bold_on) ' 1;97m ' (relet) '| ' White ' |' (char newline) | str collect
|
$"| (fg_light_white)(bold_on)1;97m(relet) | White | (char newline)"
|
||||||
echo (char newline)
|
char newline
|
||||||
|
|
||||||
# # High Intensty backgrounds
|
# # High Intensty backgrounds
|
||||||
echo ' High Intensity backgrounds' (char newline) (char newline) | str collect
|
$" High Intensity backgrounds (char newline) (char newline)"
|
||||||
|
|
||||||
# | Value | Color |
|
# | Value | Color |
|
||||||
# | --------- | ------ |
|
# | --------- | ------ |
|
||||||
|
@ -170,17 +170,17 @@ echo ' High Intensity backgrounds' (char newline) (char newline) | str collect
|
||||||
# | \e[0;105m | Purple |
|
# | \e[0;105m | Purple |
|
||||||
# | \e[0;106m | Cyan |
|
# | \e[0;106m | Cyan |
|
||||||
# | \e[0;107m | White |
|
# | \e[0;107m | White |
|
||||||
echo '| Value | Color |' (char newline) | str collect
|
$"| Value | Color | (char newline)"
|
||||||
echo '| ----- | ----- |' (char newline) | str collect
|
$"| ----- | ----- | (char newline)"
|
||||||
echo '|' (bg_light_black) ' 0;100m ' (relet) '| ' Black ' |' (char newline) | str collect
|
$"| (bg_light_black)0;100m(relet) | Black | (char newline)"
|
||||||
echo '|' (bg_light_red) ' 0;101m ' (relet) '| ' Red ' |' (char newline) | str collect
|
$"| (bg_light_red)0;101m(relet) | Red | (char newline)"
|
||||||
echo '|' (bg_light_green) ' 0;102m ' (relet) '| ' Green ' |' (char newline) | str collect
|
$"| (bg_light_green)0;102m(relet) | Green | (char newline)"
|
||||||
echo '|' (bg_light_yellow) ' 0;103m ' (relet) '| ' Yellow ' |' (char newline) | str collect
|
$"| (bg_light_yellow)0;103m(relet) | Yellow | (char newline)"
|
||||||
echo '|' (bg_light_blue) ' 0;104m ' (relet) '| ' Blue ' |' (char newline) | str collect
|
$"| (bg_light_blue)0;104m(relet) | Blue | (char newline)"
|
||||||
echo '|' (bg_light_purple) ' 0;105m ' (relet) '| ' Purple ' |' (char newline) | str collect
|
$"| (bg_light_purple)0;105m(relet) | Purple | (char newline)"
|
||||||
echo '|' (bg_light_cyan) ' 0;106m ' (relet) '| ' Cyan ' |' (char newline) | str collect
|
$"| (bg_light_cyan)0;106m(relet) | Cyan | (char newline)"
|
||||||
echo '|' (bg_light_white) ' 0;107m ' (relet) '| ' White ' |' (char newline) | str collect
|
$"| (bg_light_white)0;107m(relet) | White | (char newline)"
|
||||||
echo (char newline)
|
char newline
|
||||||
|
|
||||||
# # Reset
|
# # Reset
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
# This is a first attempt and some type of logging
|
# This is a first attempt and some type of logging
|
||||||
def log [message:any] {
|
def log [message:any] {
|
||||||
let now = (date now | date format '%Y%m%d_%H%M%S.%f')
|
let now = (date now | date format '%Y%m%d_%H%M%S.%f')
|
||||||
let mess = (build-string $now '|DBG|' $message (char newline))
|
let mess = $"($now)|DBG|($message)(char nl)"
|
||||||
echo $mess | autoview
|
echo $mess | autoview
|
||||||
}
|
}
|
Loading…
Add table
Add a link
Reference in a new issue