Skip to content

Commit

Permalink
Merge pull request #41 from TonyApuzzo/feature/support-psreadline-2.0.0
Browse files Browse the repository at this point in the history
Support PSReadline 2.0.0 in Set-Solarized*ColorDefaults.ps1
  • Loading branch information
neilpa authored Jan 8, 2019
2 parents 55de1c7 + 1220dce commit d15fd8c
Show file tree
Hide file tree
Showing 2 changed files with 90 additions and 56 deletions.
73 changes: 45 additions & 28 deletions Set-SolarizedDarkColorDefaults.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -16,33 +16,50 @@ $Host.PrivateData.ProgressBackgroundColor = 'Cyan'
if (Get-Module -ListAvailable -Name "PSReadline") {
$options = Get-PSReadlineOption

# 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'
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'
# 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'
}
}
73 changes: 45 additions & 28 deletions Set-SolarizedLightColorDefaults.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -16,33 +16,50 @@ $Host.PrivateData.ProgressBackgroundColor = 'Cyan'
if (Get-Module -ListAvailable -Name "PSReadline") {
$options = Get-PSReadlineOption

# Foreground
$options.CommandForegroundColor = 'Yellow'
$options.ContinuationPromptForegroundColor = 'DarkYellow'
$options.DefaultTokenForegroundColor = 'DarkYellow'
$options.EmphasisForegroundColor = 'Cyan'
$options.ErrorForegroundColor = 'Red'
$options.KeywordForegroundColor = 'Green'
$options.MemberForegroundColor = 'DarkGreen'
$options.NumberForegroundColor = 'DarkGreen'
$options.OperatorForegroundColor = 'DarkCyan'
$options.ParameterForegroundColor = 'DarkCyan'
$options.StringForegroundColor = 'Blue'
$options.TypeForegroundColor = 'DarkBlue'
$options.VariableForegroundColor = 'Green'
if ([System.Version](Get-Module PSReadline).Version -lt [System.Version]"2.0.0") {
# Foreground
$options.CommandForegroundColor = 'Yellow'
$options.ContinuationPromptForegroundColor = 'DarkYellow'
$options.DefaultTokenForegroundColor = 'DarkYellow'
$options.EmphasisForegroundColor = 'Cyan'
$options.ErrorForegroundColor = 'Red'
$options.KeywordForegroundColor = 'Green'
$options.MemberForegroundColor = 'DarkGreen'
$options.NumberForegroundColor = 'DarkGreen'
$options.OperatorForegroundColor = 'DarkCyan'
$options.ParameterForegroundColor = 'DarkCyan'
$options.StringForegroundColor = 'Blue'
$options.TypeForegroundColor = 'DarkBlue'
$options.VariableForegroundColor = 'Green'

# Background
$options.CommandBackgroundColor = 'White'
$options.ContinuationPromptBackgroundColor = 'White'
$options.DefaultTokenBackgroundColor = 'White'
$options.EmphasisBackgroundColor = 'White'
$options.ErrorBackgroundColor = 'White'
$options.KeywordBackgroundColor = 'White'
$options.MemberBackgroundColor = 'White'
$options.NumberBackgroundColor = 'White'
$options.OperatorBackgroundColor = 'White'
$options.ParameterBackgroundColor = 'White'
$options.StringBackgroundColor = 'White'
$options.TypeBackgroundColor = 'White'
$options.VariableBackgroundColor = 'White'
# Background
$options.CommandBackgroundColor = 'White'
$options.ContinuationPromptBackgroundColor = 'White'
$options.DefaultTokenBackgroundColor = 'White'
$options.EmphasisBackgroundColor = 'White'
$options.ErrorBackgroundColor = 'White'
$options.KeywordBackgroundColor = 'White'
$options.MemberBackgroundColor = 'White'
$options.NumberBackgroundColor = 'White'
$options.OperatorBackgroundColor = 'White'
$options.ParameterBackgroundColor = 'White'
$options.StringBackgroundColor = 'White'
$options.TypeBackgroundColor = 'White'
$options.VariableBackgroundColor = 'White'
} else {
# New version of PSReadline renames Foreground colors and eliminates Background
$options.CommandColor = 'Yellow'
$options.ContinuationPromptColor = 'DarkYellow'
$options.DefaultTokenColor = 'DarkYellow'
$options.EmphasisColor = 'Cyan'
$options.ErrorColor = 'Red'
$options.KeywordColor = 'Green'
$options.MemberColor = 'DarkGreen'
$options.NumberColor = 'DarkGreen'
$options.OperatorColor = 'DarkCyan'
$options.ParameterColor = 'DarkCyan'
$options.StringColor = 'Blue'
$options.TypeColor = 'DarkBlue'
$options.VariableColor = 'Green'
}
}

0 comments on commit d15fd8c

Please sign in to comment.