mirror of
https://github.com/RGBCube/nu_scripts
synced 2025-08-01 22:57:46 +00:00
add for to some scripts
This commit is contained in:
parent
cbe7f74a34
commit
0a310cd9fa
3 changed files with 21 additions and 8 deletions
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
.DS_Store
|
|
@ -1,8 +1,7 @@
|
||||||
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
|
# let's itertate through each of the columns of our terminal
|
||||||
echo 0..$term_cols |
|
for col inc 0..$term_cols {
|
||||||
each { |col|
|
|
||||||
let r = (255 - ($col * 255 / $term_cols) | math round)
|
let r = (255 - ($col * 255 / $term_cols) | math round)
|
||||||
let g = ($col * 510 / $term_cols | math round)
|
let g = ($col * 510 / $term_cols | math round)
|
||||||
let b = ($col * 255 / $term_cols | math round)
|
let b = ($col * 255 / $term_cols | math round)
|
||||||
|
|
|
@ -10,13 +10,26 @@
|
||||||
# done
|
# done
|
||||||
# echo ""
|
# echo ""
|
||||||
|
|
||||||
echo 0..8 | each { |style|
|
# Nushell 0.32.0
|
||||||
let row = (echo 30..37 | each { |fg|
|
for x in 0..8 {
|
||||||
let row = (echo 40..47 | each { |bg|
|
let row = (for i in 30..37 {
|
||||||
let color = $"($style);($fg);($bg)m"
|
let row = (for a in 40..47 {
|
||||||
$"(ansi -e $color)($color)(ansi reset) "
|
let color = $"($x);($i);($a)"
|
||||||
|
$"(ansi -e $color)m\e[($color)(ansi -e '0;37;40')m "
|
||||||
} | str collect)
|
} | str collect)
|
||||||
$"($row)(char newline)"
|
$"($row)(char newline)"
|
||||||
} | str collect)
|
} | str collect)
|
||||||
$"($row)(char newline)"
|
$"($row)(char newline)"
|
||||||
} | str collect
|
} | str collect
|
||||||
|
|
||||||
|
# Nushell 0.31.0
|
||||||
|
# echo 0..8 | each { |style|
|
||||||
|
# let row = (echo 30..37 | each { |fg|
|
||||||
|
# let row = (echo 40..47 | each { |bg|
|
||||||
|
# let color = $"($style);($fg);($bg)m"
|
||||||
|
# $"(ansi -e $color)($color)(ansi reset) "
|
||||||
|
# } | str collect)
|
||||||
|
# $"($row)(char newline)"
|
||||||
|
# } | str collect)
|
||||||
|
# $"($row)(char newline)"
|
||||||
|
# } | str collect
|
Loading…
Add table
Add a link
Reference in a new issue