Merge branch 'master' into spriteicon-invalidation-fix

This commit is contained in:
Dean Herbert 2017-08-07 14:49:09 +09:00 committed by GitHub
commit 2ce30474ca
1 changed files with 10 additions and 5 deletions

View File

@ -20,14 +20,19 @@ public interface IHasAccentColour : IDrawable
public static class AccentedColourExtensions
{
/// <summary>
/// Tweens the accent colour of a drawable to another colour.
/// Smoothly adjusts <see cref="IHasAccentColour.AccentColour"/> over time.
/// </summary>
/// <param name="accentedDrawable">The drawable to apply the accent colour to.</param>
/// <param name="newColour">The new accent colour.</param>
/// <param name="duration">The tween duration.</param>
/// <param name="easing">The tween easing.</param>
/// <returns>A <see cref="TransformSequence{T}"/> to which further transforms can be added.</returns>
public static TransformSequence<T> FadeAccent<T>(this T accentedDrawable, Color4 newColour, double duration = 0, Easing easing = Easing.None)
where T : IHasAccentColour
=> accentedDrawable.TransformTo(nameof(accentedDrawable.AccentColour), newColour, duration, easing);
/// <summary>
/// Smoothly adjusts <see cref="IHasAccentColour.AccentColour"/> over time.
/// </summary>
/// <returns>A <see cref="TransformSequence{T}"/> to which further transforms can be added.</returns>
public static TransformSequence<T> FadeAccent<T>(this TransformSequence<T> t, Color4 newColour, double duration = 0, Easing easing = Easing.None)
where T : Drawable, IHasAccentColour
=> t.Append(o => o.FadeAccent(newColour, duration, easing));
}
}