Skip to content

Commit 743907e

Browse files
fix: Export-4BitCss fixes ( Fixes #121, Fixes #122 )
Fixing purple problems and adding palettename
1 parent 1e0b926 commit 743907e

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

Commands/Export-4BitCSS.ps1

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,8 @@ function Export-4BitCSS
294294

295295
$jsonObject['Luma'] = $Background | GetLuma
296296
$jsonObject['Contrast'] = [Math]::Abs(($foreground | GetLuma) - $jsonObject['Luma'])
297+
$jsonObject['PaletteName'] = $Name
298+
$jsonObject['PaletteFileName'] = "$($name | Convert-4BitName)"
297299
$jsonObject = [PSCustomObject]$jsonObject
298300

299301
# and determine if it is bright or dark.
@@ -332,8 +334,10 @@ function Export-4BitCSS
332334
--IsDark: $((-not $IsBright) -as [int]);
333335
}
334336
335-
.colorSchemeName::before, .ColorSchemeName::before { content: '$($name)'; }
337+
.colorSchemeName::before, .ColorSchemeName::before { content: '$($name )'; }
338+
.paletteName::before, .paletteName::before { content: '$($name)'; }
336339
.colorSchemeFileName::before, .ColorSchemeFileName::before { content: '$($name | Convert-4BitName).css'; }
340+
.paletteFileName::before, .paletteFileName::before { content: '$($name | Convert-4BitName).css'; }
337341
338342
"@
339343

@@ -414,7 +418,7 @@ if (-not $NoBackgroundColor) {
414418
.green-background, .GreenBackground, .ANSI2-Background, .ansi2-background { background-color: var(--green) }
415419
.yellow-background, .YellowBackground, .ANSI3-Background, .ansi3-background { background-color: var(--yellow) }
416420
.blue-background, .BlueBackground, .ANSI4-Background, .ansi4-background { background-color: var(--blue) }
417-
.magenta-background, .MagentaBackground, .ANSI5-Background, .ansi5-background { background-color: var(--purple) }
421+
.magenta-background, .MagentaBackground, .purple-background, .PurpleBackground, .ANSI5-Background, .ansi5-background { background-color: var(--purple) }
418422
.cyan-background, .CyanBackground, .ANSI6-Background, .ansi6-background { background-color: var(--cyan) }
419423
.white-background, .WhiteBackground, .ANSI7-Background, .ansi7-background { background-color: var(--white) }
420424
.brightblack-background, .bright-black-background, .BrightBlackBackground, .ANSI8-Background, .ansi8-background { background-color: var(--brightBlack) }
@@ -446,7 +450,7 @@ if (-not $NoFill) {
446450
.brightyellow-fill , .bright-yellow-fill , .BrightYellowFill , .ANSI11-Fill, .ansi11-fill { fill: var(--brightYellow) }
447451
.brightblue-fill , .bright-blue-fill , .BrightBlueFill , .ANSI12-Fill, .ansi12-fill { fill: var(--brightBlue) }
448452
.brightmagneta-fill , .bright-magneta-fill , .BrightMagnetaFill , .ANSI13-Fill, .ansi13-fill { fill: var(--brightPurple) }
449-
.brightpurple-fill , .bright-purple-fill, .BrightPurpleFill { fill: var(--brightPuple) }
453+
.brightpurple-fill , .bright-purple-fill, .BrightPurpleFill { fill: var(--brightPurple) }
450454
.brightcyan-fill , .bright-cyan-fill , .BrightCyanFill , .ANSI14-Fill, .ansi14-fill { fill: var(--brightCyan) }
451455
.brightwhite-fill , .bright-white-fill , .BrightWhiteFill , .ANSI15-Fill, .ansi15-fill { fill: var(--brightWhite) }
452456
"@

0 commit comments

Comments
 (0)