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
The multiply blend mode in computer graphics should convert each part of RGBA to float ranging at [0,1], and multiply them. That means if one of the color is 0, then the outcome should be zero no matter what the another one is. However, when I multiply color 0 and color 0xFF000000 (by the way, the uint representation of color takes first byte as alpha, this is inconsistent with the convention). the outcome is not zero.
Code
Draw the following paint
var shader = SKShader.CreateCompose(SKShader.CreateColor(0), SKShader.CreateColor(new(0,0,0,255)), SKBlendMode.Multiply);
var paint = new SKPaint() { Shader = shader };
Expected Behavior
The paint should draw nothing, as the composed color is 0 after multiplication.
Actual Behavior
It draws zero RGB with 255 alpha.
Version of SkiaSharp
3.x (Alpha)
Last Known Good Version of SkiaSharp
Other (Please indicate in the description)
IDE / Editor
Visual Studio (Windows)
Platform / Operating System
Windows
Platform / Operating System Version
Windows 11 Home 23H2
Devices
Nitro AN515-58
Relevant Screenshots
No response
Relevant Log Output
No response
Code of Conduct
I agree to follow this project's Code of Conduct
The text was updated successfully, but these errors were encountered:
Description
The multiply blend mode in computer graphics should convert each part of RGBA to float ranging at [0,1], and multiply them. That means if one of the color is 0, then the outcome should be zero no matter what the another one is. However, when I multiply color 0 and color 0xFF000000 (by the way, the uint representation of color takes first byte as alpha, this is inconsistent with the convention). the outcome is not zero.
Code
Draw the following paint
Expected Behavior
The paint should draw nothing, as the composed color is 0 after multiplication.
Actual Behavior
It draws zero RGB with 255 alpha.
Version of SkiaSharp
3.x (Alpha)
Last Known Good Version of SkiaSharp
Other (Please indicate in the description)
IDE / Editor
Visual Studio (Windows)
Platform / Operating System
Windows
Platform / Operating System Version
Windows 11 Home 23H2
Devices
Nitro AN515-58
Relevant Screenshots
No response
Relevant Log Output
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: