public void AdjustPalette(IReadOnlyDictionary <string, MutablePalette> palettes) { if (remainingFrames == 0) { return; } var frac = (float)remainingFrames / NukeEffectLength; foreach (var pal in palettes) { for (var x = 0; x < Palette.Size; x++) { var orig = pal.Value.GetColor(x); var final = GUtil.PremultipliedColorLerp(frac, orig, GUtil.PremultiplyAlpha(Color.FromArgb(orig.A, Color.White))); pal.Value.SetColor(x, final); } } }
public void AdjustPalette(IReadOnlyDictionary <string, MutablePalette> palettes) { if (remainingFrames == 0) { return; } var frac = (float)remainingFrames / Info.Length; foreach (var pal in palettes) { for (var x = 0; x < Palette.Size; x++) { var orig = pal.Value.GetColor(x); var c = Info.Color; var color = Color.FromArgb(orig.A, ((int)c.R).Clamp(0, 255), ((int)c.G).Clamp(0, 255), ((int)c.B).Clamp(0, 255)); var final = GUtil.PremultipliedColorLerp(frac, orig, GUtil.PremultiplyAlpha(Color.FromArgb(orig.A, color))); pal.Value.SetColor(x, final); } } }
public void AdjustPalette(IReadOnlyDictionary <string, MutablePalette> palettes) { if (remainingFrames == 0) { return; } foreach (var pal in palettes) { if (info.ExcludePalette.Contains(pal.Key)) { continue; } for (var x = 0; x < Palette.Size; x++) { var orig = pal.Value.GetColor(x); var c = Info.Color; var color = Color.FromArgb(orig.A, ((int)c.R).Clamp(0, 255), ((int)c.G).Clamp(0, 255), ((int)c.B).Clamp(0, 255)); var final = GUtil.PremultipliedColorLerp(info.Ratio, orig, GUtil.PremultiplyAlpha(Color.FromArgb(orig.A, color))); pal.Value.SetColor(x, final); } } }