PSWriteColorEX
1.2.0
Colored and styled console output for PowerShell: TrueColor (24-bit RGB), ANSI 256 and 16 colors, gradients, markup, highlighting, links, text styles, style profiles, padding and wrapping that count wide characters, and logging to a file. Pure PowerShell, for Windows PowerShell 5.1 and PowerShell 7 on Windows, Linux and macOS.
Minimum PowerShell version
5.1
Installation Options
Owners
Copyright
(c) 2026 Mark Newton
Package Details
Author(s)
- Mark Newton
Tags
Console Color Colour ANSI Terminal Output Formatting Logging TrueColor RGB CrossPlatform Windows Linux macOS
Functions
Write-ColorEX Write-ColorError Write-ColorWarning Write-ColorInfo Write-ColorSuccess Write-ColorCritical Write-ColorDebug Set-ColorDefault Get-ColorProfiles New-ColorStyle Test-AnsiSupport Convert-HexToRGB Convert-RGBToANSI8 Convert-RGBToANSI4 Get-ColorTableWithRGB Measure-DisplayWidth Get-LighterRGBColor Get-LighterColorName Get-LighterANSI8Color Format-ColorEX Show-ColorTable Register-ColorName Unregister-ColorName Export-ColorProfile Import-ColorProfile Remove-ColorProfile
PSEditions
Dependencies
This module has no dependencies.
Release Notes
1.2.0
Added:
- Write-ColorEX -Markup: tags that color and style part of a string, such as '[bold red]Error:[/] file not found'.
- -Split, -SplitAround and -SplitEvenly color parts of a string without giving it in pieces.
- -Highlight colors and styles the text regular expressions match.
- -Link writes links that terminals open when clicked.
- -Reverse, -UnderlineStyle (single, double, curly, dotted, dashed) and -UnderlineColor.
- -BackGroundGradient, and -GradientSpace OKLab or RGB.
- -Truncate, -PadCenter and -Wrap.
- Colors in the forms #RGB, rgb(r, g, b) and hsl(h, s%, l%).
- Format-ColorEX answers colored text as strings; Show-ColorTable shows every color name.
- Register-ColorName and Unregister-ColorName; Export-ColorProfile, Import-ColorProfile and Remove-ColorProfile.
- Tab completion of color and profile names.
- Detection of Ghostty, WezTerm, Warp, Kitty, Alacritty, foot, JetBrains IDEs and tmux; CLICOLOR_FORCE and CLICOLOR.
Changed:
- Gradients blend in OKLab; -GradientSpace RGB gives the 1.1.0 colors.
- An unknown color name gives a warning and no color.
- -Gradient writes -BackGroundColor under the gradient.
- Write-ColorEX takes 38% to 60% less time per call than 1.1.0.
- FORCE_COLOR and CLICOLOR_FORCE write a line of color names as escape codes in every host, so the colors reach a CI log.
Fixed:
- -Color and -BackGroundColor take $null entries.
- Set-ColorDefault with no parameters makes the default style plain Gray.
- With -ANSI8 or -ANSI4, a hex, rgb() or hsl() color is written as the nearest color of that mode.
- PowerShell 7 in the Windows console host lightens -Bold colors, as Windows PowerShell 5.1 does there.
The full list is in CHANGELOG.md: https://github.com/MarkusMcNugen/PSWriteColorEX/blob/main/CHANGELOG.md
FileList
- PSWriteColorEX.nuspec
- PSWriteColorEX.psm1
- Classes\ColorCode.ps1
- Classes\PSColorStyle.ps1
- Examples\02-ANSI4Examples.ps1
- Examples\04-ANSI24Examples.ps1
- Private\ColorHost.ps1
- Private\DisplayWidthTable.ps1
- Private\New-GradientColorArray.ps1
- Public\ColorNames.ps1
- Public\Convert-ColorValue.ps1
- Public\Measure-DisplayWidth.ps1
- Public\Write-ColorEX.ps1
- Tests\Analyze-Coverage.ps1
- Tests\StartupColorEnvironment.ps1
- Tests\Tests-ColorCommands.ps1
- Tests\Tests-MeasureDisplayWidth.ps1
- Tests\Tests-PSColorStyle.ps1
- Tests\Tests-WriteColorEX.ps1
- Tests\Tests-WriteColorEXAutoPad.ps1
- Tests\Tests-WriteColorEXFeatures.ps1
- Tests\Tests-WriteColorEXOutput.ps1
- Tests\Tests-WriteColorHelpers.ps1
- CHANGELOG.md
- PSWriteColorEX.psd1
- README.md
- Classes\ColorMath.ps1
- Examples\01-BasicUsage.ps1
- Examples\03-ANSI8Examples.ps1
- Private\ArgumentCompleters.ps1
- Private\ColorNames.ps1
- Private\Get-ColorHelperParams.ps1
- Private\WriteColorCore.ps1
- Public\ColorProfiles.ps1
- Public\Format-ColorEX.ps1
- Public\Test-AnsiSupport.ps1
- Public\Write-ColorHelpers.ps1
- Tests\README.md
- Tests\Tests-All.ps1
- Tests\Tests-ConvertColorValue.ps1
- Tests\Tests-NewGradientColorArray.ps1
- Tests\Tests-TestAnsiSupport.ps1
- LICENSE
Version History
| Version | Downloads | Last updated |
|---|---|---|
| 1.2.0 (current version) | 5 | 10/9/2026 |
| 1.1.0 | 9 | 10/6/2026 |