Skip to content

Commit

Permalink
Deep blues were getting purple. Possibly due to rounding errors since…
Browse files Browse the repository at this point in the history
… clamping values that are expected to be between 0 and 1 fixes it.

Fixing #16.
  • Loading branch information
michelf committed Jun 17, 2020
1 parent c8603cd commit d6b62e9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Filter/SimDaltonismFilter.m
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,9 @@ void main()
// now shift *all* three proportional to the greatest shift...
s_rgb = s_rgb + ( adjust * d_rgb );

// fix issue where blues were getting purple
s_rgb = clamp(s_rgb, 0., 1.);

// anomalize
s_rgb = mix(c_rgb, s_rgb, anomalize);

Expand Down

0 comments on commit d6b62e9

Please sign in to comment.