Skip to content

Commit

Permalink
Making LightScript.Color return LightScript.Color (Fixes #54)
Browse files Browse the repository at this point in the history
  • Loading branch information
James Brundage committed Nov 1, 2022
1 parent ff01d5f commit f17ac89
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions Types/LightScript.Color/HSLToRGB.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ $green += $m


[PSCustomObject][Ordered]@{
PSTypeName = 'LightScript.Color'
Red = [Byte][Math]::Round($red * 255)
Green = [Byte][Math]::Round($green * 255)
Blue = [Byte][Math]::Round($blue * 255)
Expand Down
7 changes: 6 additions & 1 deletion Types/LightScript.Color/RGBToHSL.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,9 @@ if (-not $delta) {
$hue*=60
if ($hue -gt 360) { $hue -= 360 }
if ($hue -lt 0) { $hue = 360 + $hue }
[PSCustomObject][Ordered]@{Hue = $hue;Saturation = $saturation;Luminance = $Luminance}
[PSCustomObject][Ordered]@{
PSTypeName = 'LightScript.Color'
Hue = $hue
Saturation = $saturation
Luminance = $Luminance
}

0 comments on commit f17ac89

Please sign in to comment.