Color.operator *

Unity · Версия 2020.3 LTS · Scripting · Color

Color.operator *

public static Color operator *(Color a, Color b);

Описание

Перемножает два цвета вместе. Каждый компонент умножается отдельно.

using UnityEngine;

public class Example : MonoBehaviour
{
    void Start()
    {
        Color grayColor = Color.gray * Color.white;
    }
}

public static Color operator *(Color a, float b);

Описание

Умножает цвет a на число с плавающей запятой b. Каждый цветовой компонент масштабируется отдельно.

using UnityEngine;

public class Example : MonoBehaviour
{
    void Start()
    {
        Color whiteColor = Color.gray * 2;
    }
}

public static Color operator *(float b, Color a);

Описание

Умножает цвет a на число с плавающей запятой b. Каждый цветовой компонент масштабируется отдельно.

using UnityEngine;

public class Example : MonoBehaviour
{
    void Start()
    {
        Color whiteColor = 2 * Color.gray;
    }
}

Обновлено 17 ноября 2026 г.