GradientValue
One of three cross-platform gradient types: linear, radial or angular. Diamond is intentionally excluded.
Value
LinearGradient
A linear gradient defined by an angle and two or more colour stops.
type—"LINEAR"angle— Angle of the gradient line, in degreesstops— Ordered list of colour stops
type: LINEARangle: 180stops: - position: 0 color: "#FF6600FF" - position: 1 color: "#FFFFFFFF"RadialGradient
A radial gradient defined by a centre point and two or more colour stops.
type—"RADIAL"center— Normalised centre point of the gradient ellipsestops— Ordered list of colour stops
type: RADIALcenter: x: 0.5 y: 0.5stops: - position: 0 color: "#FFFFFFFF" - position: 1 color: "#FF6600FF"AngularGradient
An angular (conic) gradient defined by a centre point and two or more colour stops.
type—"ANGULAR"center— Normalised centre point of the gradient sweepstops— Ordered list of colour stops
type: ANGULARcenter: x: 0.5 y: 0.5stops: - position: 0 color: "#FF6600FF" - position: 1 color: "#FFFFFFFF"Used by
Further reading
- ADR 003 — Gradient Support for Color Style Properties — introduces the
GradientValuediscriminated union andColorStyletype
Source
| Format | File |
|---|---|
| JSON Schema | packages/schema/schema/styles.schema.json |
| TypeScript | packages/schema/types/Styles.ts |
| Specification | §4.1a, §11 |