Proposed fix for some math_color_blend functions

Authored by Maikon Araujo (Nokiam) on Nov 20 2017, 6:22 PM.



Hi guys,

This patch is a proposal to change some behavior of math_color_blend.h functions:

  • Changed the "limit" behavior for the condition (1-y)/2x in vivid light blend mode when x goes to zero and y goes to 1, the effect should go to 1/2;
  • Make the float version apply the effects for 100% alpha channel, preserving the same behavior as the byte function version.

If there is a reason for those, feel free to just ignore this patch. I took the liberty of suggesting the reviewers as well based on file history.

Best Regards,

Diff Detail

rB Blender

The vivid light limit case fix looks good.

The other parts seems reasonable too, leaving the fac != 0.0f as an optimization and not clamping any factors, even if it break backwards compatibility in some files.

I'll commit it later if no one objects.

This revision is now accepted and ready to land.Nov 23 2017, 6:25 PM
This revision was automatically updated to reflect the committed changes.

This only affected the paint code and new blend modes in the sequencer, so actually not a backwards compatibility concern at all.