Skip to content

Commit

Permalink
Clamp BlendHCL output - #46
Browse files Browse the repository at this point in the history
  • Loading branch information
makew0rld committed Jan 27, 2021
1 parent 4380d76 commit d49a4a4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ but only releases after v1.0.3 properly adhere to it.
### Fixed
- RGB to/from XYZ conversion is more accurate
- A bug in `XYZToLuvWhiteRef` that only applied to very small values was fixed
- `BlendHCL` output is clamped so that it's not invalid (#46)


## [1.0.3] - 2019-11-11
Expand Down
2 changes: 1 addition & 1 deletion colors.go
Original file line number Diff line number Diff line change
Expand Up @@ -905,7 +905,7 @@ func (col1 Color) BlendHcl(col2 Color, t float64) Color {
h2, c2, l2 := col2.Hcl()

// We know that h are both in [0..360]
return Hcl(interp_angle(h1, h2, t), c1+t*(c2-c1), l1+t*(l2-l1))
return Hcl(interp_angle(h1, h2, t), c1+t*(c2-c1), l1+t*(l2-l1)).Clamped()
}

// LuvLch
Expand Down

0 comments on commit d49a4a4

Please sign in to comment.