This code:
picture :: CairoEGraphic
picture = attachRight [
centered $ text defaultTextStyle "groupBy toRight",
debugEnvelope $ padded 4 $ groupBy toRight [ orangeCircle, greenRectangle ],
centered $ text defaultTextStyle "groupBy toLeft",
debugEnvelope $ padded 4 $ groupBy toLeft [ orangeCircle, greenRectangle ] ]
where
thickOrangeLine = defaultLineStyle { color = (1, 0.5, 0), lineWidth = 2 }
orangeCircle = outlined thickOrangeLine $ circle 40
greenRectangle = outlined (solid (0, 1, 0)) $ rectangle 80 80Produces this Image:
The aim is to create a functional, declarative Shape rendering library. It also features Text rendering.
No libraries are required for using code from this repository, but you need a backend, and currently only a cairo backend exists. That backend uses the libraries:
- Cairo: Rendering Backend for Shapes
- Pango: Rendering Backend for Text
- Gtk: Backend for rendering to Window.
- Racket Picts
- API Heavily inspired by: Elm Collages