C4Shapes is configured to use the default colors C4Red (for strokeColor) and C4Blue (for fillColor). In addition, the default animation value is 0.25 s.
Technically, what happens is that C4Shape builds itself with C4Red / C4Blue colors and then initiates an animation from them to any new colors as soon as it hits the canvas.
To get around them and create your own settings, you can subclass C4Shape and add color / time / other property changes to the classβs own init method.
(.m ) MyShape :
@implementation MyShape
-(id)initWithFrame:(CGRect)frame {
self = [super initWithFrame:frame];
if(self != nil) {
self.animationDuration = 0.0f;
self.fillColor = [UIColor purpleColor];
self.strokeColor = [UIColor greenColor];
}
return self;
}
@end
... C4WorkSpace.m :
#import "C4WorkSpace.h"
#import "MyShape.h"
@implementation C4WorkSpace
-(void)setup {
MyShape *ms = [MyShape new];
[ms ellipse:CGRectMake(100, 100, 100, 100)];
[self.canvas addShape:ms];
}
@end
, , , .