Skip to content
RyanGlScott edited this page Oct 9, 2014 · 3 revisions

{-# LANGUAGE OverloadedStrings #-}
module Main where

import Graphics.Blank

main :: IO ()
main = blankCanvas 3000 $ \ context -> do

    send context $ do
        strokeStyle "blue";
        beginPath();
        rect(100,100,200,200)
        cmds <- sequence [ do
                   b <- isPointInPath (x,y)
                   return $ do
                        beginPath()
                        fillStyle $ if b then "red" else "green"
                        arc(x, y, 5, 0, pi*2, False)
                        fill()
                 | x <- take 8 [25,25+50..]
                 , y <- take 8 [25,25+50..]
                 ]
        stroke()
        -- Now draw the points
        sequence_ cmds
Clone this wiki locally