Safe Haskell | None |
---|---|
Language | Haskell98 |
- data CurveAttribute :: * -> * where
- LineWidth :: CurveAttribute Scalar
- LineBlur :: CurveAttribute Scalar
- LineColour :: CurveAttribute Colour
- VarLineWidth :: CurveAttribute (Scalar -> Scalar -> Point -> Scalar)
- VarLineBlur :: CurveAttribute (Scalar -> Scalar -> Point -> Scalar)
- VarLineColour :: CurveAttribute (Scalar -> Scalar -> Point -> Colour)
- FillBlur :: CurveAttribute Scalar
- FillColour :: CurveAttribute Colour
- Texture :: CurveAttribute (Point -> Point -> Colour)
- TextureBasis :: CurveAttribute Basis
- type Style = [Assignment Image]
- lineStyle :: Scalar -> Scalar -> Colour -> Style
- fillStyle :: Scalar -> Colour -> Style
- brushStyle :: Scalar -> Scalar -> Style
- gradient :: Colour -> Colour -> Scalar -> Style
- dashedOpen :: Scalar -> Scalar -> Style
- dashedClosed :: Scalar -> Scalar -> Style
- dashed :: Scalar -> Scalar -> Style
Documentation
data CurveAttribute :: * -> * where Source
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.
LineWidth :: CurveAttribute Scalar | |
LineBlur :: CurveAttribute Scalar | |
LineColour :: CurveAttribute Colour | |
VarLineWidth :: CurveAttribute (Scalar -> Scalar -> Point -> Scalar) | |
VarLineBlur :: CurveAttribute (Scalar -> Scalar -> Point -> Scalar) | |
VarLineColour :: CurveAttribute (Scalar -> Scalar -> Point -> Colour) | |
FillBlur :: CurveAttribute Scalar | |
FillColour :: CurveAttribute Colour | |
Texture :: CurveAttribute (Point -> Point -> Colour) | |
TextureBasis :: CurveAttribute Basis |
type Style = [Assignment Image] Source
A style is a list of attribute assignments.
brushStyle :: Scalar -> Scalar -> Style Source
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 -> Style Source
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 -> Style Source
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 -> Style Source
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.