forked from neilpa/cmd-colors-solarized
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Update-Link.ps1
76 lines (70 loc) · 2.22 KB
/
Update-Link.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
66
67
68
69
70
71
72
73
74
75
76
param(
[Parameter(Mandatory=$true)]
[ValidateScript({Test-Path $_})]
[string]$Path,
[Parameter()]
[ValidateSet('Hard','Medium','Soft')]
[string]$Contrast = 'Medium',
[Parameter()]
[ValidateSet('Light','Dark')]
[string]$Palette = 'Dark'
)
$lnk = & ("$PSScriptRoot\Get-Link.ps1") $Path
# Set Light/Dark Palette and Contrast-Specific Colors
if ($Palette -eq "Dark") {
if ($Contrast -eq "Hard") {
$lnk.ConsoleColors[0] ="#1d2021"
} elseif ($Contrast -eq "Soft") {
$lnk.ConsoleColors[0] ="#32302f"
} else {
$lnk.ConsoleColors[0] ="#282828"
}
$lnk.ConsoleColors[1] ="#458588"
$lnk.ConsoleColors[2] ="#98971a"
$lnk.ConsoleColors[3] ="#689d6a"
$lnk.ConsoleColors[4] ="#cc241d"
$lnk.ConsoleColors[5] ="#b16286"
$lnk.ConsoleColors[6] ="#d79921"
$lnk.ConsoleColors[7] ="#a89984"
$lnk.ConsoleColors[8] ="#928374"
$lnk.ConsoleColors[9] ="#83a598"
$lnk.ConsoleColors[10]="#b8bb26"
$lnk.ConsoleColors[11]="#8ec07c"
$lnk.ConsoleColors[12]="#fb4934"
$lnk.ConsoleColors[13]="#d3869b"
$lnk.ConsoleColors[14]="#fabd2f"
$lnk.ConsoleColors[15]="#ebdbb2"
$lnk.PopUpBackgroundColor=0xf
$lnk.PopUpTextColor=0x0
$lnk.ScreenBackgroundColor=0x0
$lnk.ScreenTextColor=0xf
} else {
if ($Contrast -eq "Hard") {
$lnk.ConsoleColors[0] ="#f9f5d7"
} elseif ($Contrast -eq "Soft") {
$lnk.ConsoleColors[0] ="#f2e5bc"
} else {
$lnk.ConsoleColors[0] ="#fbf1c7"
}
$lnk.ConsoleColors[1] ="#458588"
$lnk.ConsoleColors[2] ="#98971a"
$lnk.ConsoleColors[3] ="#689d6a"
$lnk.ConsoleColors[4] ="#cc241d"
$lnk.ConsoleColors[5] ="#b16286"
$lnk.ConsoleColors[6] ="#d79921"
$lnk.ConsoleColors[7] ="#7c6f64"
$lnk.ConsoleColors[8] ="#928374"
$lnk.ConsoleColors[9] ="#076678"
$lnk.ConsoleColors[10]="#79740e"
$lnk.ConsoleColors[11]="#427b58"
$lnk.ConsoleColors[12]="#9d0006"
$lnk.ConsoleColors[13]="#8f3f71"
$lnk.ConsoleColors[14]="#b57614"
$lnk.ConsoleColors[15]="#3c3836"
$lnk.PopUpBackgroundColor=0xf
$lnk.PopUpTextColor=0x0
$lnk.ScreenBackgroundColor=0x0
$lnk.ScreenTextColor=0xf
}
$lnk.Save()
Write-Host "Updated $Path to $Contrast $Palette Gruvbox"