Skip to content

Commit

Permalink
pdColorVariants: fix bad hue calculation near potential hue maximum
Browse files Browse the repository at this point in the history
  • Loading branch information
tannerhelland committed Nov 24, 2020
1 parent 03f9678 commit faea0ec
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Controls/pdColorVariants.ctl
Expand Up @@ -661,9 +661,9 @@ Private Sub CalculateVariantColors()

If (i = CV_HueUp) Then
hNew = hNew + hChange
If (hNew > 1#) Then hNew = 1# - hNew
If (hNew > 1#) Then hNew = hNew - 1#
Colors.HSVtoRGB hNew, sNew, vNew, rNew, gNew, bNew

ElseIf (i = CV_SaturationUp) Then

'Use a fake saturation calculation
Expand Down Expand Up @@ -711,7 +711,7 @@ Private Sub CalculateVariantColors()

ElseIf (i = CV_HueDown) Then
hNew = hNew - hChange
If (hNew < 0#) Then hNew = 1 + hNew
If (hNew < 0#) Then hNew = 1# + hNew
Colors.HSVtoRGB hNew, sNew, vNew, rNew, gNew, bNew

ElseIf (i = CV_BlueDown) Then
Expand Down

0 comments on commit faea0ec

Please sign in to comment.