Watch Face Format version <button value="5" default="">Version 5</button> <button value="4">Version 4</button> <button value="3">Version 3</button> <button value="2">Version 2</button> <button value="1">Version 1</button>

*** ** * ** ***

A gradient transitioning between two colors along a line.

## Syntax

```xml
<LinearGradient startX="float" startY="float" endX="float" endY="float"
                   colors="argb-color argb-color" positions="float float" />
```

## Attributes

The `LinearGradient` element must contain the following attributes:

`startX`

:   The x-coordinate for the start of the gradient line.

    This attribute is [transformable](https://developer.android.com/training/wearables/wff/common/transform/transform).

`startY`

:   The y-coordinate for the end of the gradient line.

    This attribute is [transformable](https://developer.android.com/training/wearables/wff/common/transform/transform).

`endX`

:   The x-coordinate for the end of the gradient line.

    This attribute is [transformable](https://developer.android.com/training/wearables/wff/common/transform/transform).

`endY`

:   The y-coordinate for the end of the gradient line.

    This attribute is [transformable](https://developer.android.com/training/wearables/wff/common/transform/transform).

`colors`

:   A space-separated list of colors. You must specify each color using either the
    ARGB format (`#ff000000` = opaque black) or the RGB format (`#000000` = black).

`positions`

:   A space-separated list of floats. The relative positions \[0..1\] of each
    corresponding color in the colors attribute. If this is an empty string, the
    colors are distributed evenly along the gradient line.

## Inner elements

The `LinearGradient` element can contain :

- Between 0 and 4 [`Transform`](https://developer.android.com/training/wearables/wff/common/transform/transform) elements.
- [`Reference`](https://developer.android.com/training/wearables/wff/common/reference/reference)

## Recommended for you

- Note: link text is displayed when JavaScript is off
- [SweepGradient](https://developer.android.com/training/wearables/wff/group/part/draw/gradient/sweep-gradient)
- [Line](https://developer.android.com/training/wearables/wff/v2/group/part/draw/shape/line)
- [Line](https://developer.android.com/training/wearables/wff/group/part/draw/shape/line)