using System.Collections;
using System.Collections.Generic;
using System.Text;
using System;
using Godot;

namespace Rokojori
{
  [Tool]
  [GlobalClass]
  public abstract partial class BoxedColorValue:Resource
  {

    public virtual Color GetColorValue()
    {
      return Colors.White;
    }

    public virtual void SetColorValue( Color color )
    {
      
    }

    public override string ToString()
    {
      var color = GetColorValue();
      var r = RegexUtility.NumberToString( color.R ) ;
      var g = RegexUtility.NumberToString( color.G ) ;
      var b = RegexUtility.NumberToString( color.B ) ;
      var a = RegexUtility.NumberToString( color.A ) ;

      return this.GetType().Name + "( " + r + ", " + g + ", " + b + ", " + a + " )";
    }

   
    public static void Lerp( BoxedColorValue a, BoxedColorValue b, float amount, BoxedColorValue output )
    {
      if ( a == null || b == null || output == null )
      {
        return;
      }

      output.SetColorValue( ColorX.Lerp( a.GetColorValue(), b.GetColorValue(), amount ) );
    }
  }
}