public static PremultipliedColorLerp ( float t, Color c1, Color c2 ) : Color | ||
t | float | |
c1 | Color | |
c2 | Color | |
Résultat | Color |
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); } } }