Color gradient that can be used as a Background, mirroring the CSS linear-gradient() / radial-gradient() functions.
A default-constructed BackgroundGradient has no color stops and is treated as "no gradient" — see BackgroundGradient.IsEmpty.
| Property | Description |
|---|---|
| angle | Angle of a linear gradient, in radians, measured clockwise from "to top" (CSS convention, matching linear-gradient(0deg, ...)). Ignored for radial gradients. |
| position | Center of a radial gradient, expressed as a fraction in [0,1] of the element box (0 = top-left, 1 = bottom-right). Default (0.5, 0.5) places the gradient at the element center. Ignored for linear gradients. |
| shape | Shape used to interpret BackgroundGradient.size for radial gradients. Ignored for linear gradients. |
| size | Extent of a radial gradient. Ignored for linear gradients. |
| stops | Ordered list of color stops along the gradient axis. |
| type | Whether the gradient transitions linearly or radiates from a center point. |
| Method | Description |
|---|---|
| IsEmpty | True when this gradient has no color stops, meaning it represents "no gradient". |