-
Notifications
You must be signed in to change notification settings - Fork 176
/
Set-SolarizedDarkColorDefaults.ps1
65 lines (61 loc) · 2.49 KB
/
Set-SolarizedDarkColorDefaults.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# Host Foreground
$Host.PrivateData.ErrorForegroundColor = 'Red'
$Host.PrivateData.WarningForegroundColor = 'Yellow'
$Host.PrivateData.DebugForegroundColor = 'Green'
$Host.PrivateData.VerboseForegroundColor = 'Blue'
$Host.PrivateData.ProgressForegroundColor = 'Gray'
# Host Background
$Host.PrivateData.ErrorBackgroundColor = 'DarkGray'
$Host.PrivateData.WarningBackgroundColor = 'DarkGray'
$Host.PrivateData.DebugBackgroundColor = 'DarkGray'
$Host.PrivateData.VerboseBackgroundColor = 'DarkGray'
$Host.PrivateData.ProgressBackgroundColor = 'Cyan'
# Check for PSReadline
if (Get-Module -ListAvailable -Name "PSReadline") {
$options = Get-PSReadlineOption
if ([System.Version](Get-Module PSReadline).Version -lt [System.Version]"2.0.0") {
# Foreground
$options.CommandForegroundColor = 'Yellow'
$options.ContinuationPromptForegroundColor = 'DarkBlue'
$options.DefaultTokenForegroundColor = 'DarkBlue'
$options.EmphasisForegroundColor = 'Cyan'
$options.ErrorForegroundColor = 'Red'
$options.KeywordForegroundColor = 'Green'
$options.MemberForegroundColor = 'DarkCyan'
$options.NumberForegroundColor = 'DarkCyan'
$options.OperatorForegroundColor = 'DarkGreen'
$options.ParameterForegroundColor = 'DarkGreen'
$options.StringForegroundColor = 'Blue'
$options.TypeForegroundColor = 'DarkYellow'
$options.VariableForegroundColor = 'Green'
# Background
$options.CommandBackgroundColor = 'Black'
$options.ContinuationPromptBackgroundColor = 'Black'
$options.DefaultTokenBackgroundColor = 'Black'
$options.EmphasisBackgroundColor = 'Black'
$options.ErrorBackgroundColor = 'Black'
$options.KeywordBackgroundColor = 'Black'
$options.MemberBackgroundColor = 'Black'
$options.NumberBackgroundColor = 'Black'
$options.OperatorBackgroundColor = 'Black'
$options.ParameterBackgroundColor = 'Black'
$options.StringBackgroundColor = 'Black'
$options.TypeBackgroundColor = 'Black'
$options.VariableBackgroundColor = 'Black'
} else {
# New version of PSReadline renames Foreground colors and eliminates Background
$options.CommandColor = 'Yellow'
$options.ContinuationPromptColor = 'DarkBlue'
$options.DefaultTokenColor = 'DarkBlue'
$options.EmphasisColor = 'Cyan'
$options.ErrorColor = 'Red'
$options.KeywordColor = 'Green'
$options.MemberColor = 'DarkCyan'
$options.NumberColor = 'DarkCyan'
$options.OperatorColor = 'DarkGreen'
$options.ParameterColor = 'DarkGreen'
$options.StringColor = 'Blue'
$options.TypeColor = 'DarkYellow'
$options.VariableColor = 'Green'
}
}