Skip to content

Commit

Permalink
Add detection for all trivial cases
Browse files Browse the repository at this point in the history
Detects all trivial cases (like -360,0,360) instead of just 0.
  • Loading branch information
struffel committed Dec 18, 2020
1 parent 3956733 commit a6f4d64
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion adjust.go
Expand Up @@ -89,7 +89,7 @@ func AdjustSaturation(img image.Image, percentage float64) *image.NRGBA {
// dstImage = imaging.AdjustHue(srcImage, -30) // Shift Hue by -30°.
//
func AdjustHue(img image.Image, shift float64) *image.NRGBA {
if shift == 0 {
if math.Mod(shift, 360) == 0 {
return Clone(img)
}

Expand Down

0 comments on commit a6f4d64

Please sign in to comment.