Unity - Scripting API: FillGradient
struct in UnityEngine.UIElements
/
Implemented in:UnityEngine.UIElementsModule
Success!
Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.
Submission failed
For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.
Description
Describes a fill gradient used for rendering filled shapes in Painter2D. The start, end , center, focus, and radius properties are pixel coordinate relative to the painter's coordinate system.
This struct encapsulates the data required to define a gradient fill, including the gradient itself, the type of gradient (linear or radial), and the parameters that control the direction or focus of the gradient.
Properties
| Property | Description |
|---|---|
| addressMode | Specifies how the gradient is sampled when UV coordinates are outside the [0, 1] range. |
| center | The center point for a radial gradient. |
| end | The end point for a linear gradient. |
| focus | The Focus point for radial gradient. |
| gradient | The color gradient used for the fill. |
| gradientType | The type of gradient to use (linear or radial). |
| radius | The radius for a radial gradient. |
| start | The start point for a linear gradient. |
Static Methods
| Method | Description |
|---|---|
| MakeLinearGradient | Helper method to create a linear gradient fill, using startColor and endColor to define the gradient. |
| MakeRadialGradient | Helper method to create a radial gradient fill, using startColor and endColor to define the gradient. |