Skip to content

Color Binders

Ivan Murzak edited this page Mar 10, 2026 · 1 revision

Built-in Color Binders

A Color Binder is a component that binds a named theme color to a specific visual target (Image, Light, TextMeshPro, etc.). When the active theme changes, all binders automatically update their target's color.

Unity-Theme-Binder

Single-Color Binders

These binders bind one theme color to a single component. They extend GenericColorBinder<T>.

Binder Target Component Description
ImageColorBinder Image UI Image color
SpriteRendererColorBinder SpriteRenderer 2D sprite color
TextMeshProColorBinder TextMeshProUGUI TextMeshPro text color
LightColorBinder Light Light color
ShadowColorBinder Shadow UI Shadow effect color
OutlineColorBinder Outline UI Outline effect color
LineRendererColorBinder LineRenderer Line renderer start/end color

Multi-Color Binders

These binders bind multiple theme colors to a single component. They extend GenericMultiColorBinder<T>.

Binder Target Component Color Entries
SelectableColorBinder Selectable Normal, Highlighted, Pressed, Selected, Disabled
ButtonColorBinder Button Normal, Highlighted, Pressed, Selected, Disabled
ToggleColorBinder Toggle Normal, Highlighted, Pressed, Selected, Disabled

Multi-color binders let you assign a different theme color to each state. For example, a SelectableColorBinder has 5 color slots — one for each ColorBlock state.

Renderer Binders

These binders bind a theme color to a Renderer's material color. They extend GenericRendererColorBinder<T>, which itself extends GenericMultiColorBinder<T>.

Binder Target Component Description
RendererColorBinder Renderer Any renderer's material color
MeshRendererColorBinder MeshRenderer Mesh renderer material color
SkinnedMeshRendererColorBinder SkinnedMeshRenderer Skinned mesh material color
SpriteShapeRendererColorBinder SpriteShapeRenderer Sprite shape material color

Custom Shader Property

Renderer binders support a custom material property option. By default they set the material's main color, but you can enable useCustomProperty and specify a shader property name like _BaseColor, _EmissionColor, etc.

This is useful when working with custom shaders or URP/HDRP Lit materials where the main color property is _BaseColor rather than _Color.

Required Variants

Every binder has a Required variant with a [RequireComponent] attribute that ensures the target component exists on the GameObject.

Standard Required Variant
ImageColorBinder ImageColorBinderRequired
SpriteRendererColorBinder SpriteRendererColorBinderRequired
TextMeshProColorBinder TextMeshProColorBinderRequired
LightColorBinder LightColorBinderRequired
ShadowColorBinder ShadowColorBinderRequired
OutlineColorBinder OutlineColorBinderRequired
LineRendererColorBinder LineRendererColorBinderRequired
RendererColorBinder RendererColorBinderRequired
MeshRendererColorBinder MeshRendererColorBinderRequired
SkinnedMeshRendererColorBinder SkinnedMeshRendererColorBinderRequired
SpriteShapeRendererColorBinder SpriteShapeRendererColorBinderRequired
SelectableColorBinder SelectableColorBinderRequired
ButtonColorBinder ButtonColorBinderRequired
ToggleColorBinder ToggleColorBinderRequired

Use Required variants when you want Unity to automatically add the target component if it's missing.

Alpha Override

All binders support an alpha override via ColorBinderData. When enabled, the binder replaces the alpha channel of the theme color with a custom value. This lets you share a color across components that need different transparency levels.

In the Inspector, check Override Alpha and set the desired alpha value (0–1).

Adding a Binder

  1. Select a GameObject in the scene or prefab
  2. Click Add Component
  3. Search for "Theme/" — all binders are in the Theme/ component menu category
  4. Select the binder that matches your target component

The binder automatically finds the target component on the same GameObject. Use the color dropdown to select which named theme color to bind.

See Also

Clone this wiki locally