Module Paint

module Paint: sig .. end

Paint contains the paint type and utilities for manipulating paints. This module should not be used directly by the sketch; there are functions in Shape that handle setting the stroke, fill, etc.


type paint = private {
   fill : Color.color option;
   stroke : Color.color option;
   stroke_weight : float;
   stroke_cap : [ `Project | `Round | `Square ];
   stroke_join : [ `Bevel | `Miter | `Round ];
}

The type of paint, used by shapes to draw to the canvas.

val create : paint

create is the default paint.

type paint_update = 
| Fill of Color.color option
| Stroke of Color.color option
| Stroke_weight of float
| Stroke_cap of [ `Project | `Round | `Square ]
| Stroke_join of [ `Bevel | `Miter | `Round ]
| Stroke_weight_scale of float

The type of a layerable single-attribute paint change.

val apply_paint_update : paint_update -> paint -> paint

apply_paint_update update paint is paint with update applied. For example, apply_paint_update (Stroke None) paint is paint with no stroke.