1
Fork 0
mirror of https://github.com/RGBCube/nu_scripts synced 2025-08-01 06:37:46 +00:00

add for to some scripts

This commit is contained in:
Darren Schroeder 2021-06-02 17:47:16 -05:00
parent cbe7f74a34
commit 0a310cd9fa
3 changed files with 21 additions and 8 deletions

1
.gitignore vendored Normal file
View file

@ -0,0 +1 @@
.DS_Store

View file

@ -1,8 +1,7 @@
let term_cols = ((term size -w) - 1)
# let's itertate through each of the columns of our terminal
echo 0..$term_cols |
each { |col|
for col inc 0..$term_cols {
let r = (255 - ($col * 255 / $term_cols) | math round)
let g = ($col * 510 / $term_cols | math round)
let b = ($col * 255 / $term_cols | math round)

View file

@ -10,13 +10,26 @@
# done
# echo ""
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) "
# Nushell 0.32.0
for x in 0..8 {
let row = (for i in 30..37 {
let row = (for a in 40..47 {
let color = $"($x);($i);($a)"
$"(ansi -e $color)m\e[($color)(ansi -e '0;37;40')m "
} | str collect)
$"($row)(char newline)"
} | str collect)
$"($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