Skip to content

Commit

Permalink
fix: 4bitcss credit object format ( Fixes #79 )
Browse files Browse the repository at this point in the history
Also not passing thru modified objects
  • Loading branch information
James Brundage committed Oct 23, 2024
1 parent ce8e88f commit 38a4adf
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions Build/4bitcss.build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -75,17 +75,19 @@ foreach ($jsonFile in $jsonFiles) {
$colorSchemeFileName =
$jsonObject.Name | Convert-4BitName

$creditInfo = @($colorSchemeName | GetCredits)[0]
$jsonObject |
Add-Member NoteProperty credits -Force -PassThru -Value @($colorSchemeName | GetCredits)
Add-Member NoteProperty creditTo -Force -PassThru -Value $creditInfo.credit |
Add-Member NoteProperty creditToLink -Force -Value $creditInfo.link

if ($jsonObject.background) {
$jsonObject |
Add-Member NoteProperty luma -Force -PassThru -Value $($jsonObject.Background | GetLuma)
Add-Member NoteProperty luma -Force -Value $($jsonObject.Background | GetLuma)
}

if ($jsonObject.foreground -and $jsonObject.background) {
$jsonObject |
Add-Member NoteProperty contrast -Force -PassThru -Value $(
Add-Member NoteProperty contrast -Force -Value $(
[Math]::Abs(
($jsonObject.background | GetLuma) - ($jsonObject.foreground | GetLuma)
)
Expand Down

0 comments on commit 38a4adf

Please sign in to comment.