Skip to content

Commit d6b62e9

Browse files
committed
Deep blues were getting purple. Possibly due to rounding errors since clamping values that are expected to be between 0 and 1 fixes it.
Fixing #16.
1 parent c8603cd commit d6b62e9

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

Filter/SimDaltonismFilter.m

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,9 @@ void main()
229229
// now shift *all* three proportional to the greatest shift...
230230
s_rgb = s_rgb + ( adjust * d_rgb );
231231

232+
// fix issue where blues were getting purple
233+
s_rgb = clamp(s_rgb, 0., 1.);
234+
232235
// anomalize
233236
s_rgb = mix(c_rgb, s_rgb, anomalize);
234237

0 commit comments

Comments
 (0)