Skip to content

Game.Rendering.ColorSet

Assembly:
Assembly-CSharp (common for game code / modding)
Namespace: Game.Rendering

Type:
struct

Base:
System.ValueType

Summary:
A simple value type that groups three UnityEngine.Color channels (m_Channel0, m_Channel1, m_Channel2). Provides an integer indexer to get or set each channel by index (0..2). Useful for storing small fixed-size color sets such as RGB-like channels or per-layer colors in rendering systems.


Fields

  • public UnityEngine.Color m_Channel0
    Channel 0 — the first stored Color.

  • public UnityEngine.Color m_Channel1
    Channel 1 — the second stored Color.

  • public UnityEngine.Color m_Channel2
    Channel 2 — the third stored Color.

Properties

  • public UnityEngine.Color this[int index] { get; set; }
    Indexer to access channels by index:
  • index 0 → m_Channel0
  • index 1 → m_Channel1
  • index 2 → m_Channel2 If the getter receives an index outside 0..2 it returns default(Color) (Color.clear/black with alpha 0 depending on Unity version). The setter ignores out-of-range indexes (no action for indexes outside 0..2).

Constructors

  • public ColorSet(UnityEngine.Color color)
    Initializes all three channels to the same Color (m_Channel0 = m_Channel1 = m_Channel2 = color). Useful for creating a uniform color set quickly.

Methods

  • None (only the indexer and constructor are defined).

Usage Example

using UnityEngine;
using Game.Rendering;

// create a ColorSet where all channels are red
ColorSet cs = new ColorSet(Color.red);

// read channels
Color first = cs[0];    // Color.red
Color second = cs[1];   // Color.red

// set individual channels
cs[2] = Color.blue;     // third channel becomes blue

// safe access: out-of-range get returns default(Color)
Color invalid = cs[5];  // default(Color) — usually Color.clear

// you can treat it as a compact container for 3 colors