diff --git a/Plaster/Private/Show-Logo.ps1 b/Plaster/Private/Show-Logo.ps1 index 055a412..6075bef 100644 --- a/Plaster/Private/Show-Logo.ps1 +++ b/Plaster/Private/Show-Logo.ps1 @@ -1,24 +1,12 @@ -function Show-Logo { +#!/usr/bin/env pwsh +# Auto-generated by PX2PS 2025.12.29 +# Source: Plaster2-1.px (65x12) +# Generated: 2026-11-07 09:43:53 - if ($env:NO_COLOR) { - @' - ▄▄▄▄▄▄ ▄▄▄ ▄ ██▀▀▀▀▀█████▀▀▀███ - ██ ██ ██ ██ █▄▄███ ██▀ ▄█▄ ▀█ - ██▄▄█▀ ██ ▀▀▀█▄ ▄█▀▀▀█▄▀██▀▀ ▄█▀▀▀█▄▀█▄█▀█▄ ████▀ ▄███ █▀█ █ - ██ ██ ▄█▀▀██ ▀█▄▄ ██ ██▀▀▀▀▀ ██ ▀▀ ██▀ ▄█████ █▄█ █ - ██ ██ ██ ██ ▄▄ ▀█▄ ██ ▄██ ▄▄ ██ █ ███▀▀██▄ ▀█▀ ▄█ - ▀▀▀▀ ▀▀▀▀ ▀▀▀▀ ▀ ▀▀▀▀▀ ▀▀▀ ▀▀▀▀▀ ▀▀▀▀ █▄▄▄▄▄▄▄█▄██▄▄▄███ -'@ - } else { - #!/usr/bin/env pwsh - # Auto-generated by PX2PS 2025.12.29 - # Source: Plaster2.px (65x12) - # Generated: 2026-04-13 12:45:59 - - # Enable Virtual Terminal Processing for ANSI colors (Windows PowerShell 5.1 compatibility) - if ($PSVersionTable.PSVersion.Major -le 5 -and $env:OS -eq 'Windows_NT') { - try { - Add-Type -TypeDefinition @' +# Enable Virtual Terminal Processing for ANSI colors (Windows PowerShell 5.1 compatibility) +if ($PSVersionTable.PSVersion.Major -le 5 -and $env:OS -eq 'Windows_NT' -and $Host.Name -ne 'Windows PowerShell ISE Host') { + try { + Add-Type -TypeDefinition @" using System; using System.Runtime.InteropServices; public class VTConsole { @@ -35,850 +23,925 @@ public class VTConsole { SetConsoleMode(handle, mode | 0x4); } } -'@ -ErrorAction SilentlyContinue - [VTConsole]::EnableVT() - } catch { - # VT processing may already be enabled or not available - } - } +"@ -ErrorAction SilentlyContinue + [VTConsole]::EnableVT() + } catch { + # VT processing may already be enabled or not available + } +} - $ESC = [char]27 - $LowerHalfBlock = [char]0x2584 +$ESC = [char]27 +$LowerHalfBlock = [char]0x2584 +$UpperHalfBlock = [char]0x2580 - function Get-TrueColorFg { - param([int]$R, [int]$G, [int]$B) - return "$ESC[38;2;${R};${G};${B}m" +function ConvertTo-ConsoleColor { + param([int]$R, [int]$G, [int]$B) + $colorMap = @( + @{ Color = [System.ConsoleColor]::Black; R = 0; G = 0; B = 0 } + @{ Color = [System.ConsoleColor]::DarkBlue; R = 0; G = 0; B = 128 } + @{ Color = [System.ConsoleColor]::DarkGreen; R = 0; G = 128; B = 0 } + @{ Color = [System.ConsoleColor]::DarkCyan; R = 0; G = 128; B = 128 } + @{ Color = [System.ConsoleColor]::DarkRed; R = 128; G = 0; B = 0 } + @{ Color = [System.ConsoleColor]::DarkMagenta; R = 128; G = 0; B = 128 } + @{ Color = [System.ConsoleColor]::DarkYellow; R = 128; G = 128; B = 0 } + @{ Color = [System.ConsoleColor]::Gray; R = 192; G = 192; B = 192 } + @{ Color = [System.ConsoleColor]::DarkGray; R = 128; G = 128; B = 128 } + @{ Color = [System.ConsoleColor]::Blue; R = 0; G = 0; B = 255 } + @{ Color = [System.ConsoleColor]::Green; R = 0; G = 255; B = 0 } + @{ Color = [System.ConsoleColor]::Cyan; R = 0; G = 255; B = 255 } + @{ Color = [System.ConsoleColor]::Red; R = 255; G = 0; B = 0 } + @{ Color = [System.ConsoleColor]::Magenta; R = 255; G = 0; B = 255 } + @{ Color = [System.ConsoleColor]::Yellow; R = 255; G = 255; B = 0 } + @{ Color = [System.ConsoleColor]::White; R = 255; G = 255; B = 255 } + ) + $nearestColor = [System.ConsoleColor]::Black + $minDistance = [int]::MaxValue + foreach ($entry in $colorMap) { + $dr = $R - $entry.R + $dg = $G - $entry.G + $db = $B - $entry.B + $distance = ($dr * $dr) + ($dg * $dg) + ($db * $db) + if ($distance -lt $minDistance) { + $minDistance = $distance + $nearestColor = $entry.Color } + } + return $nearestColor +} + +function Get-TrueColorFg { + param([int]$R, [int]$G, [int]$B) + return "$ESC[38;2;${R};${G};${B}m" +} + +function Get-TrueColorBg { + param([int]$R, [int]$G, [int]$B) + return "$ESC[48;2;${R};${G};${B}m" +} + +$width = 65 +$height = 12 +$pixels = @( + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(35,188,238,255), + @(35,188,238,255), + @(35,188,238,255), + @(35,188,238,255), + @(35,188,238,255), + @(35,188,238,255), + @(35,188,238,255), + @(35,188,238,255), + @(35,188,238,255), + @(35,188,238,255), + @(35,188,238,255), + @(35,188,238,255), + @(35,188,238,255), + @(35,188,238,255), + @(35,188,238,255), + @(35,188,238,255), + @(35,188,238,255), + @(35,188,238,255), + @(30,30,30,255), + @(255,255,255,255), + @(255,255,255,255), + @(255,255,255,255), + @(255,255,255,255), + @(255,255,255,255), + @(255,255,255,255), + @(30,30,30,255), + @(255,255,255,255), + @(255,255,255,255), + @(255,255,255,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(255,255,255,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(35,188,238,255), + @(35,188,238,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(35,188,238,255), + @(35,188,238,255), + @(35,188,238,255), + @(35,188,238,255), + @(35,188,238,255), + @(35,188,238,255), + @(30,30,30,255), + @(30,30,30,255), + @(35,188,238,255), + @(35,188,238,255), + @(35,188,238,255), + @(30,30,30,255), + @(30,30,30,255), + @(255,255,255,255), + @(255,255,255,255), + @(30,30,30,255), + @(30,30,30,255), + @(255,255,255,255), + @(255,255,255,255), + @(30,30,30,255), + @(255,255,255,255), + @(255,255,255,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(255,255,255,255), + @(255,255,255,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(35,188,238,255), + @(30,30,30,255), + @(30,30,30,255), + @(35,188,238,255), + @(35,188,238,255), + @(35,188,238,255), + @(30,30,30,255), + @(30,30,30,255), + @(35,188,238,255), + @(35,188,238,255), + @(35,188,238,255), + @(35,188,238,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(35,188,238,255), + @(35,188,238,255), + @(35,188,238,255), + @(30,30,30,255), + @(30,30,30,255), + @(255,255,255,255), + @(255,255,255,255), + @(30,30,30,255), + @(30,30,30,255), + @(255,255,255,255), + @(255,255,255,255), + @(30,30,30,255), + @(255,255,255,255), + @(255,255,255,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(255,255,255,255), + @(255,255,255,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(35,188,238,255), + @(35,188,238,255), + @(35,188,238,255), + @(35,188,238,255), + @(35,188,238,255), + @(35,188,238,255), + @(30,30,30,255), + @(30,30,30,255), + @(35,188,238,255), + @(35,188,238,255), + @(35,188,238,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(35,188,238,255), + @(35,188,238,255), + @(35,188,238,255), + @(30,30,30,255), + @(30,30,30,255), + @(255,255,255,255), + @(255,255,255,255), + @(30,30,30,255), + @(30,30,30,255), + @(255,255,255,255), + @(255,255,255,255), + @(30,30,30,255), + @(255,255,255,255), + @(255,255,255,255), + @(30,30,30,255), + @(30,30,30,255), + @(255,255,255,255), + @(255,255,255,255), + @(255,255,255,255), + @(255,255,255,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(255,255,255,255), + @(255,255,255,255), + @(255,255,255,255), + @(255,255,255,255), + @(255,255,255,255), + @(30,30,30,255), + @(255,255,255,255), + @(255,255,255,255), + @(255,255,255,255), + @(255,255,255,255), + @(255,255,255,255), + @(30,30,30,255), + @(30,30,30,255), + @(255,255,255,255), + @(255,255,255,255), + @(255,255,255,255), + @(255,255,255,255), + @(255,255,255,255), + @(30,30,30,255), + @(255,255,255,255), + @(255,255,255,255), + @(30,30,30,255), + @(255,255,255,255), + @(255,255,255,255), + @(255,255,255,255), + @(30,30,30,255), + @(30,30,30,255), + @(35,188,238,255), + @(35,188,238,255), + @(35,188,238,255), + @(35,188,238,255), + @(35,188,238,255), + @(30,30,30,255), + @(30,30,30,255), + @(35,188,238,255), + @(35,188,238,255), + @(35,188,238,255), + @(35,188,238,255), + @(35,188,238,255), + @(35,188,238,255), + @(30,30,30,255), + @(30,30,30,255), + @(35,188,238,255), + @(35,188,238,255), + @(35,188,238,255), + @(30,30,30,255), + @(30,30,30,255), + @(255,255,255,255), + @(255,255,255,255), + @(255,255,255,255), + @(255,255,255,255), + @(255,255,255,255), + @(30,30,30,255), + @(30,30,30,255), + @(255,255,255,255), + @(255,255,255,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(255,255,255,255), + @(255,255,255,255), + @(30,30,30,255), + @(255,255,255,255), + @(255,255,255,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(255,255,255,255), + @(255,255,255,255), + @(30,30,30,255), + @(255,255,255,255), + @(255,255,255,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(255,255,255,255), + @(255,255,255,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(255,255,255,255), + @(255,255,255,255), + @(30,30,30,255), + @(255,255,255,255), + @(255,255,255,255), + @(255,255,255,255), + @(30,30,30,255), + @(255,255,255,255), + @(255,255,255,255), + @(30,30,30,255), + @(35,188,238,255), + @(35,188,238,255), + @(35,188,238,255), + @(35,188,238,255), + @(30,30,30,255), + @(30,30,30,255), + @(35,188,238,255), + @(35,188,238,255), + @(35,188,238,255), + @(35,188,238,255), + @(35,188,238,255), + @(35,188,238,255), + @(35,188,238,255), + @(30,30,30,255), + @(30,30,30,255), + @(35,188,238,255), + @(35,188,238,255), + @(35,188,238,255), + @(30,30,30,255), + @(30,30,30,255), + @(255,255,255,255), + @(255,255,255,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(255,255,255,255), + @(255,255,255,255), + @(30,30,30,255), + @(30,30,30,255), + @(255,255,255,255), + @(255,255,255,255), + @(255,255,255,255), + @(255,255,255,255), + @(255,255,255,255), + @(30,30,30,255), + @(30,30,30,255), + @(255,255,255,255), + @(255,255,255,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(255,255,255,255), + @(255,255,255,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(255,255,255,255), + @(255,255,255,255), + @(255,255,255,255), + @(255,255,255,255), + @(255,255,255,255), + @(255,255,255,255), + @(255,255,255,255), + @(30,30,30,255), + @(255,255,255,255), + @(255,255,255,255), + @(30,30,30,255), + @(30,30,30,255), + @(255,255,255,255), + @(255,255,255,255), + @(30,30,30,255), + @(35,188,238,255), + @(35,188,238,255), + @(35,188,238,255), + @(30,30,30,255), + @(30,30,30,255), + @(35,188,238,255), + @(35,188,238,255), + @(35,188,238,255), + @(35,188,238,255), + @(35,188,238,255), + @(35,188,238,255), + @(35,188,238,255), + @(35,188,238,255), + @(30,30,30,255), + @(30,30,30,255), + @(35,188,238,255), + @(35,188,238,255), + @(35,188,238,255), + @(30,30,30,255), + @(30,30,30,255), + @(255,255,255,255), + @(255,255,255,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(255,255,255,255), + @(255,255,255,255), + @(30,30,30,255), + @(255,255,255,255), + @(255,255,255,255), + @(30,30,30,255), + @(30,30,30,255), + @(255,255,255,255), + @(255,255,255,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(255,255,255,255), + @(255,255,255,255), + @(255,255,255,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(255,255,255,255), + @(255,255,255,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(255,255,255,255), + @(255,255,255,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(255,255,255,255), + @(255,255,255,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(35,188,238,255), + @(35,188,238,255), + @(30,30,30,255), + @(30,30,30,255), + @(35,188,238,255), + @(35,188,238,255), + @(35,188,238,255), + @(35,188,238,255), + @(35,188,238,255), + @(35,188,238,255), + @(35,188,238,255), + @(35,188,238,255), + @(35,188,238,255), + @(30,30,30,255), + @(30,30,30,255), + @(35,188,238,255), + @(35,188,238,255), + @(35,188,238,255), + @(30,30,30,255), + @(30,30,30,255), + @(255,255,255,255), + @(255,255,255,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(255,255,255,255), + @(255,255,255,255), + @(30,30,30,255), + @(255,255,255,255), + @(255,255,255,255), + @(30,30,30,255), + @(30,30,30,255), + @(255,255,255,255), + @(255,255,255,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(255,255,255,255), + @(255,255,255,255), + @(30,30,30,255), + @(30,30,30,255), + @(255,255,255,255), + @(255,255,255,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(255,255,255,255), + @(255,255,255,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(255,255,255,255), + @(255,255,255,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(35,188,238,255), + @(30,30,30,255), + @(30,30,30,255), + @(35,188,238,255), + @(35,188,238,255), + @(35,188,238,255), + @(35,188,238,255), + @(35,188,238,255), + @(35,188,238,255), + @(35,188,238,255), + @(35,188,238,255), + @(35,188,238,255), + @(35,188,238,255), + @(30,30,30,255), + @(30,30,30,255), + @(35,188,238,255), + @(35,188,238,255), + @(35,188,238,255), + @(30,30,30,255), + @(30,30,30,255), + @(255,255,255,255), + @(255,255,255,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(255,255,255,255), + @(255,255,255,255), + @(30,30,30,255), + @(255,255,255,255), + @(255,255,255,255), + @(30,30,30,255), + @(30,30,30,255), + @(255,255,255,255), + @(255,255,255,255), + @(30,30,30,255), + @(255,255,255,255), + @(255,255,255,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(255,255,255,255), + @(255,255,255,255), + @(30,30,30,255), + @(255,255,255,255), + @(255,255,255,255), + @(30,30,30,255), + @(255,255,255,255), + @(255,255,255,255), + @(255,255,255,255), + @(255,255,255,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(255,255,255,255), + @(255,255,255,255), + @(30,30,30,255), + @(255,255,255,255), + @(255,255,255,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(35,188,238,255), + @(30,30,30,255), + @(30,30,30,255), + @(35,188,238,255), + @(35,188,238,255), + @(35,188,238,255), + @(30,30,30,255), + @(30,30,30,255), + @(35,188,238,255), + @(35,188,238,255), + @(35,188,238,255), + @(35,188,238,255), + @(35,188,238,255), + @(30,30,30,255), + @(30,30,30,255), + @(35,188,238,255), + @(35,188,238,255), + @(35,188,238,255), + @(30,30,30,255), + @(255,255,255,255), + @(255,255,255,255), + @(255,255,255,255), + @(255,255,255,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(255,255,255,255), + @(255,255,255,255), + @(255,255,255,255), + @(255,255,255,255), + @(30,30,30,255), + @(255,255,255,255), + @(255,255,255,255), + @(255,255,255,255), + @(255,255,255,255), + @(30,30,30,255), + @(255,255,255,255), + @(30,30,30,255), + @(255,255,255,255), + @(255,255,255,255), + @(255,255,255,255), + @(255,255,255,255), + @(255,255,255,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(255,255,255,255), + @(255,255,255,255), + @(255,255,255,255), + @(30,30,30,255), + @(30,30,30,255), + @(255,255,255,255), + @(255,255,255,255), + @(255,255,255,255), + @(255,255,255,255), + @(255,255,255,255), + @(30,30,30,255), + @(255,255,255,255), + @(255,255,255,255), + @(255,255,255,255), + @(255,255,255,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(35,188,238,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(35,188,238,255), + @(30,30,30,255), + @(35,188,238,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(35,188,238,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(30,30,30,255), + @(35,188,238,255), + @(35,188,238,255), + @(35,188,238,255), + @(35,188,238,255), + @(35,188,238,255), + @(35,188,238,255), + @(35,188,238,255), + @(35,188,238,255), + @(35,188,238,255), + @(35,188,238,255), + @(35,188,238,255), + @(35,188,238,255), + @(35,188,238,255), + @(35,188,238,255), + @(35,188,238,255), + @(35,188,238,255), + @(35,188,238,255), + @(35,188,238,255) +) - function Get-TrueColorBg { - param([int]$R, [int]$G, [int]$B) - return "$ESC[48;2;${R};${G};${B}m" +$oddHeight = ($height % 2) -eq 1 +$startY = if ($oddHeight) { -1 } else { 0 } +$endY = if ($oddHeight) { $height - 1 } else { $height } + +if ($Host.Name -eq 'Windows PowerShell ISE Host') { + for ($y = $startY; $y -lt $endY; $y += 2) { + for ($x = 0; $x -lt $width; $x++) { + $topY = $y + $bottomY = $y + 1 + + if ($topY -lt 0) { + $topPixel = $null + } else { + $topIdx = ($topY * $width) + $x + $topPixel = if ($topIdx -lt $pixels.Count) { $pixels[$topIdx] } else { @(0, 0, 0, 0) } + } + + $bottomIdx = ($bottomY * $width) + $x + $bottomPixel = if ($bottomIdx -lt $pixels.Count) { $pixels[$bottomIdx] } else { @(0, 0, 0, 0) } + + $topTransparent = ($null -eq $topPixel) -or ($topPixel[3] -lt 32) + $bottomTransparent = $bottomPixel[3] -lt 32 + + if (-not $topTransparent -and -not $bottomTransparent) { + $fgColor = ConvertTo-ConsoleColor -R $bottomPixel[0] -G $bottomPixel[1] -B $bottomPixel[2] + $bgColor = ConvertTo-ConsoleColor -R $topPixel[0] -G $topPixel[1] -B $topPixel[2] + Write-Host $LowerHalfBlock -ForegroundColor $fgColor -BackgroundColor $bgColor -NoNewline + } elseif (-not $topTransparent -and $bottomTransparent) { + $fgColor = ConvertTo-ConsoleColor -R $topPixel[0] -G $topPixel[1] -B $topPixel[2] + Write-Host $UpperHalfBlock -ForegroundColor $fgColor -NoNewline + } elseif ($topTransparent -and -not $bottomTransparent) { + $fgColor = ConvertTo-ConsoleColor -R $bottomPixel[0] -G $bottomPixel[1] -B $bottomPixel[2] + Write-Host $LowerHalfBlock -ForegroundColor $fgColor -NoNewline + } else { + Write-Host ' ' -NoNewline + } } + Write-Host '' + } + + Write-Host '' +} else { + for ($y = $startY; $y -lt $endY; $y += 2) { + $line = "" + for ($x = 0; $x -lt $width; $x++) { + $topY = $y + $bottomY = $y + 1 - $width = 65 - $height = 12 - $pixels = @( - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(35, 188, 238, 255), - @(35, 188, 238, 255), - @(35, 188, 238, 255), - @(35, 188, 238, 255), - @(35, 188, 238, 255), - @(35, 188, 238, 255), - @(35, 188, 238, 255), - @(35, 188, 238, 255), - @(35, 188, 238, 255), - @(35, 188, 238, 255), - @(35, 188, 238, 255), - @(35, 188, 238, 255), - @(35, 188, 238, 255), - @(35, 188, 238, 255), - @(35, 188, 238, 255), - @(35, 188, 238, 255), - @(35, 188, 238, 255), - @(35, 188, 238, 255), - @(30, 30, 30, 255), - @(255, 255, 255, 255), - @(255, 255, 255, 255), - @(255, 255, 255, 255), - @(255, 255, 255, 255), - @(255, 255, 255, 255), - @(255, 255, 255, 255), - @(30, 30, 30, 255), - @(255, 255, 255, 255), - @(255, 255, 255, 255), - @(255, 255, 255, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(255, 255, 255, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(35, 188, 238, 255), - @(35, 188, 238, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(35, 188, 238, 255), - @(35, 188, 238, 255), - @(35, 188, 238, 255), - @(35, 188, 238, 255), - @(35, 188, 238, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(35, 188, 238, 255), - @(35, 188, 238, 255), - @(35, 188, 238, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(255, 255, 255, 255), - @(255, 255, 255, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(255, 255, 255, 255), - @(255, 255, 255, 255), - @(30, 30, 30, 255), - @(255, 255, 255, 255), - @(255, 255, 255, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(255, 255, 255, 255), - @(255, 255, 255, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(35, 188, 238, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(35, 188, 238, 255), - @(35, 188, 238, 255), - @(35, 188, 238, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(35, 188, 238, 255), - @(35, 188, 238, 255), - @(35, 188, 238, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(35, 188, 238, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(35, 188, 238, 255), - @(35, 188, 238, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(255, 255, 255, 255), - @(255, 255, 255, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(255, 255, 255, 255), - @(255, 255, 255, 255), - @(30, 30, 30, 255), - @(255, 255, 255, 255), - @(255, 255, 255, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(255, 255, 255, 255), - @(255, 255, 255, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(35, 188, 238, 255), - @(35, 188, 238, 255), - @(35, 188, 238, 255), - @(35, 188, 238, 255), - @(35, 188, 238, 255), - @(35, 188, 238, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(35, 188, 238, 255), - @(35, 188, 238, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(35, 188, 238, 255), - @(35, 188, 238, 255), - @(35, 188, 238, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(35, 188, 238, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(255, 255, 255, 255), - @(255, 255, 255, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(255, 255, 255, 255), - @(255, 255, 255, 255), - @(30, 30, 30, 255), - @(255, 255, 255, 255), - @(255, 255, 255, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(255, 255, 255, 255), - @(255, 255, 255, 255), - @(255, 255, 255, 255), - @(255, 255, 255, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(255, 255, 255, 255), - @(255, 255, 255, 255), - @(255, 255, 255, 255), - @(255, 255, 255, 255), - @(255, 255, 255, 255), - @(30, 30, 30, 255), - @(255, 255, 255, 255), - @(255, 255, 255, 255), - @(255, 255, 255, 255), - @(255, 255, 255, 255), - @(255, 255, 255, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(255, 255, 255, 255), - @(255, 255, 255, 255), - @(255, 255, 255, 255), - @(255, 255, 255, 255), - @(255, 255, 255, 255), - @(30, 30, 30, 255), - @(255, 255, 255, 255), - @(255, 255, 255, 255), - @(30, 30, 30, 255), - @(255, 255, 255, 255), - @(255, 255, 255, 255), - @(255, 255, 255, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(35, 188, 238, 255), - @(35, 188, 238, 255), - @(35, 188, 238, 255), - @(35, 188, 238, 255), - @(35, 188, 238, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(35, 188, 238, 255), - @(35, 188, 238, 255), - @(35, 188, 238, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(35, 188, 238, 255), - @(35, 188, 238, 255), - @(35, 188, 238, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(35, 188, 238, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(255, 255, 255, 255), - @(255, 255, 255, 255), - @(255, 255, 255, 255), - @(255, 255, 255, 255), - @(255, 255, 255, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(255, 255, 255, 255), - @(255, 255, 255, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(255, 255, 255, 255), - @(255, 255, 255, 255), - @(30, 30, 30, 255), - @(255, 255, 255, 255), - @(255, 255, 255, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(255, 255, 255, 255), - @(255, 255, 255, 255), - @(30, 30, 30, 255), - @(255, 255, 255, 255), - @(255, 255, 255, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(255, 255, 255, 255), - @(255, 255, 255, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(255, 255, 255, 255), - @(255, 255, 255, 255), - @(30, 30, 30, 255), - @(255, 255, 255, 255), - @(255, 255, 255, 255), - @(255, 255, 255, 255), - @(30, 30, 30, 255), - @(255, 255, 255, 255), - @(255, 255, 255, 255), - @(30, 30, 30, 255), - @(35, 188, 238, 255), - @(35, 188, 238, 255), - @(35, 188, 238, 255), - @(35, 188, 238, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(35, 188, 238, 255), - @(35, 188, 238, 255), - @(35, 188, 238, 255), - @(35, 188, 238, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(35, 188, 238, 255), - @(30, 30, 30, 255), - @(35, 188, 238, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(35, 188, 238, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(255, 255, 255, 255), - @(255, 255, 255, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(255, 255, 255, 255), - @(255, 255, 255, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(255, 255, 255, 255), - @(255, 255, 255, 255), - @(255, 255, 255, 255), - @(255, 255, 255, 255), - @(255, 255, 255, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(255, 255, 255, 255), - @(255, 255, 255, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(255, 255, 255, 255), - @(255, 255, 255, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(255, 255, 255, 255), - @(255, 255, 255, 255), - @(255, 255, 255, 255), - @(255, 255, 255, 255), - @(255, 255, 255, 255), - @(255, 255, 255, 255), - @(255, 255, 255, 255), - @(30, 30, 30, 255), - @(255, 255, 255, 255), - @(255, 255, 255, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(255, 255, 255, 255), - @(255, 255, 255, 255), - @(30, 30, 30, 255), - @(35, 188, 238, 255), - @(35, 188, 238, 255), - @(35, 188, 238, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(35, 188, 238, 255), - @(35, 188, 238, 255), - @(35, 188, 238, 255), - @(35, 188, 238, 255), - @(35, 188, 238, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(35, 188, 238, 255), - @(30, 30, 30, 255), - @(35, 188, 238, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(35, 188, 238, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(255, 255, 255, 255), - @(255, 255, 255, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(255, 255, 255, 255), - @(255, 255, 255, 255), - @(30, 30, 30, 255), - @(255, 255, 255, 255), - @(255, 255, 255, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(255, 255, 255, 255), - @(255, 255, 255, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(255, 255, 255, 255), - @(255, 255, 255, 255), - @(255, 255, 255, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(255, 255, 255, 255), - @(255, 255, 255, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(255, 255, 255, 255), - @(255, 255, 255, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(255, 255, 255, 255), - @(255, 255, 255, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(35, 188, 238, 255), - @(35, 188, 238, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(35, 188, 238, 255), - @(35, 188, 238, 255), - @(35, 188, 238, 255), - @(35, 188, 238, 255), - @(35, 188, 238, 255), - @(35, 188, 238, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(35, 188, 238, 255), - @(35, 188, 238, 255), - @(35, 188, 238, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(35, 188, 238, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(255, 255, 255, 255), - @(255, 255, 255, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(255, 255, 255, 255), - @(255, 255, 255, 255), - @(30, 30, 30, 255), - @(255, 255, 255, 255), - @(255, 255, 255, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(255, 255, 255, 255), - @(255, 255, 255, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(255, 255, 255, 255), - @(255, 255, 255, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(255, 255, 255, 255), - @(255, 255, 255, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(255, 255, 255, 255), - @(255, 255, 255, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(255, 255, 255, 255), - @(255, 255, 255, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(35, 188, 238, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(35, 188, 238, 255), - @(35, 188, 238, 255), - @(35, 188, 238, 255), - @(35, 188, 238, 255), - @(35, 188, 238, 255), - @(35, 188, 238, 255), - @(35, 188, 238, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(35, 188, 238, 255), - @(35, 188, 238, 255), - @(35, 188, 238, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(35, 188, 238, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(255, 255, 255, 255), - @(255, 255, 255, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(255, 255, 255, 255), - @(255, 255, 255, 255), - @(30, 30, 30, 255), - @(255, 255, 255, 255), - @(255, 255, 255, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(255, 255, 255, 255), - @(255, 255, 255, 255), - @(30, 30, 30, 255), - @(255, 255, 255, 255), - @(255, 255, 255, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(255, 255, 255, 255), - @(255, 255, 255, 255), - @(30, 30, 30, 255), - @(255, 255, 255, 255), - @(255, 255, 255, 255), - @(30, 30, 30, 255), - @(255, 255, 255, 255), - @(255, 255, 255, 255), - @(255, 255, 255, 255), - @(255, 255, 255, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(255, 255, 255, 255), - @(255, 255, 255, 255), - @(30, 30, 30, 255), - @(255, 255, 255, 255), - @(255, 255, 255, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(35, 188, 238, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(35, 188, 238, 255), - @(35, 188, 238, 255), - @(35, 188, 238, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(35, 188, 238, 255), - @(35, 188, 238, 255), - @(35, 188, 238, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(35, 188, 238, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(35, 188, 238, 255), - @(35, 188, 238, 255), - @(30, 30, 30, 255), - @(255, 255, 255, 255), - @(255, 255, 255, 255), - @(255, 255, 255, 255), - @(255, 255, 255, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(255, 255, 255, 255), - @(255, 255, 255, 255), - @(255, 255, 255, 255), - @(255, 255, 255, 255), - @(30, 30, 30, 255), - @(255, 255, 255, 255), - @(255, 255, 255, 255), - @(255, 255, 255, 255), - @(255, 255, 255, 255), - @(30, 30, 30, 255), - @(255, 255, 255, 255), - @(30, 30, 30, 255), - @(255, 255, 255, 255), - @(255, 255, 255, 255), - @(255, 255, 255, 255), - @(255, 255, 255, 255), - @(255, 255, 255, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(255, 255, 255, 255), - @(255, 255, 255, 255), - @(255, 255, 255, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(255, 255, 255, 255), - @(255, 255, 255, 255), - @(255, 255, 255, 255), - @(255, 255, 255, 255), - @(255, 255, 255, 255), - @(30, 30, 30, 255), - @(255, 255, 255, 255), - @(255, 255, 255, 255), - @(255, 255, 255, 255), - @(255, 255, 255, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(35, 188, 238, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(35, 188, 238, 255), - @(30, 30, 30, 255), - @(35, 188, 238, 255), - @(35, 188, 238, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(35, 188, 238, 255), - @(35, 188, 238, 255), - @(35, 188, 238, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(30, 30, 30, 255), - @(35, 188, 238, 255), - @(35, 188, 238, 255), - @(35, 188, 238, 255), - @(35, 188, 238, 255), - @(35, 188, 238, 255), - @(35, 188, 238, 255), - @(35, 188, 238, 255), - @(35, 188, 238, 255), - @(35, 188, 238, 255), - @(35, 188, 238, 255), - @(35, 188, 238, 255), - @(35, 188, 238, 255), - @(35, 188, 238, 255), - @(35, 188, 238, 255), - @(35, 188, 238, 255), - @(35, 188, 238, 255), - @(35, 188, 238, 255), - @(35, 188, 238, 255) - ) + if ($topY -lt 0) { + $topPixel = $null + } else { + $topIdx = ($topY * $width) + $x + $topPixel = if ($topIdx -lt $pixels.Count) { $pixels[$topIdx] } else { @(0, 0, 0, 0) } + } + + $bottomIdx = ($bottomY * $width) + $x + $bottomPixel = if ($bottomIdx -lt $pixels.Count) { $pixels[$bottomIdx] } else { @(0, 0, 0, 0) } - $oddHeight = ($height % 2) -eq 1 - $startY = if ($oddHeight) { -1 } else { 0 } - $endY = if ($oddHeight) { $height - 1 } else { $height } + $topTransparent = ($null -eq $topPixel) -or ($topPixel[3] -lt 32) + $bottomTransparent = $bottomPixel[3] -lt 32 - for ($y = $startY; $y -lt $endY; $y += 2) { - $line = '' - for ($x = 0; $x -lt $width; $x++) { - $topY = $y - $bottomY = $y + 1 - - if ($topY -lt 0) { - $topPixel = $null - } else { - $topIdx = ($topY * $width) + $x - $topPixel = if ($topIdx -lt $pixels.Count) { $pixels[$topIdx] } else { @(0, 0, 0, 0) } - } - - $bottomIdx = ($bottomY * $width) + $x - $bottomPixel = if ($bottomIdx -lt $pixels.Count) { $pixels[$bottomIdx] } else { @(0, 0, 0, 0) } - - $botR = if ($bottomPixel[3] -lt 32) { 0 } else { $bottomPixel[0] } - $botG = if ($bottomPixel[3] -lt 32) { 0 } else { $bottomPixel[1] } - $botB = if ($bottomPixel[3] -lt 32) { 0 } else { $bottomPixel[2] } - - if ($null -eq $topPixel) { - $fg = Get-TrueColorFg -R $botR -G $botG -B $botB - $line += "${fg}$LowerHalfBlock" - } else { - $topR = if ($topPixel[3] -lt 32) { 0 } else { $topPixel[0] } - $topG = if ($topPixel[3] -lt 32) { 0 } else { $topPixel[1] } - $topB = if ($topPixel[3] -lt 32) { 0 } else { $topPixel[2] } - - $bg = Get-TrueColorBg -R $topR -G $topG -B $topB - $fg = Get-TrueColorFg -R $botR -G $botG -B $botB - $line += "${bg}${fg}$LowerHalfBlock" - } + if (-not $topTransparent -and -not $bottomTransparent) { + $bg = Get-TrueColorBg -R $topPixel[0] -G $topPixel[1] -B $topPixel[2] + $fg = Get-TrueColorFg -R $bottomPixel[0] -G $bottomPixel[1] -B $bottomPixel[2] + $line += "${bg}${fg}$LowerHalfBlock" + } elseif (-not $topTransparent -and $bottomTransparent) { + $fg = Get-TrueColorFg -R $topPixel[0] -G $topPixel[1] -B $topPixel[2] + $line += "$ESC[0m${fg}$UpperHalfBlock" + } elseif ($topTransparent -and -not $bottomTransparent) { + $fg = Get-TrueColorFg -R $bottomPixel[0] -G $bottomPixel[1] -B $bottomPixel[2] + $line += "$ESC[0m${fg}$LowerHalfBlock" + } else { + $line += "$ESC[0m " } - $line += "$ESC[0m$ESC[K" - Write-Host $line } + $line += "$ESC[0m$ESC[K" + Write-Host $line } + + Write-Host "" } \ No newline at end of file