Hello, I'm trying to draw a single line, the code works but the line is not the right color and is 2 pixels thick despite me explicitly telling it to use 1 pixel as line width, what's more confusing is that if I increase the line width the color changes! what am I doing wrong? here's my code:
Code:
CGContextRef ctx = UIGraphicsGetCurrentContext();
CGContextClearRect(ctx, rect);
CGContextSetLineWidth(ctx, 1) ;
CGContextBeginPath(ctx);
CGContextSetRGBStrokeColor(ctx, (CGFloat)255/255, (CGFloat)0/255, (CGFloat)0/255, 1.0);
CGContextMoveToPoint(ctx, 0, 450);
CGContextAddLineToPoint(ctx, 320, 450);
CGContextStrokePath(ctx);