2module Graphics.Collage where
5import Graphics.Geometry
6import Native.Graphics.Matrix as Matrix
7import Native.Graphics.Collage as N
9import Graphics.Color as Color
24data LineCap = Butt | Round | Square
25data LineJoin = Smooth | Sharp | Clipped
47solid clr = { defaultLine | color <- clr }
48dashed clr = { defaultLine | color <- clr, dashing <- [8,4] }
49dotted clr = { defaultLine | color <- clr, dashing <- [3,3] }
52 = FPath LineStyle Path
53 | FShape (Either LineStyle FillStyle) Shape
54 | FImage Int Int (Int,Int) String
56 | FGroup Matrix [Form]
58form f = { theta = 0, scale = 1, x = 0, y = 0, form = f }
60fill style shape = form (FShape (Right style) shape)
62filled : Color -> Shape -> Form
63filled color shape = fill (Solid color) shape
65textured : String -> Shape -> Form
66textured src shape = fill (Texture src) shape
68gradient : Gradient -> Shape -> Form
69gradient grad shape = fill (Gradient grad) shape
71outlined : LineStyle -> Shape -> Form
72outlined style shape = form (FShape (Left style) shape)
74traced : LineStyle -> Path -> Form
75traced style path = form (FPath style path)
77sprite : Int -> Int -> (Int,Int) -> String -> Form
78sprite w h pos src = form (FImage w h pos src)
80toForm : Element -> Form
81toForm e = form (FElement e)
84group fs = form (FGroup Matrix.identity fs)
86groupTransform : Matrix -> [Form] -> Form
87groupTransform matrix fs = form (FGroup matrix fs)
89rotate : Float -> Form -> Form
90rotate t f = { f | theta <- f.theta + t }
92scale s f = { f | scale <- f.scale * s }
94move x y f = { f | x <- f.x + x, y <- f.y + y }
95moveX x f = { f | x <- f.x + x }
96moveY y f = { f | y <- f.y + y }
98collage : Int -> Int -> [Form] -> Element
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list