diagrams-0.1: An EDSL for creating simple diagrams

Portabilityportable
Stabilityexperimental
Maintainerbyorgey@gmail.com
Safe HaskellNone

Graphics.Rendering.Diagrams.Attributes

Description

Attributes which can be added as annotations to a Diagram, implemented via instances of AttrClass.

Synopsis

Documentation

fillColor :: Color -> Diagram -> DiagramSource

Draw a diagram using the given fill color. Note that the new color only applies to parts of the diagram which are not otherwise colored; subdiagrams which already have an explicit fill color will not be affected. The default fill color is completely transparent.

fc :: Color -> Diagram -> DiagramSource

fc is provided as a convenient short synonym for fillColor.

fillTransparency :: Int -> Diagram -> DiagramSource

Set the transparency used for the fill color, from 0 (completely transparent) to 255 (completely opaque). Note that you can set the alpha channel of the fill color using fillColor combined with rgba, but fillTransparency allows you to set the alpha channel independently of the color channels. This means you can use it together with the colors defined in Graphics.Rendering.Diagrams.Colors.

ft :: Int -> Diagram -> DiagramSource

ft is provided as a convenient short synonym for fillTransparency.

lineColor :: Color -> Diagram -> DiagramSource

Draw a diagram using the given color for lines. Note that the new color only applies to parts of the diagram which are not otherwise colored; subdiagrams which already have an explicit line color will not be affected. The default line color is black.

lc :: Color -> Diagram -> DiagramSource

lc is provided as a convenient short synonym for lineColor.

lineWidth :: Double -> Diagram -> DiagramSource

Draw shape outlines and lines with the given width. Note that the line width is invariant under uniform scaling, although under non-uniform scaling (scaling by different amounts in the x and y axes) lines can become distorted. The default line width is 1.

lw :: Double -> Diagram -> DiagramSource

lw is provided as a convenient short synonym for lineWidth.

stretch :: Double -> Double -> Diagram -> DiagramSource

Stretch a diagram by a separate scaling factor for each axis. stretch w h scales by a factor of w in the x direction and a factor of h in the y direction.

scale :: Double -> Diagram -> DiagramSource

Scale by the same scaling factor in both dimensions, so the diagram retains its aspect ratio.

scaleX :: Double -> Diagram -> DiagramSource

Scale a diagram along the x-axis only. scaleX s is equivalent to stretch s 1.

scaleY :: Double -> Diagram -> DiagramSource

Scale a diagram along the y-axis only. scaleY s is equivalent to stretch 1 s.

translate :: Double -> Double -> Diagram -> DiagramSource

Translate a diagram by the given relative offsets in the x and y directions. Note that the positive x-axis is to the right, while the positive y-axis points downwards.

translateX :: Double -> Diagram -> DiagramSource

Translate a diagram along the x-axis only. translateX x is equivalent to translate x 0.

translateY :: Double -> Diagram -> DiagramSource

Translate a diagram along the y-axis only. translateY y is equivalent to translate 0 y.

rotate :: Double -> Diagram -> DiagramSource

rotate f rotates a diagram clockwise by fraction f of a complete revolution. rotate f is equivalent to rotateR (2*pi*f).

rotateR :: Double -> Diagram -> DiagramSource

rotateR r rotates a diagram clockwise by r radians.