O1Library Docs
Fall 2026
Docs API

# Stroke

o1.gui.Stroke
sealed class Stroke(val fill: Fill, val thickness: Double = ..., val cap: Cap = ..., val join: Join = ..., val onTop: Boolean = ...)

A `Stroke` is a style for drawing shape outlines and other lines. A `Stroke` object defines, among other things, the color and width of lines drawn using the stroke.

## Parameters

cap

  the style of the cap (end point) for lines drawn using this stroke; the default is a square cap.

fill

  a fill style for lines drawn using this stroke; this can be a Color or a gradient, for example

join

  the style in which lines drawn using this stroke join up with each other; the default is a miter join

onTop

  a value that affects filled shapes that have an outline drawn using this stroke: if `true`, the outline will be drawn on top of the filled shape and fully visible; if `false`, the outline will be below the fill and partially invisible. Defaults to `true`.

thickness

  the width of lines drawn using this stroke; defaults to 1

## Attributes

Graph
Supertypes
  class Object
  trait Matchable
  class Any
Known subtypes
  object None

## Members list

### Value members

#### Concrete fields

val cap: Cap
val fill: Fill
val join: Join
val onTop: Boolean
val thickness: Double