BackgroundAnnotation.Border


Border stroke specification for BackgroundAnnotation.

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.

Summary

Public constructors

Border(width: Dp, brush: Brush)

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

Cmn
Border(width: Dp, color: Color)

Creates a Border with a stroke width and a solid color.

Cmn
Border(width: Dp, colorProducer: ColorProducer)

Creates a Border with a stroke width whose color is resolved lazily on each draw pass via colorProducer, enabling border color animations without relayout.

Cmn

Public functions

open operator Boolean
equals(other: Any?)
Cmn
open Int
Cmn
open String
Cmn

Public properties

Brush?

stroke brush applied to the contour border, or null when constructed with color or colorProducer

Cmn
Color

stroke color applied to the contour border, or Color.Unspecified when constructed with colorProducer or brush

Cmn
ColorProducer?

deferred color producer evaluated during the draw phase, or null when constructed with color or brush

Cmn
Dp

stroke width, or Dp.Hairline for a single-pixel hairline stroke

Cmn

Public constructors

Border

Border(width: Dp, brush: Brush)

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

Parameters
width: Dp

stroke width, or Dp.Hairline for a single-pixel hairline stroke

brush: Brush

stroke brush applied to the contour border

Border

Border(width: Dp, color: Color)

Creates a Border with a stroke width and a solid color.

Parameters
width: Dp

stroke width, or Dp.Hairline for a single-pixel hairline stroke

color: Color

stroke color applied to the contour border

Border

Border(width: Dp, colorProducer: ColorProducer)

Creates a Border with a stroke width whose color is resolved lazily on each draw pass via colorProducer, enabling border color animations without relayout.

Parameters
width: Dp

stroke width, or Dp.Hairline for a single-pixel hairline stroke

colorProducer: ColorProducer

deferred color producer evaluated during the draw phase

Public functions

equals

open operator fun equals(other: Any?): Boolean

hashCode

open fun hashCode(): Int

toString

open fun toString(): String

Public properties

brush

val brush: Brush?

stroke brush applied to the contour border, or null when constructed with color or colorProducer

color

val color: Color

stroke color applied to the contour border, or Color.Unspecified when constructed with colorProducer or brush

colorProducer

val colorProducer: ColorProducer?

deferred color producer evaluated during the draw phase, or null when constructed with color or brush

width

val width: Dp

stroke width, or Dp.Hairline for a single-pixel hairline stroke