我搜索了网站,我发现了如何绘制色轮...... Math behind the Colour Wheel
但我想通过绘制UIView来实现它。但是如何使用Quartz技术呢?我应该用点或线画出来吗?谢谢
答案 0 :(得分:0)
也许它适合你。
- (void)drawPoint:(CGPoint)point { CGContextBeginPath(UIGraphicsGetCurrentContext()); CGContextMoveToPoint(UIGraphicsGetCurrentContext(),point.x,point.y); CGContextAddLineToPoint(UIGraphicsGetCurrentContext(),point.x,point.y); CGContextStrokePath(UIGraphicsGetCurrentContext()); }
- (void)drawLineFrom:(CGPoint)启动 至:(CGPoint)结束{ CGContextBeginPath(UIGraphicsGetCurrentContext()); CGContextMoveToPoint(UIGraphicsGetCurrentContext(),start.x,start.y); CGContextAddLineToPoint(UIGraphicsGetCurrentContext(),end.x,end.y); CGContextStrokePath(UIGraphicsGetCurrentContext()); }