Skip to content
Andy Gill edited this page Jun 20, 2014 · 3 revisions

{-# LANGUAGE OverloadedStrings #-}
module Main where

import Graphics.Blank

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