Skip to content
This repository has been archived by the owner on Oct 21, 2021. It is now read-only.

Update for VS2017 compatibility #33

Merged
merged 2 commits into from
Mar 9, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions vs2017/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
This Solarized theme for Visual Studio 11 can be regenerated using the PowerShell
script in the generator folder. To adjust any of the colors refer to the color
values in the script and the substitution values in the template file.

Enjoy!
85 changes: 85 additions & 0 deletions vs2017/generator/Generate-VsSettings.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
<#
.SYNOPSIS
Generate-VsSettings creates a .vssetting file using the Solarized
color pallette created by Ethan Schoonover.

.DESCRIPTION
The Solarized palette was designed by Ethan Schoonover for maximum readability
and contrast. The color choices were chosen based on the highlighting colors
listed in the canonical Vim implementation. For more information see
http://ethanschoonover.com/solarized

To customize the colors from the default, adjust the color values
in the script or in the accompanying SettingsTemplate.xml file. Please
note that .vssettings file use a different ordering for the ARGB color
sequence, so #002B36 (Based03) becomes 0x00362B00.

To generate the .vssettings file, you should pipe the output of the script
to out-file and specify UTF-8 encoding

.PARAMETER type
Specifies the light or dark version of the theme.

.EXAMPLE
Generate-VsSettings -type light | Out-File -Encoding utf8 -FilePath solarized-light.vssettings

.OUTPUTS
System.String - a string containing the .vssettings XML
#>

param ($type = "dark")

$solarizedColorsDark = @{
'$Background' = '0x00362B00'; # Base03
'$BgHighlight' = '0x00423607'; # Base02
'$SecondaryContent' = '0x00756E58'; # Base01
'$MiddleGray' = '0x00837B65'; # Base00
'$PrimaryContent' = '0x00969483'; # Base0
'$EmphasizedContent' = '0x00A1A193'; #Base1
'$Highlight1' = '0x00D5E8EE'; # Base2
'$Highlight2' = '0x00E3F6FD'; #Base 3
'$Yellow' = '0x000089B5';
'$Orange' = '0x00164BCB';
'$Red' = '0x002F32DC';
'$Magenta' = '0x008236D3';
'$Violet' = '0x00C4716C';
'$Blue' = '0x00D28B26';
'$Cyan' = '0x0098A12A';
'$Green' = '0x00079A71';
}

$solarizedColorsLight = @{
'$Background' = '0x00E3F6FD'; # Base3
'$BgHighlight' = '0x00D5E8EE'; # Base2
'$SecondaryContent' = '0x00A1A193'; # Base1
'$MiddleGray' = '0x00969483'; # Base0
'$PrimaryContent' = '0x00837B65'; # Base00
'$EmphasizedContent' = '0x00756E58'; # Base01
'$Highlight1' = '0x00423607'; # Base02
'$Highlight2' = '0x00362B00'; # Base03
'$Yellow' = '0x000089b5';
'$Orange' = '0x00164BCB';
'$Red' = '0x002F32DC';
'$Magenta' = '0x008236D3';
'$Violet' = '0x00C4716C';
'$Blue' = '0x00D28B26';
'$Cyan' = '0x0098A12A';
'$Green' = '0x00079A71';
}

if ($type -eq "dark") {
$hash = $solarizedColorsDark
} else {
$hash = $solarizedColorsLight
}

# -delimiter "nosuchthing" is a way to force PowerShell to load it all as one string
$content = get-content -delimiter "nosuchthing" SettingsTemplate.xml

$hash.Keys | % {
$content = $content.Replace($_, $hash[$_])
}

$content


Loading