using FairyGUI;
using NBF.Utils;

namespace NBF
{
    public static class GObjectExtensions
    {
        public static void SetQuality(this GImage image, int quality)
        {
            image.color = ItemHelper.GetItemQualityColor(quality);
        }
        
        public static void SetQuality(this GTextField image, int quality)
        {
            image.strokeColor = ItemHelper.GetItemQualityColor(quality);
        }
        
        public static void SetTitleQuality(this GButton com, int quality)
        {
            com.GetTextField().strokeColor = ItemHelper.GetItemQualityColor(quality);
        }
        
        public static void SetTitleQuality(this GTextField com, int quality)
        {
            com.strokeColor = ItemHelper.GetItemQualityColor(quality);
        }
    }
}