using UnityEngine;
using mgaia.Utils.LayerSystem;

namespace mgaia.tk2d.TouchEffects
{
	/// <summary>
	/// Efeito padrao de botao que o escurece quando tocado.
	/// </summary>
    [RequireComponent(typeof(ITouchable))]
    public class tk2dDarkeningEffect : tk2dAbstractColorEffect
    {
        private const float DARKENING = 100.0f / 255.0f;

        protected override Color GetFinalSpriteColor(Color initialColor)
        {
            return new Color(initialColor.r - DARKENING, initialColor.g - DARKENING, initialColor.b - DARKENING);
        }

        protected override Color GetFinalTextColor(Color initialColor)
        {
            return new Color(initialColor.r - DARKENING, initialColor.g - DARKENING, initialColor.b - DARKENING);
        }
    }
}