@@ -14,6 +14,7 @@ type Form = {
1414 scale : Float,
1515 x : Float,
1616 y : Float,
17+ alpha : Float,
1718 form : BasicForm
1819 }
1920
@@ -75,7 +76,8 @@ data BasicForm
7576 | FElement Element
7677 | FGroup Matrix2D [Form]
7778
78−form f = { theta = 0, scale = 1, x = 0, y = 0, form = f }
79+form : BasicForm -> Form
80+form f = { theta=0, scale=1, x=0, y=0, alpha=1, form=f }
7981
8082fill style shape = form (FShape (Either.Right style) shape)
8183
@@ -147,6 +149,10 @@ moveX x f = { f | x <- f.x + x }
147149moveY : Float -> Form -> Form
148150moveY y f = { f | y <- f.y + y }
149151
152+-- Set the opacity of a `Form`. The default is 1, and 0 is totally transparent.
153+opacity : Float -> Form -> Form
154+opacity a f = { f | alpha <- a }
155+
150156-- A collage is a collection of 2D forms. There are no strict positioning
151157-- relationships between forms, so you are free to do all kinds of 2D graphics.
152158collage : Int -> Int -> [Form] -> Element