4data Path = Path [(Float,Float)]
7segment p1 p2 = Path [p1,p2]
9data Shape = Shape [(Float,Float)]
13rect w h = polygon [ (0-w/2,0-h/2), (0-w/2,h/2), (w/2,h/2), (w/2,0-h/2) ]
16 f i = (w/2 * cos (2*pi/n * i), h/2 * sin (2*pi/n * i))
17 in Shape $ map f [0..n-1]
18circle r = oval (2*r) (2*r)
21 f i = ( r * cos (2*pi/m * i), r * sin (2*pi/m * i))
22 in Shape $ map f [0..n-1]
28 | Transform Float Float Float Float Float Float
30data Form = Form [Transform] BasicForm
33data LineCap = Butt | Round | Square
34data LineJoin = Round | Bevel | Miter
40 | LinearGradient [(Float,Color)] (Float,Float) (Float,Float)
41 | RadialGradient [(Float,Color)] (Float,Float) Float (Float,Float) Float
43-- dash pattern, dash offset, line width, cap, join, miter limit, fill style
49 fillStyle : FillStyle,
55 = FLine LineStyle Line
56 | FShape LineStyle FillStyle Shape
57 | FImage Int Int Int Int String
63 FLine ls _ ln -> FLine ls fs ln
64 FShape ls _ shp -> FLine ls fs shp
67noFill = setFillStyle NoFill
68fillColor clr = setFillStyle (Solid clr)
69texture src = setFillStyle (Texture src)
70linearGradient stops start end = setFillStyle (LinearGradient stops start end)
71radialGradient stops innerP innerR outerP outerR =
72 setFillStyle (RadialGradient stops innerP innerR outerP outerR)
74plain = { width=1, cap=Butt, join=Miter, miterLimit=10,
76 dashing=[], dashOffset=0 }
78solid c = Form [] . FLine c
79dotted c = Form [] . FLine c
80dashed c = Form [] . FLine c
81lineStyle = Form [] . FLine
84filled clr shp = Form [] (FShape shp)
85outlined clr shp = Form [] (FShape shp)
86customOutline pattern clr (Shape ps pos) =
87 Form [] (FShape (CustomOutline pattern) clr (Shape ps pos))
88textured src (Shape ps pos) = Form [] (FShape (Textured src) black (Shape ps pos))
94sprite w h pos src = Form 0 1 pos (FImage w h src)
95toForm pos e = Form 0 1 pos (FElement e)
97addTransform t (Form ts form) = Form (t:ts) form
99rotateRad rad = addTransform $ Rotate rad
100rotateDeg deg = addTransform $ Rotate (pi * deg / 180)
101rotate rot = addTransform $ Rotate (2 * pi * rot)
103scale s = addTransform (Scale s s)
104scaleX s = addTransform (Scale s 1)
105scaleY s = addTransform (Scale 1 s)
107move x y = addTransform (Move x y)
108moveX x = addTransform (Move x 0)
109moveY y = addTransform (Move 0 y)
111transform a b c d e f = addTransform (Transform a b c d e f)
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