Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import Color exposing (..)
- import Graphics.Collage exposing (..)
- import Graphics.Element exposing (..)
- hexagon : Color -> Form
- hexagon clr = outlined (solid clr) (ngon 6 150)
- hex_on_a_point : Float -> Color -> Form
- hex_on_a_point deg clr = rotate (degrees deg) (hexagon clr)
- uni_path : Path
- uni_path =
- let radius = 150
- angle = 30
- radians= angle/180.0 * pi
- factor1 = cos radians
- factor2 = sin radians
- number = factor1 * radius
- half = factor2 * radius
- in
- path [
- (0,radius),
- (-number,-half),
- (number,half),
- (0,-radius),
- (-number,half),
- (number,-half),
- (0,radius)
- ]
- unicursal : Color -> Form
- unicursal clr = outlined (solid clr) uni_path
- main : Element
- main =
- collage 300 300
- [ filled black (circle 150)
- , hex_on_a_point 90 green
- , unicursal red
- ]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement