PSWriteColorEX
1.2.1
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 Get-GradientColor Get-ColorContrast
PSEditions
Dependencies
This module has no dependencies.
Release Notes
1.2.1
Added:
- Twenty-one named gradients, such as Rainbow, Sunset, Ocean and Progress, for -Gradient and -BackGroundGradient.
- Gradient options: -GradientSpace LinearRGB, OKLCH, HSL, HSV, Lab and LCh, -GradientHue, -GradientEasing (31 curves), -GradientRepeat, -GradientDirection and -GradientSteps.
- Gradient colors placed with '@', as a percent: 'Gold@40'.
- Get-GradientColor returns a gradient's colors, for a number of characters or at several places.
- Get-ColorContrast returns the WCAG contrast ratio of a color on a background.
- -ColorSupport on Write-ColorEX and Format-ColorEX names the color support to write for.
- Test-AnsiSupport reports SupportsUnicode; WRITECOLOREX_UNICODE sets it.
- Import-ColorProfile -Theme: Catppuccin, Solarized, Gruvbox, Dracula, Nord, One Dark, Tokyo Night, PowerShell's own colors and the CSS color names.
- Show-ColorTable -Styles, -Palette and -Profiles.
- The about_PSWriteColorEX help topic, a cheat sheet by task.
Changed:
- In 256 colors, each color is written as the code that looks nearest to it, measured in OKLab.
- Each gradient stop falls on a character of its own, so every color given is drawn exactly.
- A text gradient leaves out white space, which shows no text color.
- -Style reads a list as the array it holds.
- Every command that returns objects declares their type.
- Test-AnsiSupport turns on escape codes in a console without compiling C#.
Fixed:
- A style value outside its parameter's set gives the parameter check's error and the text is written, inside a try or not.
- The Write-Color* helpers write a refused profile's error and go on.
- The module keeps working in a runspace after another runspace that imported it is disposed, in Windows PowerShell 5.1 and PowerShell 7.
- Runspaces that import the module at the same moment all finish in Windows PowerShell 5.1.
The full list is in CHANGELOG.md: https://github.com/MarkusMcNugen/PSWriteColorEX/blob/main/CHANGELOG.md
FileList
- PSWriteColorEX.nuspec
- CHANGELOG.md
- PSWriteColorEX.psd1
- THIRD-PARTY-NOTICES
- Classes\PSColorStyle.ps1
- Examples\02-ANSI4Examples.ps1
- Private\ArgumentCompleters.ps1
- Private\DisplayWidthTable.ps1
- Private\New-GradientColorArray.ps1
- Public\ColorProfiles.ps1
- Public\Get-GradientColor.ps1
- Public\Write-ColorEX.ps1
- Tests\README.md
- Tests\Tests-ColorCommands.ps1
- Tests\Tests-MeasureDisplayWidth.ps1
- Tests\Tests-PSColorStyle.ps1
- Tests\Tests-WriteColorEX.ps1
- Tests\Tests-WriteColorEXFeatures.ps1
- Tests\Tests-WriteColorHelpers.ps1
- Themes\CatppuccinLatte.json
- Themes\CatppuccinMocha.json
- Themes\Dracula.json
- Themes\GruvboxLight.json
- Themes\OneDark.json
- Themes\SolarizedLight.json
- LICENSE
- PSWriteColorEX.psm1
- Classes\ColorCode.ps1
- en-US\about_PSWriteColorEX.help.txt
- Examples\03-ANSI8Examples.ps1
- Private\ColorHost.ps1
- Private\Get-ColorHelperParams.ps1
- Private\WriteColorCore.ps1
- Public\Convert-ColorValue.ps1
- Public\Measure-DisplayWidth.ps1
- Public\Write-ColorHelpers.ps1
- Tests\StartupColorEnvironment.ps1
- Tests\Tests-ConvertColorValue.ps1
- Tests\Tests-NewGradientColorArray.ps1
- Tests\Tests-TestAnsiSupport.ps1
- Tests\Tests-WriteColorEXAutoPad.ps1
- Tests\Tests-WriteColorEXOutput.ps1
- Themes\CatppuccinFrappe.json
- Themes\CatppuccinMacchiato.json
- Themes\CSS.json
- Themes\GruvboxDark.json
- Themes\Nord.json
- Themes\SolarizedDark.json
- Themes\TokyoNight.json
- README.md
- Classes\ColorMath.ps1
- Examples\01-BasicUsage.ps1
- Examples\04-ANSI24Examples.ps1
- Private\ColorNames.ps1
- Private\GradientNames.ps1
- Public\ColorNames.ps1
- Public\Format-ColorEX.ps1
- Public\Test-AnsiSupport.ps1
- Tests\Analyze-Coverage.ps1
- Tests\Tests-All.ps1
Version History
| Version | Downloads | Last updated |
|---|---|---|
| 1.2.1 (current version) | 5 | 10/21/2026 |
| 1.2.0 | 20 | 10/9/2026 |
| 1.1.0 | 11 | 10/6/2026 |