On this page:
Brush
Brush.color
Brush.style
Brush.stipple
Brush.gradient
Brush.Style
Brush.none
Linear  Gradient
Linear  Gradient.line
Linear  Gradient.stops
Radial  Gradient
Radial  Gradient.circles
Radial  Gradient.stops
8.12

4 Brush🔗ℹ

class

class Brush():

  constructor (

    ~color: color :: (String || Color) = "Black",

    ~style: style :: Brush.Style = #'solid,

    ~stipple: stipple :: maybe(Bitmap) = #false,

    ~gradient: gradient :: maybe(LinearGradient || RadialGradient) = #false,

  )

Creates a brush configuration.

A brush like an existing one can be constructed using with and the field names color, style, stipple, and/or gradient.

property

property (brush :: Brush).color :: Color

 

property

property (brush :: Brush).style :: Brush.Style

 

property

property (brush :: Brush).stipple :: maybe(Bitmap)

 

property

property (brush :: Brush).gradient

  :: maybe(LinearGradient || RadialGradient)

Properties to access brush components.

annotation

Brush.Style

Satisfied by the following symbols:

A brush with style #'transparent.

class

class LinearGradient():

  constructor (pt1 :: PointLike,

               pt2 :: PointLike,

               [[stop :: Real.in(0.0, 1.0), color :: Color], ...])

 

property

property (grad :: LinearGradient).line

  :: matching([_ :: Point, _ :: Point])

 

property

property (grad :: LinearGradient).stops

  :: List.of(matching([_ :: Real.in(0.0, 1.0), _ :: Color]))

A linear gradient for a Brush.

class

class RadialGradient():

  constructor ([[pt1 :: PointLike], r1 :: Real],

               [[pt2 :: PointLike], r2 :: Real],

               [[stop :: Real.in(0.0, 1.0), color :: Color], ...])

 

property

property (grad :: RadialGradient).circles

  :: matching([[_ :: PointLike, _ :: Real],

               [_ :: PointLike, _ :: Real]])

 

property

property (grad :: RadialGradient).stops

  :: List.of(matching([_ :: Real.in(0.0, 1.0), _ :: Color]))

A radial gradient for a Brush.