@flare-engine/render 0.4.0 → 0.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -788,6 +788,8 @@ function flashIntensity(effect) {
788
788
  const G = globalThis;
789
789
  const BLEND_SRC_OVER = 3;
790
790
  const BLEND_SRC_IN = 5;
791
+ /** Skia BlendMode.SrcATop — r = s·da + d·(1−sa): keeps the art's alpha, lerps colour by the filter's alpha. */
792
+ const BLEND_SRC_ATOP = 9;
791
793
  /** Skia BlendMode.Plus — additive: dst = clamp(src + dst). */
792
794
  const BLEND_PLUS = 12;
793
795
  const OUTLINE_OFFSETS = [
@@ -975,13 +977,13 @@ function createFrameRenderer(Skia) {
975
977
  function applyTint(effect) {
976
978
  if (tintPaint === null) tintPaint = Skia.Paint();
977
979
  writeColor(tintColor, effect.color, effect.amount);
978
- tintPaint.setColorFilter(Skia.ColorFilter.MakeBlend(tintColor, BLEND_SRC_OVER));
980
+ tintPaint.setColorFilter(Skia.ColorFilter.MakeBlend(tintColor, BLEND_SRC_ATOP));
979
981
  return tintPaint;
980
982
  }
981
983
  function applyFlash(effect) {
982
984
  if (flashPaint === null) flashPaint = Skia.Paint();
983
985
  writeColor(flashColor, effect.color, flashIntensity(effect));
984
- flashPaint.setColorFilter(Skia.ColorFilter.MakeBlend(flashColor, BLEND_SRC_OVER));
986
+ flashPaint.setColorFilter(Skia.ColorFilter.MakeBlend(flashColor, BLEND_SRC_ATOP));
985
987
  return flashPaint;
986
988
  }
987
989
  function applyGrayscale(effect) {