image change color does not work

Hi guys, i have this script, and debugin logs that show to me that in fact the color image is changing but when i run it it dsent change the color of the inputs.
Please help me!!
Here the code

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using TMPro;

public class ValidateLoginButtom : MonoBehaviour
{
    [SerializeField] public TMP_InputField UserInput, passWordInput, NewpassWordInput, ConfirmPassWordInput, NewNameInput, NewEmailInput, NewPhone;
    [SerializeField] public Button EntrarButton, NextButton, CreateButtom;
    [SerializeField] Image emailImage, confirmNewPasswordImage;

    public bool emailIsOk, passWordIsOk = false;



    private void Update()
    {
        if (UserInput.text != "" && passWordInput.text != "")
        {
            EntrarButton.interactable = true;
        }
       
   else if (NewpassWordInput.text != "" && ConfirmPassWordInput.text != "" && NewNameInput.text != "" && NewEmailInput.text != "" && NewPhone.text != "" && emailIsOk == true && passWordIsOk == true)
        {
            NextButton.interactable = true;
        }
        else
        {
            NextButton.interactable = false;
            EntrarButton.interactable = false;
        }


    }

    public void emailChecker()
    {
        if (NewEmailInput.text.IndexOf("@") > 0 && NewEmailInput.text.IndexOf(".") > 0)
        {
            emailIsOk= true;
          

         
        }
        else
        {
            emailIsOk = false;
            emailImage.color = new Color(215, 195, 195, 255); 
           
           
        }
        // Debug.Log(emailIsOk);
        Debug.Log("the email color is:" + NewEmailInput.image.color);
    }

    public void passWordChecker()
    {
        if ( NewpassWordInput.text == ConfirmPassWordInput.text)
        {
            passWordIsOk = true;
        

        }
        else
        {
            passWordIsOk = false;
           confirmNewPasswordImage.color = new Color(215, 195, 195, 255);

        }
       Debug.Log("the pasword color is:" + ConfirmPassWordInput.image.color);
    }
}

the debug log says to me that the color is changing but it still is white.
Help!!! and thank you

Color() accepts channel params from 0.0f to 1.0f

Color32() accepts channel params from 0 to 255

Color vs Color32, lossless, comparisons, etc.

https://discussions.unity.com/t/891296/2

Hey Kurt!! i owe you one!! that just work after hours and hours. Thank you thank you very much!!!

1 Like