Documentation index for AI agents (llms.txt) A Markdown version of every page is available: request the page's source under /docs/, follow the "alternate" link in this page's head, or start from /llms.txt.
Visual Script logo Manual

Compare Colors#

Compare / Compare Colors

Description#

Returns true if two Colors are equal

Parameters#

Name Description
Value 1 The Color targeted
Value 2 The Color to compare against

Code#

using System;
using UnityEngine;
using VisualScript.Icons;

namespace VisualScript.Runtime
{
    [Title("Compare Colors")]
    [Image(typeof(IconColor), ColorTheme.Type.Pink)]
    
    [Description("Returns true if two Colors are equal")]
    [Category("Compare/Compare Colors")]
    
    [Parameter("Value 1", "The Color targeted")]
    [Parameter("Value 2", "The Color to compare against")]
    
    [Keywords("Check", "Equals", "Same")]
    
    [Serializable]
    public class ConditionCoreCompareColor : Condition
    {
        [SerializeField] private GetColor m_Value1 = new GetColor();
        [SerializeField] private GetColor m_Value2 = new GetColor();

        protected override string GetTitle(GameObject source) => $"{this.m_Value1} = {this.m_Value2}";

        protected override bool Run(Args args)
        {
            Color value1 = this.m_Value1.Get(args);
            Color value2 = this.m_Value2.Get(args);
            
            return value1 == value2;
        }
    }
}
Visual Script logoVisual Script © Catsoft Works 2026. All rights reserved.