# BackgroundAnnotation.Border

> Border stroke specification for [BackgroundAnnotation].

## API Reference

> Source set: Common

```kotlin
public class Border private constructor(
        public val width: Dp,
        public val color: Color,
        public val colorProducer: ColorProducer?,
        public val brush: Brush?,
    )
```

Border stroke specification for [BackgroundAnnotation](https://composables.com/jetpack-compose/androidx.compose.ui/ui-text/classes/BackgroundAnnotation/api.md).

Equivalent to `BorderStroke` in `androidx.compose.foundation` (which `ui-text` does not
depend on), with an additional `ColorProducer` overload for draw-phase color animations.

Drawn as a centered stroke along the background contour: half of `width` extends outside the
contour (past `spread`) and half overlaps inside the fill.

## Functions

### equals

> Source set: Common

```kotlin
override fun equals(other: Any?): Boolean
```

Creates a `Border` with a stroke `width` painted with a `brush`.

#### Parameters

| | |
| --- | --- |
| width | stroke width, or `Dp.Hairline` for a single-pixel hairline stroke |
| brush | stroke brush applied to the contour border |

### hashCode

> Source set: Common

```kotlin
override fun hashCode(): Int
```

### toString

> Source set: Common

```kotlin
override fun toString(): String
```
