Skip to content

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 degrees
  • stops — Ordered list of colour stops
type: LINEAR
angle: 180
stops:
- 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 ellipse
  • stops — Ordered list of colour stops
type: RADIAL
center:
x: 0.5
y: 0.5
stops:
- 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 sweep
  • stops — Ordered list of colour stops
type: ANGULAR
center:
x: 0.5
y: 0.5
stops:
- position: 0
color: "#FF6600FF"
- position: 1
color: "#FFFFFFFF"

Used by

Further reading

Source

FormatFile
JSON Schemapackages/schema/schema/styles.schema.json
TypeScriptpackages/schema/types/Styles.ts
Specification§4.1a, §11