11---
22description : >
33 This article shows how to configure PSReadLine color settings for a light themed terminal.
4- ms.date : 11/21 /2025
4+ ms.date : 12/09 /2025
55title : Configuring a light colored theme
66---
77# Configuring a light colored theme
@@ -11,6 +11,14 @@ terminal. However, some users might choose to use a light background with dark t
1111the default colors don't set the background, using light foreground colors on a light background
1212produces unreadable text.
1313
14+ Beginning in PowerShell 7.2, PowerShell adds colorized output to the default console experience. The
15+ ` $PSStyle ` feature is not natively available in Windows PowerShell. However, using the [ PSStyle] [ 05 ]
16+ module from the PowerShell Gallery, you can set color values using these same techniques described
17+ in this article.
18+
19+ The colors used are defined in the ` $PSStyle ` variable and are designed for a dark background. You
20+ can change these colors to work better for a light background terminal.
21+
1422** PSReadLine** allows you to define colors for 18 different syntax elements. You can view the
1523current settings using the ` Get-PSReadLineOption ` cmdlet.
1624
@@ -96,13 +104,9 @@ $ISETheme = @{
96104```
97105
98106> [ !NOTE]
99- > In PowerShell 7.2 and higher you can use the ` FromRGB() ` method of ` $PSStyle ` to create the ANSI
100- > escape sequences for the colors you want.
101- >
102- > For more information about ` $PSStyle ` , see [ about_ANSI_Terminals] [ 01 ] .
103- >
104- > For more information about ANSI escape sequences, see the [ ANSI escape code] [ 04 ] article in
105- > Wikipedia.
107+ > You can use the ` FromRGB() ` method to create the ANSI escape sequences for the colors you want.
108+ > For more information about ` $PSStyle ` , see [ about_ANSI_Terminals] [ 01 ] . For more information about
109+ > ANSI escape sequences, see the [ ANSI escape code] [ 04 ] article in Wikipedia.
106110
107111## Setting the color theme in your profile
108112
@@ -116,38 +120,36 @@ Add the `$ISETheme` variable and the following `Set-PSReadLineOption` command to
116120Set-PSReadLineOption -Colors $ISETheme
117121```
118122
119- Beginning in PowerShell 7.2, PowerShell adds colorized output to the default console experience. The
120- colors used are defined in the ` $PSStyle ` variable and are designed for a dark background. The
121- following settings work better for a light background terminal.
123+ The following settings work better for a light background terminal.
122124
123125``` powershell
124- $PSStyle.Formatting.FormatAccent = "`e[32m"
125- $PSStyle.Formatting.TableHeader = "`e[32m"
126- $PSStyle.Formatting.ErrorAccent = "`e[36m"
127- $PSStyle.Formatting.Error = "`e[31m"
128- $PSStyle.Formatting.Warning = "`e[33m"
129- $PSStyle.Formatting.Verbose = "`e[33m"
130- $PSStyle.Formatting.Debug = "`e[33m"
131- $PSStyle.Progress.Style = "`e[33m"
126+ $PSStyle.Formatting.FormatAccent = $PSStyle.Foreground.Green
127+ $PSStyle.Formatting.TableHeader = $PSStyle.Foreground.Green
128+ $PSStyle.Formatting.ErrorAccent = $PSStyle.Foreground.Cyan
129+ $PSStyle.Formatting.Error = $PSStyle.Foreground.Red
130+ $PSStyle.Formatting.Warning = $PSStyle.Foreground.Yellow
131+ $PSStyle.Formatting.Verbose = $PSStyle.Foreground.Yellow
132+ $PSStyle.Formatting.Debug = $PSStyle.Foreground.Yellow
133+ $PSStyle.Progress.Style = $PSStyle.Foreground.Yellow
132134$PSStyle.FileInfo.Directory = $PSStyle.Background.FromRgb(0x2f6aff) +
133135 $PSStyle.Foreground.BrightWhite
134- $PSStyle.FileInfo.SymbolicLink = "`e[36m"
135- $PSStyle.FileInfo.Executable = "`e[95m"
136- $PSStyle.FileInfo.Extension['.ps1'] = "`e[36m"
137- $PSStyle.FileInfo.Extension['.ps1xml'] = "`e[36m"
138- $PSStyle.FileInfo.Extension['.psd1'] = "`e[36m"
139- $PSStyle.FileInfo.Extension['.psm1'] = "`e[36m"
136+ $PSStyle.FileInfo.SymbolicLink = $PSStyle.Foreground.Cyan
137+ $PSStyle.FileInfo.Executable = $PSStyle.Foreground.BrightMagenta
138+ $PSStyle.FileInfo.Extension['.ps1'] = $PSStyle.Foreground.Cyan
139+ $PSStyle.FileInfo.Extension['.ps1xml'] = $PSStyle.Foreground.Cyan
140+ $PSStyle.FileInfo.Extension['.psd1'] = $PSStyle.Foreground.Cyan
141+ $PSStyle.FileInfo.Extension['.psm1'] = $PSStyle.Foreground.Cyan
140142```
141143
142144## Choosing colors for accessibility
143145
144146The ISE color theme might not work for users with color-blindness or other conditions that limit
145147their ability to see colors.
146148
147- The [ World Wide Web Consortium (W3C)] [ 05 ] has recommendations for using colors for accessibility.
149+ The [ World Wide Web Consortium (W3C)] [ 06 ] has recommendations for using colors for accessibility.
148150The Web Content Accessibility Guidelines (WCAG) 2.1 recommends that "visual presentation of text and
149151images of text has a contrast ratio of at least 4.5:1." For more information, see
150- [ Success Criterion 1.4.3 Contrast (Minimum)] [ 06 ] .
152+ [ Success Criterion 1.4.3 Contrast (Minimum)] [ 07 ] .
151153
152154The [ Contrast Ratio] [ 03 ] website provides a tool that lets you pick foreground and background
153155colors and measure the contrast. You can use this tool to find color combinations that work best for
158160[ 02 ] : creating-profiles.md
159161[ 03 ] : https://contrast-ratio.com/
160162[ 04 ] : https://en.wikipedia.org/wiki/ANSI_escape_code
161- [ 05 ] : https://www.w3.org/
162- [ 06 ] : https://www.w3.org/TR/WCAG/#contrast-minimum
163+ [ 05 ] : https://www.powershellgallery.com/packages/PSStyle
164+ [ 06 ] : https://www.w3.org/
165+ [ 07 ] : https://www.w3.org/TR/WCAG/#contrast-minimum
0 commit comments