ios - Alpha component on UIBezierPath Fill -


i have view defined :

class triangleview: uiview {   override func drawrect(rect: cgrect) {      // height , width     let layerheight = self.layer.frame.height     let layerwidth = self.layer.frame.width      // create path     let bezierpath = uibezierpath()      bezierpath.movetopoint(cgpointmake(0, 0))     bezierpath.addlinetopoint(cgpointmake(0, layerheight))     bezierpath.addlinetopoint(cgpointmake(layerwidth, layerheight + 4))     bezierpath.addlinetopoint(cgpointmake(0, 0))     bezierpath.closepath()      // apply color     uicolor(red: (69/255.0), green: (209/255.0), blue: (153/255.0), alpha: 1.0).setfill()     bezierpath.fill()      // mask path     let shapelayer = cashapelayer()     shapelayer.bordercolor = uicolor.clearcolor().cgcolor     shapelayer.path = bezierpath.cgpath     self.layer.mask = shapelayer  }  } 

i'm trying make semi-transparent, using uicolor(red: (69/255.0), green: (209/255.0), blue: (153/255.0), alpha: 0.5).setfill() using bezierpath.fillwithblendmode( .normal, alpha: 0.5) produces same result of darker normal color no transparency, more decrease alpha in both cases, darker color becomes. i'm not sure i'm doing wrong.

set views backgroundcolor uicolor.clearcolor().


Comments