Skip to content

Commit 29d6120

Browse files
Merge pull request #27 from 2bitdesigns/4bitcss-updates
4bitcss 0.1.3
2 parents d17c942 + b95bd8d commit 29d6120

File tree

1,259 files changed

+8761
-6582
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,259 files changed

+8761
-6582
lines changed

.github/FUNDING.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
github: [StartAutomating]

4bitcss.build.ps1

Lines changed: 47 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ if ($env:GITHUB_WORKSPACE) {
66

77
# and get all of the JSON files from it
88
$jsonFiles = Get-ChildItem -Path iTerm2-Color-Schemes -Recurse -Filter *.json |
9-
Where-Object Fullname -like '*terminal*' |
10-
Select-Object -Skip 2
9+
Where-Object Fullname -like '*terminal*' |
10+
Where-Object FullName -notlike '*templates*'
1111
} else {
1212
# Otherwise get them locally
1313
$jsonFiles = Get-ChildItem $home\documents\git\iTerm2-Color-Schemes -Recurse -Filter *.json |
14-
Where-Object Fullname -like '*terminal*' |
15-
Select-Object -Skip 2
14+
Where-Object Fullname -like '*terminal*' |
15+
Where-Object FullName -notlike '*templates*'
1616
}
1717

1818

@@ -31,6 +31,10 @@ $previewSvg = (Get-ChildItem -Path docs -Filter 4bitpreviewtemplate.svg | Get
3131

3232
$docsPath = Join-Path $PSScriptRoot docs
3333

34+
$allColorSchemes = @()
35+
$brightColorSchemes = @()
36+
$darkColorSchemes = @()
37+
3438
# Walk thru each json file of a color scheme
3539
foreach ($jsonFile in $jsonFiles) {
3640
# convert the contents from JSON
@@ -42,10 +46,25 @@ foreach ($jsonFile in $jsonFiles) {
4246
if (-not $jsonObject.Name) { continue }
4347
# If it wasn't legal, continue.
4448
if ($jsonObject.Name -match '^\{') { continue }
49+
$cssPath = (Join-Path $PSScriptRoot css)
4550
# Export the theme to /css (so that repo-based CDNs have a logical link)
46-
$jsonObject | Export-4BitCSS -OutputPath (Join-Path $PSScriptRoot css)
51+
$jsonObject | Export-4BitCSS -OutputPath $cssPath -OutVariable colorSchemeCssFile
4752
# Then export it again to /docs (so the GitHub page works)
4853
$jsonObject | Export-4BitCSS -OutputPath $docsPath
54+
55+
$allColorSchemes += $colorSchemeName
56+
57+
$wasBright = $colorSchemeCssFile | Select-String "IsBright: 1"
58+
if ($wasBright) {
59+
$brightColorSchemes += $colorSchemeName
60+
}
61+
$wasDark = $colorSchemeCssFile | Select-String "IsDark: 1"
62+
if ($wasDark) {
63+
$darkColorSchemes += $colorSchemeName
64+
}
65+
66+
67+
4968

5069
# Create a preview file. All we need to change is the stylesheet.
5170
$previewFilePath = Join-Path $docsPath "$colorSchemeFileName.md"
@@ -71,5 +90,26 @@ $transpiledText
7190
Set-Content -Path $previewSvgPath
7291

7392
# output the file so that PipeScript will check it in.
74-
Get-Item -Path $previewSvgPath
75-
}
93+
Get-Item -Path $previewSvgPath
94+
}
95+
96+
$allSchemesPath = Join-Path $docsPath "allColorSchemes.json"
97+
$allColorSchemes |
98+
ConvertTo-Json |
99+
Set-Content -Path $allSchemesPath
100+
101+
Get-Item -Path $allSchemesPath
102+
103+
$allBrightSchemesPath = Join-Path $docsPath "allBrightColorSchemes.json"
104+
$brightColorSchemes |
105+
ConvertTo-Json |
106+
Set-Content -Path $allBrightSchemesPath
107+
108+
Get-Item -Path $allBrightSchemesPath
109+
110+
$allDarkSchemesPath = Join-Path $docsPath "allDarkColorSchemes.json"
111+
$darkColorSchemes |
112+
ConvertTo-Json |
113+
Set-Content -Path $allDarkSchemesPath
114+
115+
Get-Item -Path $allSchemesPath

4bitcss.psd1

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,24 @@
11
@{
2-
ModuleVersion = '0.1.2'
2+
ModuleVersion = '0.1.3'
33
RootModule = '4bitcss.psm1'
44
Description = 'CSS3 Color Schemes'
55
Guid = '93e1d6ab-ce88-4751-bb14-b21fbb9f66f3'
66
CompanyName = 'Start-Automating'
77
Author = 'James Brundage'
8-
Copyright = '2022 Start-Automating'
8+
Copyright = '2022-2023 Start-Automating'
99
PrivateData = @{
1010
PSData = @{
1111
ProjectURI = 'https://github.com/2bitdesigns'
1212
LicenseURI = 'https://github.com/2bitdesigns/4bitcss/blob/main/LICENSE'
1313
ReleaseNotes = @'
14+
## 0.1.3:
15+
16+
* Renaming Theme to ColorScheme (#24)
17+
* Adding IsBright/IsDark to color scheme (#25)
18+
* Exporting Color Scheme Names (#26)
19+
20+
---
21+
1422
## 0.1.2:
1523
1624
Updating the Site:

4bitcss.psm1

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
1-
foreach ($file in (Get-ChildItem -Path "$PSScriptRoot" -Filter "*-*.ps1" -Recurse)) {
1+
:ToIncludeFiles foreach ($file in (Get-ChildItem -Path "$PSScriptRoot" -Filter "*-*.ps1" -Recurse)) {
22
if ($file.Extension -ne '.ps1') { continue } # Skip if the extension is not .ps1
3-
if ($file.Name -match '\.[^\.]+\.ps1$') { continue } # Skip if the file is an unrelated file.
3+
foreach ($exclusion in '\.[^\.]+\.ps1$') {
4+
if (-not $exclusion) { continue }
5+
if ($file.Name -match $exclusion) {
6+
continue ToIncludeFiles # Skip excluded files
7+
}
8+
}
49
. $file.FullName
510
}

Assets/4bitcss.svg

Lines changed: 1 addition & 0 deletions
Loading

Assets/[email protected]

14.9 KB
Loading

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
## 0.1.3:
2+
3+
* Renaming Theme to ColorScheme (#24)
4+
* Adding IsBright/IsDark to color scheme (#25)
5+
* Exporting Color Scheme Names (#26)
6+
7+
---
8+
19
## 0.1.2:
210

311
Updating the Site:

Export-4BitCSS.ps1

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,20 +227,30 @@ function Export-4BitCSS
227227
$NoElement = $true
228228
$NoStroke = $true
229229
}
230+
231+
$rgb = ($Background -replace "#", "0x" -replace ';') -as [UInt32]
232+
$r, $g, $b = ([float][byte](($rgb -band 0xff0000) -shr 16)/255),
233+
([float][byte](($rgb -band 0x00ff00) -shr 8)/255),
234+
([float][byte]($rgb -band 0x0000ff)/255)
235+
236+
$Luma = 0.2126 * $R + 0.7152 * $G + 0.0722 * $B
237+
$IsBright = $luma -gt .5
230238

231239
$cssFile = (Join-Path $OutputPath "$($name -replace '\s').css")
232240
$className = $Name -replace '\s' -replace '^\d', '_$0'
233241
$cssContent = @(
234242
@"
235243
:root {
236-
$(@(
244+
$(@(
237245
foreach ($prop in $jsonObject.psobject.properties) {
238246
if ($prop.Name -eq 'Name') {
239247
"--$($prop.Name): '$($prop.Value)'"
240248
} else {
241249
"--$($prop.Name): $($prop.Value)"
242250
}
243-
}) -join (';' + [Environment]::NewLine + ' '))
251+
}) -join (';' + [Environment]::NewLine + ' '));
252+
--IsBright: $($IsBright -as [int]);
253+
--IsDark: $((-not $IsBright) -as [int]);
244254
}
245255
246256
.colorSchemeName::before, .ColorSchemeName::before { content: '$($name)'; }

css/3024Day.css

Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
:root {
2+
--selectionBackground: #a5a2a2;
3+
--cursorColor: #4a4543;
4+
--foreground: #4a4543;
5+
--background: #f7f7f7;
6+
--brightWhite: #f7f7f7;
7+
--brightCyan: #cdab53;
8+
--brightPurple: #d6d5d4;
9+
--brightBlue: #807d7c;
10+
--brightYellow: #4a4543;
11+
--brightGreen: #3a3432;
12+
--brightRed: #e8bbd0;
13+
--brightBlack: #5c5855;
14+
--white: #a5a2a2;
15+
--cyan: #b5e4f4;
16+
--purple: #a16a94;
17+
--blue: #01a0e4;
18+
--yellow: #fded02;
19+
--green: #01a252;
20+
--red: #db2d20;
21+
--black: #090300;
22+
--name: '3024 Day';
23+
--IsBright: 1;
24+
--IsDark: 0;
25+
}
26+
27+
.colorSchemeName::before, .ColorSchemeName::before { content: '3024 Day'; }
28+
.colorSchemeFileName::before, .ColorSchemeFileName::before { content: '3024Day.css'; }
29+
30+
.foreground, .Foreground { color: var(--foreground); }
31+
.background, .Background { background-color: var(--background); }
32+
33+
.foreground-border , .Foreground-Border { border-color: var(--foreground) }
34+
.foreground-fill , .Foreground-Fill { fill: var(--foreground) }
35+
.foreground-stroke , .Foreground-Stroke { stroke: var(--foreground) }
36+
37+
.background-border , .Background-Border { border-color: var(--background) }
38+
.background-fill , .Background-Fill { fill: var(--background) }
39+
.background-stroke , .Background-Stroke { stroke: var(--background) }
40+
.output , .Output { color: var(--foreground) }
41+
.success , .Success { color: var(--brightGreen) }
42+
.failure , .Failure { color: var(--red) }
43+
.error , .Error { color: var(--brightRed) }
44+
.warning , .Warning { color: var(--brightYellow) }
45+
.debug , .Debug { color: var(--yellow) }
46+
.verbose , .Verbose { color: var(--brightCyan) }
47+
.progress , .Progress { color: var(--cyan) }
48+
.link , .Link { color: var(--cyan) }
49+
50+
.error-border , .Error-Border { border-color: var(--brightRed) }
51+
.error-fill , .Error-Fill { fill: var(--brightRed) }
52+
.error-stroke , .Error-Stroke { stroke: var(--brightRed) }
53+
54+
.success-border , .Success-Border { border-color: var(--brightGreen) }
55+
.success-fill , .Sucesss-Fill { fill: var(--brightGreen) }
56+
.sucesss-stroke , .Success-Stroke { stroke: var(--brightGreen) }
57+
58+
.warning-border , .Warning-Border { border-color: var(--brightYellow) }
59+
.warning-fill , .Warning-Fill { fill: var(--brightYellow) }
60+
.warning-stroke , .Warning-Stroke { stroke: var(--brightYellow) }
61+
.black , .Black , .ANSI0 { color: var(--black) }
62+
.red , .Red , .ANSI1 { color: var(--red) }
63+
.green , .Green , .ANSI2 { color: var(--green) }
64+
.yellow , .Yellow , .ANSI3 { color: var(--yellow) }
65+
.blue , .Blue , .ANSI4 { color: var(--blue) }
66+
.magenta , .Magenta , .ANSI5 { color: var(--purple) }
67+
.cyan , .Cyan , .ANSI6 { color: var(--cyan) }
68+
.white , .White , .ANSI7 { color: var(--white) }
69+
70+
.brightblack , .bright-black , .BrightBlack , .ANSI8 { color: var(--brightBlack) }
71+
.brightred , .bright-red , .BrightRed , .ANSI9 { color: var(--brightRed) }
72+
.brightgreen , .bright-green , .BrightGreen , .ANSI10 { color: var(--brightGreen) }
73+
.brightyellow , .bright-yellow , .BrightYellow , .ANSI11 { color: var(--brightYellow) }
74+
.brightblue , .bright-blue , .BrightBlue , .ANSI12 { color: var(--brightBlue) }
75+
.brightmagenta , .bright-magenta , .BrightMagenta , .ANSI13 { color: var(--brightPurple) }
76+
.brightcyan , .bright-cyan , .BrightCyan , .ANSI14 { color: var(--brightCyan) }
77+
.brightwhite , .bright-white , .BrightWhite , .ANSI15 { color: var(--brightWhite) }
78+
79+
.purple , .Purple { color: var(--purple) }
80+
81+
.brightpurple , .bright-purple , .BrightPurple { color: var(--brightPurple) }
82+
.black-fill , .BlackFill , .ANSI0-Fill, .ansi0-fill { fill: var(--black) }
83+
.red-fill , .RedFill , .ANSI1-Fill, .ansi1-fill { fill: var(--red) }
84+
.green-fill , .GreenFill , .ANSI2-Fill, .ansi2-fill { fill: var(--green) }
85+
.yellow-fill , .YellowFill , .ANSI3-Fill, .ansi3-fill { fill: var(--yellow) }
86+
.blue-fill , .BlueFill , .ANSI4-Fill, .ansi4-fill { fill: var(--blue) }
87+
.magenta-fill , .MagentaFill , .ANSI5-Fill, .ansi5-fill { fill: var(--purple) }
88+
.purple-fill, .PurpleFill { fill: var(--purple) }
89+
.cyan-fill , .CyanFill , .ANSI6-Fill, .ansi6-fill { fill: var(--cyan) }
90+
.white-fill , .WhiteFill , .ANSI7-Fill, .ansi7-fill { fill: var(--white) }
91+
.brightblack-fill , .bright-black-fill , .BrightBlackFill , .ANSI8-Fill, .ansi8-fill { fill: var(--brightBlack) }
92+
.brightred-fill , .bright-red-fill , .BrightRedFill , .ANSI9-Fill, .ansi9-fill { fill: var(--brightRed) }
93+
.brightgreen-fill , .bright-green-fill , .BrightGreenFill , .ANSI10-Fill, .ansi10-fill { fill: var(--brightGreen) }
94+
.brightyellow-fill , .bright-yellow-fill , .BrightYellowFill , .ANSI11-Fill, .ansi11-fill { fill: var(--brightYellow) }
95+
.brightblue-fill , .bright-blue-fill , .BrightBlueFill , .ANSI12-Fill, .ansi12-fill { fill: var(--brightBlue) }
96+
.brightmagneta-fill , .bright-magneta-fill , .BrightMagnetaFill , .ANSI13-Fill, .ansi13-fill { fill: var(--brightPurple) }
97+
.brightpurple-fill , .bright-purple-fill, .BrightPurpleFill { fill: var(--brightPuple) }
98+
.brightcyan-fill , .bright-cyan-fill , .BrightCyanFill , .ANSI14-Fill, .ansi14-fill { fill: var(--brightCyan) }
99+
.brightwhite-fill , .bright-white-fill , .BrightWhiteFill , .ANSI15-Fill, .ansi15-fill { fill: var(--brightWhite) }
100+
.black-stroke , .BlackStroke , .ANSI0-Stroke, .ansi0-stroke { stroke: var(--black) }
101+
.red-stroke , .RedStroke , .ANSI1-Stroke, .ansi1-stroke { stroke: var(--red) }
102+
.green-stroke , .GreenStroke , .ANSI2-Stroke, .ansi2-stroke { stroke: var(--green) }
103+
.yellow-stroke , .YellowStroke , .ANSI3-Stroke, .ansi3-stroke { stroke: var(--yellow) }
104+
.blue-stroke , .BlueStroke , .ANSI4-Stroke, .ansi4-stroke { stroke: var(--blue) }
105+
.magenta-stroke , .MagentaStroke , .ANSI5-Stroke, .ansi5-stroke { stroke: var(--purple) }
106+
.purple-stroke, .PurpleStroke { fill: var(--purple) }
107+
.cyan-stroke , .CyanStroke , .ANSI6-Stroke, .ansi6-stroke { stroke: var(--cyan) }
108+
.white-stroke , .WhiteStroke , .ANSI7-Stroke, .ansi7-stroke { stroke: var(--white) }
109+
.brightblack-stroke , .bright-black-stroke , .BrightBlackFill , .ANSI8-Fill, .ansi8-fill { stroke: var(--brightBlack) }
110+
.brightred-stroke , .bright-red-stroke , .BrightRedFill , .ANSI9-Fill, .ansi9-fill { stroke: var(--brightRed) }
111+
.brightgreen-stroke , .bright-green-stroke , .BrightGreenFill , .ANSI10-Fill, .ansi10-fill { stroke: var(--brightGreen) }
112+
.brightyellow-stroke , .bright-yellow-stroke , .BrightYellowFill , .ANSI11-Fill, .ansi11-fill { stroke: var(--brightYellow) }
113+
.brightblue-stroke , .bright-blue-stroke , .BrightBlueFill , .ANSI12-Fill, .ansi12-fill { stroke: var(--brightBlue) }
114+
.brightmagneta-stroke , .bright-magneta-stroke , .BrightMagnetaFill , .ANSI13-Fill, .ansi13-fill { stroke: var(--brightPuple) }
115+
.brightpurple-stroke , .bright-purple-stroke, .BrightPurpleStroke { fill: var(--brightPuple) }
116+
.brightcyan-stroke , .bright-cyan-stroke , .BrightCyanFill , .ANSI14-Fill, .ansi14-fill { stroke: var(--brightCyan) }
117+
.brightwhite-stroke , .bright-white-stroke , .BrightWhiteFill , .ANSI15-Fill, .ansi15-fill { stroke: var(--brightWhite) }
118+
119+
body {
120+
color: var(--foreground);
121+
background-color: var(--background);
122+
}
123+
124+
a, a:visited, a:hover { color: var(--cyan); }
125+
126+
::selection, ::-moz-selection {
127+
color: var(--cursorColor);
128+
background-color: var(--selectionBackground);
129+
}
130+
131+
form input[type="text"], form input[type="checkbox"], input[type="button"], textarea, select, option {
132+
color: var(--foreground);
133+
background-color: var(--background);
134+
}
135+
136+
form input[type="text"], textarea, select {
137+
border : 1px solid var(--foreground);
138+
outline: 1px solid var(--foreground);
139+
}
140+
141+
hr {
142+
color: var(--foreground)
143+
}

0 commit comments

Comments
 (0)