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 stroke sets the visual style of a line or border.

## Syntax

```xml
<Stroke color="argb-color" thickness="float" dashIntervals="string"
           dashPhase="string" cap="BUTT | ROUND | SQUARE" >
    <!-- Only the most common inner element is shown here. -->
  <LinearGradient />
  ...
<Stroke />
```

## Attributes

The `Stroke` element has the following attributes:

### Required attributes

The following attributes are required:

`color`

:   The color of the stroke. You must specify the color using
    either the ARGB format (`#ff000000` = opaque black) or the RGB format
    (`#000000` = black).

    From version 4, this attribute is [transformable](https://developer.android.com/training/wearables/wff/common/transform/transform).

`thickness`

:   The thickness of the stroke expressed as a [float dimension](https://developer.android.com/training/wearables/wff/common/attributes/dimension-type).

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

### Optional attributes

The following attributes are optional:

`dashIntervals`, `dashPhase`
:   `dashIntervals` is a space-separated series of values that describe the dash
    intervals. There must be an even number of dash intervals provided, with the
    even indices specifying the "on" intervals, and the odd indices specifying the
    "off" intervals.
    `dashPhase` is an offset into the intervals array (mod the sum of all of the
    intervals). The default value is 0.
    These attributes are used to create a [`DashPathEffect`](https://developer.android.com/reference/android/graphics/DashPathEffect).

`cap`

:   Determine the shape of the edge of the stroke. Supported values are:

    - `BUTT` causes the stroke to end with the path, and not project beyond it.
    - `ROUND`causes the stroke to project out as a semicircle, with the center at the end of the path.
    - `SQUARE` causes the stroke to project out as a square, with the center at the end of the path.

`join`
:   Determines how the outer edges of stroke joints are rendered. Supported values are:

    - `MITER`: Extends the outer edges of the lines until they meet at a sharp point. Default value.
    - `ROUND`: Rounds the corner off with a circular arc.
    - `BEVEL`: Flattens the corner with a straight diagonal cut, preventing sharp points without the curvature of a round join.

## Inner elements

The `Stroke` element can contain the following elements:

- [`LinearGradient`](https://developer.android.com/training/wearables/wff/group/part/draw/gradient/linear-gradient)
- [`RadialGradient`](https://developer.android.com/training/wearables/wff/group/part/draw/gradient/radial-gradient)
- [`SweepGradient`](https://developer.android.com/training/wearables/wff/group/part/draw/gradient/sweep-gradient)
- [`Transform`](https://developer.android.com/training/wearables/wff/common/transform/transform)
- [`Reference`](https://developer.android.com/training/wearables/wff/common/reference/reference)

## Recommended for you

- Note: link text is displayed when JavaScript is off
- [Stroke](https://developer.android.com/training/wearables/wff/v2/group/part/draw/style/stroke)
- [Fill](https://developer.android.com/training/wearables/wff/group/part/draw/style/fill)
- [WeightedStroke](https://developer.android.com/training/wearables/wff/group/part/draw/style/weighted-stroke)