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

update gradient for better nushell comparisons

This commit is contained in:
Darren Schroeder 2021-06-04 13:04:47 -05:00
parent c99eec8c78
commit dd7a736624

View file

@ -0,0 +1,27 @@
function Set-Cursor {
[CmdletBinding()]
param ([int] $x, [int] $y)
$Host.UI.RawUI.CursorPosition = @{x = $x; y = $y }
}
function Get-Character {
[CmdletBinding()]
param ([int]$index)
$mystring = ' Trevor Sullivan'
return $index -ge ($mystring.Length) ? ' ' : $mystring[$index]
}
function main {
# This is the same script as gradient.ps1 but hard coded
# to 40x160 for nushell comparisions
for ($y = 0; $y -le 39; $y++) {
$Color = 25
Set-Cursor -x $PSItem -y $y
0..159 | ForEach-Object {
Write-Host -Object ("`e[48;2;0;0;$Color`m{0}" -f (Get-Character -Index $PSItem)) -NoNewline
$Color += 2
}
}
}
main