curves-1.1.0.1: Library for drawing curve based images.

Safe HaskellNone

Graphics.Curves.Style

Synopsis

Documentation

data CurveAttribute whereSource

Style attributes of a curve. The line width is with width in pixels of the solid part of the curve. Outside the line width the curve fades to full transparency in a band whose width is determined by the line blur attribute. All line attributes can be parameterized by the absolute (in pixels) and relative distance from the start of the curve.

A set of closed curves combined with +++ can be filled using a fill colour (transparent for no fill) or a texture. A texture is a function that computes a colour value given the position of the point being filled, both in absolute pixels and relative to the texture basis. The texture basis is defaultBasis by default and is transformed with the image. Typically you would use the absolute position for rasterisation and the relative position for textures.

A point is deemed inside the curves if a ray starting at the point intersects with the curves an odd number of times. The fill blur is the width of the band around the curve edge in which the fill colour fades to full transparency. Setting the fill colour of a non-closed curve results in unspecified behaviour.

type Style = [Assignment Image]Source

A style is a list of attribute assignments.

lineStyle :: Scalar -> Scalar -> Colour -> StyleSource

Setting the line width, blur and colour.

fillStyle :: Scalar -> Colour -> StyleSource

Setting the fill blur and colour.

brushStyle :: Scalar -> Scalar -> StyleSource

Dynamic line width style that tapers off at the end points. First argument is maximum width and the second the length of the tapering off part.

gradient :: Colour -> Colour -> Scalar -> StyleSource

Fade from the first to the second colour and then back. The third argument in the distance in pixels it takes to reach the second colour.

dashedOpen :: Scalar -> Scalar -> StyleSource

A dashed line style. The first argument is the approximate length (in pixels) of the dashes and the second argument of the gaps. The lengths are adjusted to make the curve always end in a dash.

dashedClosed :: Scalar -> Scalar -> StyleSource

A dashed line style. The first argument is the approximate length (in pixels) of the dashes and the second argument of the gaps. The lengths are adjusted to make the curve always end in a gap so closed curves have a smooth transition where the end of the curve meets the start.

dashed :: Scalar -> Scalar -> StyleSource

A dashed line style. The first argument is the lengths (in pixels) of the dashes and the second argument of the gaps.