You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are some blending operations which have intermediate color values exceeding their maximum or minimum values and are clamped to their maximum or minimum. A suggestion is to postpone the clamping until the values are asked for using the to-string methods and others.
A piece of code shows that operations can result in wrong values
my Color $b .= new('#08f');
my Color $c .= new('#8f0");
my Color $r1 = ($b + $c)/2; # '#447F7F'
my Color $r2 = $b/2 + $c/2; # '#44C37F'
The value of $r2 is the correct one but it needs more operations to get it right. There might be operations which are not that easy to circumvent and always deliver a wrong result.
Regards,
Marcel
The text was updated successfully, but these errors were encountered:
This modification seems a bit touchy without really rebuilding the API of this distro - the assumption seems to be everywhere that whatever a Color object holds at any moment is valid for RGB(A). I think this can be faked by writing accessor methods for all the data a Color object holds - meaning, any access to data in a Color object would settle the values.
What I don't know yet is if this breaks down on too many premature data accesses - that would basically mean that Color objects still finalize immediately, except in a more obfuscated way.
There are some blending operations which have intermediate color values exceeding their maximum or minimum values and are clamped to their maximum or minimum. A suggestion is to postpone the clamping until the values are asked for using the to-string methods and others.
A piece of code shows that operations can result in wrong values
The value of $r2 is the correct one but it needs more operations to get it right. There might be operations which are not that easy to circumvent and always deliver a wrong result.
Regards,
Marcel
The text was updated successfully, but these errors were encountered: