2022-02-15 21:57:16 +03:00
|
|
|
# this script will print a blue gradient on the screen
|
|
|
|
# it's intended to simulate nushell v0.44 with autoview
|
|
|
|
|
|
|
|
let height = (term size).rows - 3 # calculate height
|
|
|
|
let width = (term size).columns - 5 # calculate width
|
|
|
|
let stamp_start = $width * 1.25 # calculate where to start Nu stamp
|
2023-03-31 15:39:20 +03:00
|
|
|
let stamp_end = $width * 1.3 # calculate where to stop Nu stamp
|
2022-02-15 21:57:16 +03:00
|
|
|
let stamp = 'Nu'
|
2023-03-31 15:39:20 +03:00
|
|
|
seq 0 $height | par-each {|| # create these in parallel
|
2022-02-15 21:57:16 +03:00
|
|
|
let row_data = (seq 0 $width | each { |col|
|
|
|
|
let fgcolor = 2 + 2 * $col
|
2022-12-08 02:52:10 +03:00
|
|
|
if $fgcolor > $stamp_start and $fgcolor < $stamp_end {
|
2022-02-15 21:57:16 +03:00
|
|
|
$"(ansi -e '48;2;0;0;')($fgcolor)m($stamp)(ansi -e '0m')"
|
|
|
|
} else {
|
|
|
|
$"(ansi -e '48;2;0;0;')($fgcolor)m (ansi -e '0m')"
|
|
|
|
}
|
2023-04-03 16:47:25 +03:00
|
|
|
} | str join)
|
2023-03-31 15:39:20 +03:00
|
|
|
print -n $"($row_data)" | table
|
2023-09-26 19:52:49 +03:00
|
|
|
null
|
2022-02-15 21:57:16 +03:00
|
|
|
} | compact
|