StrokeStyle

smile.pictures.StrokeStyle
See theStrokeStyle companion object
case class StrokeStyle(paint: Paint, width: Double = ..., cap: Cap = ..., join: Join = ..., onTop: Boolean = ...)

How an outline is stroked, given by its paint, its line width, and its cap and join styles.

import smile.colors.PresetColor.*

val thick    = StrokeStyle(Navy, 12, StrokeStyle.Cap.Round, StrokeStyle.Join.Round)
val outlined = Triangle(80, fillWith(Gold), Some(thick))

A golden triangle with a thick navy outline and round corners

Value parameters

cap

The cap style of the stroke. Defaults to Square.

join

The join style of the stroke. Defaults to Miter. A text's glyphs are stroked with round joins regardless. A stroke lives in its shape's own frame and scales with the shape, by each axis's own factor.

paint

The single color or gradient used for the stroke.

width

The width of the stroke, finite and not negative. Defaults to 1.

Attributes

Throws
IllegalArgumentException

if the width is negative or not finite

Companion
object
Source
style.scala
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Inherited methods

An iterator over the names of all the elements of this product.

An iterator over the names of all the elements of this product.

Attributes

Inherited from:
Product
Source
Product.scala

An iterator over all the elements of this product.

An iterator over all the elements of this product.

Attributes

Returns

in the default implementation, an Iterator[Any]

Inherited from:
Product
Source
Product.scala