6 | Arc (Float,Float) Float (Float,Float) Path
7 | Line (Float,Float) Path
8 | Bezier (Float,Float) (Float,Float) (Float,Float) Path
9 | Quadratic (Float,Float) (Float,Float) Path
13 hd:tl -> foldl Line (Start hd) tl
15segment p1 p2 = Line p1 (Start p2)
21quadraticTo = Quadratic
23data Shape = Shape Line
25polygon ps = Shape (case ps of
27 hd:tl -> Line hd $ foldl Line (Start hd) tl)
29rect w h = polygon [ (0-w/2,0-h/2), (0-w/2,h/2), (w/2,h/2), (w/2,0-h/2) ]
32 f i = ( w/2 * cos (2*pi/n * i), h/2 * sin (2*pi/n * i))
33 in Shape $ map f [0..n-1]
34circle r = oval (2*r) (2*r)
37 f i = ( r * cos (2*pi/m * i), r * sin (2*pi/m * i))
38 in Shape $ map f [0..n-1]
44 | Transform Float Float Float Float Float Float
46data Form = Form [Transform] BasicForm
49data LineCap = Butt | Round | Square
50data LineJoin = Round | Bevel | Miter
56 | LinearGradient [(Float,Color)] (Float,Float) (Float,Float)
57 | RadialGradient [(Float,Color)] (Float,Float) Float (Float,Float) Float
59data LineStyle = NoLine | Line [Int] Int Float LineCap LineJoin Float FillStyle
62 = FLine LineStyle FillStyle Line
63 | FShape LineStyle FillStyle Shape
64 | FImage Int Int String
70 FLine ls _ ln -> FLine ls fs ln
71 FShape ls _ shp -> FLine ls fs shp
74noFill = setFillStyle NoFill
75fillColor clr = setFillStyle (Solid clr)
76texture src = setFillStyle (Texture src)
77linearGradient stops start end = setFillStyle (LinearGradient stops start end)
78radialGradient stops innerP innerR outerP outerR =
79 setFillStyle (RadialGradient stops innerP innerR outerP outerR)
81solid clr ln = Form [] (FLine ln)
82dotted clr ln = Form [] (FLine ln)
83dashed clr ln = Form [] (FLine ln)
84customLine pattern clr ln = Form [] (FLine (Custom pattern) clr ln)
87filled clr shp = Form [] (FShape shp)
88outlined clr shp = Form [] (FShape shp)
89customOutline pattern clr (Shape ps pos) =
90 Form [] (FShape (CustomOutline pattern) clr (Shape ps pos))
91textured src (Shape ps pos) = Form [] (FShape (Textured src) black (Shape ps pos))
97sprite w h pos src = Form 0 1 pos (FImage w h src)
98toForm pos e = Form 0 1 pos (FElement e)
100addTransform t (Form ts form) = Form (t:ts) form
102rotateRad rad = addTransform $ Rotate rad
103rotateDeg deg = addTransform $ Rotate (pi * deg / 180)
104rotate rot = addTransform $ Rotate (2 * pi * rot)
106scale s = addTransform (Scale s s)
107scaleX s = addTransform (Scale s 1)
108scaleY s = addTransform (Scale 1 s)
110move x y = addTransform (Move x y)
111moveX x = addTransform (Move x 0)
112moveY y = addTransform (Move 0 y)
114transform 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