Version: Unity 6.3 Beta (6000.3)
LanguageEnglish
  • C#

FillGradient

struct in UnityEngine.UIElements

/

Implemented in:UnityEngine.UIElementsModule

Suggest a change

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.

Close

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.

Close

Cancel

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
addressModeSpecifies how the gradient is sampled when UV coordinates are outside the [0, 1] range.
centerThe center point for a radial gradient.
endThe end point for a linear gradient.
focusThe Focus point for radial gradient.
gradientThe color gradient used for the fill.
gradientTypeThe type of gradient to use (linear or radial).
radiusThe radius for a radial gradient.
startThe 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.