-
Notifications
You must be signed in to change notification settings - Fork 0
Graphics lib ios
-
the truth is that you need a decorator style system to avoid too many concrete classes
-
just clean up v1 when porting to iOS
-
your new code that can reach protocol from shallow super type is cool
-
Decorator isn't too bad for value types as you can always copy vars to a new instance with less decoration if an instance gets too much decoration
-
addSubView(Graphic())//draw on init
-
init colors via:
.blue,.red,
-
init gradients via:
.redBlue
-
init gradients via: NSColor.blue.to(.red)//gradient
-
init RectGraphic via:
CGRect(0,0,100,100).graphic.fill(.red).stroke(.blue,10)
-
init CircGraphic via:
CGEllipse(0,0,100,100).graphic
-
init RoundRectGraphic via:
CGRect(0,0,100,100).graphic.fillet(20)
-
init PolyLineGraphic via:
[CGPoint(0,0),CGPoint(50,50)].graphic.stroke(.redOrange,4)
-
init PathGraphic via:
Path([.mt,.lt],[0,0,40,40]).graphic.stroke(.blue,10)
-
init DropShadow via: CGRect(100,100).fill(.orange).dropShadow()//Blue rect with default dropshadow applied