Effects
Image Gradient
Apply a vertex gradient to a UI Graphic
Overview
Image Gradient applies gradient colors to a Graphic's mesh.
Usage
Add Image Gradient to the Graphic you want to tint.
Edit the gradient and choose its direction.
Select how it blends with existing vertex colors.
Adjust angle, zoom, offset, or reverse direction.
Public API
Use ImageGradient in the Evo.UI namespace.
Call UpdateGradient() after editing gradientEffect in place.
Fields
| Name | Type | Description |
|---|---|---|
gradientEffect | Gradient | Gradient applied to the vertices. |
gradientType | Type | Horizontal or Vertical base direction. |
blendMode | BlendMode | How gradient colors combine with existing colors. |
angle | float | Gradient rotation. |
effectOffset | float | Gradient offset. |
zoom | float | Gradient scale. |
reverse | bool | Reverses color order. |
Methods
| Name | Parameters | Description |
|---|---|---|
UpdateGradient() | None | Marks the gradient for refresh. |
SetGradient() | Gradient newGradient | Replaces the gradient. |
SetGradientColors() | Color startColor, Color endColor | Creates a two-color gradient. |
Example
using UnityEngine;
using Evo.UI;
public class ImageGradientExample : MonoBehaviour
{
[SerializeField] private ImageGradient target;
private void Start()
{
target.SetGradientColors(Color.cyan, Color.blue);
target.angle = 30f;
target.UpdateGradient();
}
}