From abc7b2cde2c9d33c020eb827d8a90f2ad36ed3ae Mon Sep 17 00:00:00 2001 From: routersys Date: Wed, 1 Jul 2026 13:07:27 +0900 Subject: [PATCH] =?UTF-8?q?=E5=90=88=E6=88=90=E3=83=A2=E3=83=BC=E3=83=89?= =?UTF-8?q?=E3=81=AE=E7=95=AA=E5=8F=B7=E3=81=A8YMM4=20Blend=E3=81=AE?= =?UTF-8?q?=E5=AF=BE=E5=BF=9C=E8=A1=A8=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LuaScript/Compat/BlendModeMap.cs | 53 ++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 LuaScript/Compat/BlendModeMap.cs diff --git a/LuaScript/Compat/BlendModeMap.cs b/LuaScript/Compat/BlendModeMap.cs new file mode 100644 index 0000000..25b6d7d --- /dev/null +++ b/LuaScript/Compat/BlendModeMap.cs @@ -0,0 +1,53 @@ +using YukkuriMovieMaker.Project; + +namespace LuaScript.Compat +{ + internal static class BlendModeMap + { + private static readonly Blend[] Order = + [ + Blend.Normal, + Blend.Dissolve, + Blend.Darker, + Blend.Multiply, + Blend.ColorBurn, + Blend.LinearBurn, + Blend.Lighter, + Blend.Screen, + Blend.ColorDodge, + Blend.LinearDodge, + Blend.Add, + Blend.Overlay, + Blend.SoftLight, + Blend.HardLight, + Blend.VividLight, + Blend.LinearLight, + Blend.PinLight, + Blend.HardMix, + Blend.Difference, + Blend.Exclusion, + Blend.Subtract, + Blend.Division, + Blend.Hue, + Blend.Saturation, + Blend.Color, + Blend.Luminosity, + Blend.LighterColor, + Blend.DestinationOver, + Blend.DarkerColor, + Blend.DestinationOut, + Blend.SourceAtop, + Blend.XOR, + Blend.MaskInvert, + ]; + + public static Blend Resolve(double value) + { + if (double.IsNaN(value)) + return Blend.Normal; + + int index = (int)value; + return (uint)index < (uint)Order.Length ? Order[index] : Blend.Normal; + } + } +}