Skip to content

DeclarativeGraphics/DeclarativeGraphics

Repository files navigation

Declarative Graphics / Shapes

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 80

Produces this Image:

TitleSVG

The aim is to create a functional, declarative Shape rendering library. It also features Text rendering.

Libraries used

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.

Inspirations

Similar Projects

About

An interface similar to Elm's Collages / Racket's Pict implemented in Haskell.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors