Copyright | (c) Marcin Mrotek, 2015 |
---|---|
License | BSD-3 |
Maintainer | marcin.jan.mrotek@gmail.com |
Stability | experimental |
Safe Haskell | None |
Language | Haskell2010 |
As DiagramObj
is a Monoid
, complex diagrams may be obtained by mappend
ing simple ones together.
This module provides functions creating DiagramObj
s containing a single command each.
- save :: DiagramObj ()
- restore :: DiagramObj ()
- text :: String -> Double -> Double -> DiagramObj ()
- beginPath :: DiagramObj ()
- closePath :: DiagramObj ()
- moveTo :: P2 Double -> DiagramObj ()
- stroke :: DiagramObj ()
- fill :: DiagramObj ()
- lineTo :: P2 Double -> DiagramObj ()
- bezierCurveTo :: P2 Double -> P2 Double -> P2 Double -> DiagramObj ()
- setLineCap :: LineCap -> DiagramObj ()
- setLineJoin :: LineJoin -> DiagramObj ()
- setLineMiterLimit :: LineMiterLimit -> DiagramObj ()
- setOpacity :: Opacity -> DiagramObj ()
- setLineWidth :: LineWidth Double -> DiagramObj ()
- getRGBA :: SomeColor -> (Double, Double, Double, Double)
- getLinearGradient :: LGradient Double -> DiagramObj (ObjRef GradientObj)
- getRadialGradient :: RGradient Double -> DiagramObj (ObjRef GradientObj)
- setStrokeColour :: SomeColor -> DiagramObj ()
- setLineGradient :: DiagramObj ()
- setLineTexture :: LineTexture Double -> DiagramObj ()
- setGradient :: [GradientStop Double] -> ObjRef GradientObj -> IO ()
- setFillColour :: SomeColor -> DiagramObj ()
- setFillGradient :: DiagramObj ()
- setFillTexture :: FillTexture Double -> DiagramObj ()
- setFont :: Font -> DiagramObj ()
- setFillRule :: FillRule -> DiagramObj ()
Documentation
save :: DiagramObj () Source
Push the current state (style, font, etc) onto the state stack.
restore :: DiagramObj () Source
Pop the current state (style, font, etc) from the state stack.
beginPath :: DiagramObj () Source
Start assembling a new path.
closePath :: DiagramObj () Source
Connect the current path vertex to the start of the path.
moveTo :: P2 Double -> DiagramObj () Source
Change the current position.
stroke :: DiagramObj () Source
Stroke the current path.
fill :: DiagramObj () Source
Fill the current path. Works only on paths that were previously close
d.
lineTo :: P2 Double -> DiagramObj () Source
Draw a straight line from the current position to a given point.
:: P2 Double | First control point. |
-> P2 Double | Second control point |
-> P2 Double | End point. |
-> DiagramObj () |
Draw a bezier curve from the current position to a given point, using two control points.
setLineCap :: LineCap -> DiagramObj () Source
Set the line cap style.
setLineJoin :: LineJoin -> DiagramObj () Source
Set the line join style.
setLineMiterLimit :: LineMiterLimit -> DiagramObj () Source
Set the miter limit.
setOpacity :: Opacity -> DiagramObj () Source
setLineWidth :: LineWidth Double -> DiagramObj () Source
Set the line width (output coordinates assumed).
getRGBA :: SomeColor -> (Double, Double, Double, Double) Source
Convert a colour to a tuple of (r,g,b,a) components.
getLinearGradient :: LGradient Double -> DiagramObj (ObjRef GradientObj) Source
Create a linear gradient.
getRadialGradient :: RGradient Double -> DiagramObj (ObjRef GradientObj) Source
Create a radial gradient.
setStrokeColour :: SomeColor -> DiagramObj () Source
Set stroke style to a flat colour.
setLineGradient :: DiagramObj () Source
Set stroke style to a previously assembled gradient.
setLineTexture :: LineTexture Double -> DiagramObj () Source
Set stroke style.
setGradient :: [GradientStop Double] -> ObjRef GradientObj -> IO () Source
Add colour stops to a gradient.
setFillColour :: SomeColor -> DiagramObj () Source
Set fill style to a flat colour.
setFillGradient :: DiagramObj () Source
Set fill style to a previously defined gradient.
setFillTexture :: FillTexture Double -> DiagramObj () Source
Set fill style.
setFont :: Font -> DiagramObj () Source
Set font.
setFillRule :: FillRule -> DiagramObj () Source
Set fill rule.