Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions PowerShell/Attributes.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@ function Do-It {

CUP 10 0 ; [console]::Write("Standard attributes:")
CUP 11 4 ; SGR 4 ; [console]::Write("Underline") ; SGR 24 ; [console]::Write(" - no underline") ; SGR 0
CUP 12 4 ; SGR 5 ; [console]::Write("Slow blink") ; SGR 25 ; [console]::Write(" - no slow blink") ; SGR 0
CUP 13 4 ; SGR 6 ; [console]::Write("Rapid blink") ; SGR 26 ; [console]::Write(" - no rapid blink") ; SGR 0
CUP 12 4 ; SGR 5 ; [console]::Write("Slow blink") ; SGR 25 ; [console]::Write(" - no blink") ; SGR 0
CUP 13 4 ; SGR 6 ; [console]::Write("Rapid blink") ; SGR 25 ; [console]::Write(" - no blink") ; SGR 0
CUP 14 4 ; SGR 7 ; [console]::Write("Inverse") ; SGR 27 ; [console]::Write(" - no inverse") ; SGR 0
CUP 15 4 ; SGR 8 ; [console]::Write("Invisible") ; SGR 28 ; [console]::Write(" - no invisible") ; SGR 0
CUP 16 4 ; SGR 9 ; [console]::Write("Strikethrough") ; SGR 29 ; [console]::Write(" - no strikethrough") ; SGR 0
Expand Down
16 changes: 8 additions & 8 deletions PowerShell/ColourMatrix.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ function Set-16Colour {
}
"V" {
$sgr = if ($isbg) {48} else {38}
$pn = if ($script:conformant) { ECMA48SubParams $sgr, 5, $index } else { ECMA48Params $sgr, 5, $index }
[console]::Write([string]::format("{0}{1}m", $CSI, $pn))
$param = if ($script:conformant) { $(ECMA48SubParams 5, $index) } else { $(ECMA48Params 5, $index) }
[console]::Write([string]::format("{0}{1}m", $CSI, $(ECMA48Params $sgr, $param)))
}
"T" {
$sgr = if ($isbg) {48} else {38}
Expand All @@ -75,8 +75,8 @@ function Set-16Colour {
$g = (($index -band 2) / 2) * $v
$b = (($index -band 4) / 4) * $v
}
$pn = if ($script:conformant) { ECMA48SubParams $sgr, 2, $null, $r, $g, $b } else { ECMA48Params $sgr, 2, $r, $g, $b }
[console]::Write([string]::format("{0}{1}m", $CSI, $pn))
$param = if ($script:conformant) { ECMA48SubParams 2, $null, $r, $g, $b } else { ECMA48Params 2, $r, $g, $b }
[console]::Write([string]::format("{0}{1}m", $CSI, $(ECMA48Params $sgr, $param)))
}
}
} else {
Expand Down Expand Up @@ -105,14 +105,14 @@ function Set-Greyscale {
}
"V" {
$sgr = if ($isbg) {48} else {38}
$pn = if ($script:conformant) { ECMA48SubParams $sgr, 5, $($index + 232) } else { ECMA48Params $sgr, 5, $($index + 232) }
[console]::Write([string]::format("{0}{1}m", $CSI, $pn))
$param = if ($script:conformant) { ECMA48SubParams 5, $($index + 232) } else { ECMA48Params 5, $($index + 232) }
[console]::Write([string]::format("{0}{1}m", $CSI, $(ECMA48Params $sgr, $param)))
}
"T" {
$index = 8 + $index * 10
$sgr = if ($isbg) {48} else {38}
$pn = if ($script:conformant) { ECMA48SubParams $sgr, 2, $null, $index, $index, $index } else { ECMA48Params $sgr, 2, $index, $index, $index }
[console]::Write([string]::format("{0}{1}m", $CSI, $pn))
$param = if ($script:conformant) { ECMA48SubParams 2, $null, $index, $index, $index } else { ECMA48Params 2, $index, $index, $index }
[console]::Write([string]::format("{0}{1}m", $CSI, $(ECMA48Params $sgr, $param)))
}
}
} else {
Expand Down