Skip to content

Commit 399577c

Browse files
Merge pull request #41 from guptohkl/fix/normal-blend-alpha
Fix Normal() not factoring in opacity
2 parents 7facef9 + 9c91ef3 commit 399577c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

source/AsepriteDotNet/Aseprite/AsepriteColorUtilities.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ private static Rgba32 Normal(Rgba32 backdrop, Rgba32 source, int opacity)
245245

246246
opacity = Calc.MultiplyUnsigned8Bit(source.A, opacity);
247247

248-
int a = source.A + backdrop.A - Calc.MultiplyUnsigned8Bit(backdrop.A, source.A);
248+
int a = backdrop.A + opacity - Calc.MultiplyUnsigned8Bit(backdrop.A, opacity);
249249
int r = backdrop.R + (source.R - backdrop.R) * opacity / a;
250250
int g = backdrop.G + (source.G - backdrop.G) * opacity / a;
251251
int b = backdrop.B + (source.B - backdrop.B) * opacity / a;

0 commit comments

Comments
 (0)