     }
     
     for (p,_) in pointsColors {
-        let rect = R(p.x-2, p.y-2, 4, 4)
+        let rect = R(p.x-1, p.y-1, 3, 3)
         b.ellipse(rect, stroke:"black", fill:"black")
     }
     

        pointsColors.append((p,c))
    }
    
    for x in 0...Int(b.width) {
        for y in 0...Int(b.height) {
            
            var dmin = CGFloat.max
            var color = NSColor.clearColor()
            
            for (p,c) in pointsColors {
                let d = hypot(p.x-x, p.y-y)
                if d < dmin {
                    dmin = d
                    color = c

    b.save("/tmp/polygon.png", open:true)
}

switzerland()

//bitmap()
//points()
//lines()
//rects()
//ellipse()
//text()
//image()
//bezier()
//cgContext()
//colors()
voronoi()
//polygon()

//let b = BitmapCanvas(6000,6000, "SkyBlue")
//b.fill(P(270,243), color: NSColor.blueColor())
//b.save("/tmp/out.png", open: true)

//X11Colors.dump("/opt/X11/share/X11/rgb.txt", outPath:"/tmp/X11.clr")
