#43 從程式製作國旗圖案-不.美利堅合眾國國旗
Published in
39 min readAug 14, 2018
目的: 學習從程式製作畫面和 CAShapeLayer。
看大家努力完成各國國旗
所以決定來挑戰一下美國
但是到最後發現星星真的弄不出來阿…
於是誕生了這個自創國旗
真是可惜
只好當作是練習
只能再找時間找Peter泡茶聊天兼研究
程式碼
import UIKit//白底var rect = CGRect(x:0,y:0,width:380,height:200)let backgroundView = UIView(frame: rect)backgroundView.backgroundColor = UIColor(red: 1, green: 1, blue: 1, alpha: 1.0) /* #ffffff *///七紅條var rectRed = CGRect(x:0,y:0,width:380,height:200/13)let rectRedView = UIView(frame: rectRed)rectRedView.backgroundColor = UIColor(red: 0.698, green: 0.1333, blue: 0.2039, alpha: 1.0) /* #b22234 */backgroundView.addSubview(rectRedView)var rectRed1 = CGRect(x:0,y:(backgroundView.frame.height)*2/13,width:380,height:200/13)let rectRed1View = UIView(frame: rectRed1)rectRed1View.backgroundColor = UIColor(red: 0.698, green: 0.1333, blue: 0.2039, alpha: 1.0) /* #b22234 */backgroundView.addSubview(rectRed1View)var rectRed2 = CGRect(x:0,y:(backgroundView.frame.height)*4/13,width:380,height:200/13)let rectRed2View = UIView(frame: rectRed2)rectRed2View.backgroundColor = UIColor(red: 0.698, green: 0.1333, blue: 0.2039, alpha: 1.0) /* #b22234 */backgroundView.addSubview(rectRed2View)var rectRed3 = CGRect(x:0,y:(backgroundView.frame.height)*6/13,width:380,height:200/13)let rectRed3View = UIView(frame: rectRed3)rectRed3View.backgroundColor = UIColor(red: 0.698, green: 0.1333, blue: 0.2039, alpha: 1.0) /* #b22234 */backgroundView.addSubview(rectRed3View)var rectRed4 = CGRect(x:0,y:(backgroundView.frame.height)*8/13,width:380,height:200/13)let rectRed4View = UIView(frame: rectRed4)rectRed4View.backgroundColor = UIColor(red: 0.698, green: 0.1333, blue: 0.2039, alpha: 1.0) /* #b22234 */backgroundView.addSubview(rectRed4View)var rectRed5 = CGRect(x:0,y:(backgroundView.frame.height)*10/13,width:380,height:200/13)let rectRed5View = UIView(frame: rectRed5)rectRed5View.backgroundColor = UIColor(red: 0.698, green: 0.1333, blue: 0.2039, alpha: 1.0) /* #b22234 */backgroundView.addSubview(rectRed5View)var rectRed6 = CGRect(x:0,y:(backgroundView.frame.height)*12/13,width:380,height:200/13)let rectRed6View = UIView(frame: rectRed6)rectRed6View.backgroundColor = UIColor(red: 0.698, green: 0.1333, blue: 0.2039, alpha: 1.0) /* #b22234 */backgroundView.addSubview(rectRed6View)//藍色區塊var rectBlue = CGRect(x:0,y:0,width:200*0.76,height:200*0.5385)let rectBlueView = UIView(frame: rectBlue)rectBlueView.backgroundColor = UIColor(red: 0.2353, green: 0.2314, blue: 0.4314, alpha: 1.0) /* #3c3b6e */backgroundView.addSubview(rectBlueView)//六圓圈第一排var rectStar1 = CGRect(x:200*0.0633 - 6.33 ,y:200*0.0538/2,width:200*0.0616,height:200*0.0616)let rectStar1View = UIView(frame: rectStar1)rectStar1View.backgroundColor = UIColor(red: 1, green: 1, blue: 1, alpha: 1.0) /* #ffffff */rectStar1View.layer.cornerRadius = 200*0.0616/2rectStar1View.clipsToBounds = truerectBlueView.addSubview(rectStar1View)var rectStar2 = CGRect(x:200*0.0633*3 - 6.33 ,y:200*0.0538/2,width:200*0.0616,height:200*0.0616)let rectStar2View = UIView(frame: rectStar2)rectStar2View.backgroundColor = UIColor(red: 1, green: 1, blue: 1, alpha: 1.0) /* #ffffff */rectStar2View.layer.cornerRadius = 200*0.0616/2rectStar2View.clipsToBounds = truerectBlueView.addSubview(rectStar2View)var rectStar3 = CGRect(x:200*0.0633*5 - 6.33 ,y:200*0.0538/2,width:200*0.0616,height:200*0.0616)let rectStar3View = UIView(frame: rectStar3)rectStar3View.backgroundColor = UIColor(red: 1, green: 1, blue: 1, alpha: 1.0) /* #ffffff */rectStar3View.layer.cornerRadius = 200*0.0616/2rectStar3View.clipsToBounds = truerectBlueView.addSubview(rectStar3View)var rectStar4 = CGRect(x:200*0.0633*7 - 6.33 ,y:200*0.0538/2,width:200*0.0616,height:200*0.0616)let rectStar4View = UIView(frame: rectStar4)rectStar4View.backgroundColor = UIColor(red: 1, green: 1, blue: 1, alpha: 1.0) /* #ffffff */rectStar4View.layer.cornerRadius = 200*0.0616/2rectStar4View.clipsToBounds = truerectBlueView.addSubview(rectStar4View)var rectStar5 = CGRect(x:200*0.0633*9 - 6.33 ,y:200*0.0538/2,width:200*0.0616,height:200*0.0616)let rectStar5View = UIView(frame: rectStar5)rectStar5View.backgroundColor = UIColor(red: 1, green: 1, blue: 1, alpha: 1.0) /* #ffffff */rectStar5View.layer.cornerRadius = 200*0.0616/2rectStar5View.clipsToBounds = truerectBlueView.addSubview(rectStar5View)var rectStar6 = CGRect(x:200*0.0633*11 - 6.33 ,y:200*0.0538/2,width:200*0.0616,height:200*0.0616)let rectStar6View = UIView(frame: rectStar6)rectStar6View.backgroundColor = UIColor(red: 1, green: 1, blue: 1, alpha: 1.0) /* #ffffff */rectStar6View.layer.cornerRadius = 200*0.0616/2rectStar6View.clipsToBounds = truerectBlueView.addSubview(rectStar6View)//六圓圈第二排var rectStar21 = CGRect(x:200*0.0633 - 6.33 ,y:200*0.0538*3 - 5.38,width:200*0.0616,height:200*0.0616)let rectStar21View = UIView(frame: rectStar21)rectStar21View.backgroundColor = UIColor(red: 1, green: 1, blue: 1, alpha: 1.0) /* #ffffff */rectStar21View.layer.cornerRadius = 200*0.0616/2rectStar21View.clipsToBounds = truerectBlueView.addSubview(rectStar21View)var rectStar22 = CGRect(x:200*0.0633*3 - 6.33 ,y:200*0.0538*3 - 5.38,width:200*0.0616,height:200*0.0616)let rectStar22View = UIView(frame: rectStar22)rectStar22View.backgroundColor = UIColor(red: 1, green: 1, blue: 1, alpha: 1.0) /* #ffffff */rectStar22View.layer.cornerRadius = 200*0.0616/2rectStar22View.clipsToBounds = truerectBlueView.addSubview(rectStar22View)var rectStar23 = CGRect(x:200*0.0633*5 - 6.33 ,y:200*0.0538*3 - 5.38,width:200*0.0616,height:200*0.0616)let rectStar23View = UIView(frame: rectStar23)rectStar23View.backgroundColor = UIColor(red: 1, green: 1, blue: 1, alpha: 1.0) /* #ffffff */rectStar23View.layer.cornerRadius = 200*0.0616/2rectStar23View.clipsToBounds = truerectBlueView.addSubview(rectStar23View)var rectStar24 = CGRect(x:200*0.0633*7 - 6.33 ,y:200*0.0538*3 - 5.38,width:200*0.0616,height:200*0.0616)let rectStar24View = UIView(frame: rectStar24)rectStar24View.backgroundColor = UIColor(red: 1, green: 1, blue: 1, alpha: 1.0) /* #ffffff */rectStar24View.layer.cornerRadius = 200*0.0616/2rectStar24View.clipsToBounds = truerectBlueView.addSubview(rectStar24View)var rectStar25 = CGRect(x:200*0.0633*9 - 6.33 ,y:200*0.0538*3 - 5.38,width:200*0.0616,height:200*0.0616)let rectStar25View = UIView(frame: rectStar25)rectStar25View.backgroundColor = UIColor(red: 1, green: 1, blue: 1, alpha: 1.0) /* #ffffff */rectStar25View.layer.cornerRadius = 200*0.0616/2rectStar25View.clipsToBounds = truerectBlueView.addSubview(rectStar25View)var rectStar26 = CGRect(x:200*0.0633*11 - 6.33 ,y:200*0.0538*3 - 5.38,width:200*0.0616,height:200*0.0616)let rectStar26View = UIView(frame: rectStar26)rectStar26View.backgroundColor = UIColor(red: 1, green: 1, blue: 1, alpha: 1.0) /* #ffffff */rectStar26View.layer.cornerRadius = 200*0.0616/2rectStar26View.clipsToBounds = truerectBlueView.addSubview(rectStar26View)//六圓圈第三排var rectStar31 = CGRect(x:200*0.0633 - 6.33 ,y:200*0.0538*5 - 5.38,width:200*0.0616,height:200*0.0616)let rectStar31View = UIView(frame: rectStar31)rectStar31View.backgroundColor = UIColor(red: 1, green: 1, blue: 1, alpha: 1.0) /* #ffffff */rectStar31View.layer.cornerRadius = 200*0.0616/2rectStar31View.clipsToBounds = truerectBlueView.addSubview(rectStar31View)var rectStar32 = CGRect(x:200*0.0633*3 - 6.33 ,y:200*0.0538*5 - 5.38,width:200*0.0616,height:200*0.0616)let rectStar32View = UIView(frame: rectStar32)rectStar32View.backgroundColor = UIColor(red: 1, green: 1, blue: 1, alpha: 1.0) /* #ffffff */rectStar32View.layer.cornerRadius = 200*0.0616/2rectStar32View.clipsToBounds = truerectBlueView.addSubview(rectStar32View)var rectStar33 = CGRect(x:200*0.0633*5 - 6.33 ,y:200*0.0538*5 - 5.38,width:200*0.0616,height:200*0.0616)let rectStar33View = UIView(frame: rectStar33)rectStar33View.backgroundColor = UIColor(red: 1, green: 1, blue: 1, alpha: 1.0) /* #ffffff */rectStar33View.layer.cornerRadius = 200*0.0616/2rectStar33View.clipsToBounds = truerectBlueView.addSubview(rectStar33View)var rectStar34 = CGRect(x:200*0.0633*7 - 6.33 ,y:200*0.0538*5 - 5.38,width:200*0.0616,height:200*0.0616)let rectStar34View = UIView(frame: rectStar34)rectStar34View.backgroundColor = UIColor(red: 1, green: 1, blue: 1, alpha: 1.0) /* #ffffff */rectStar34View.layer.cornerRadius = 200*0.0616/2rectStar34View.clipsToBounds = truerectBlueView.addSubview(rectStar34View)var rectStar35 = CGRect(x:200*0.0633*9 - 6.33 ,y:200*0.0538*5 - 5.38,width:200*0.0616,height:200*0.0616)let rectStar35View = UIView(frame: rectStar35)rectStar35View.backgroundColor = UIColor(red: 1, green: 1, blue: 1, alpha: 1.0) /* #ffffff */rectStar35View.layer.cornerRadius = 200*0.0616/2rectStar35View.clipsToBounds = truerectBlueView.addSubview(rectStar35View)var rectStar36 = CGRect(x:200*0.0633*11 - 6.33 ,y:200*0.0538*5 - 5.38,width:200*0.0616,height:200*0.0616)let rectStar36View = UIView(frame: rectStar36)rectStar36View.backgroundColor = UIColor(red: 1, green: 1, blue: 1, alpha: 1.0) /* #ffffff */rectStar36View.layer.cornerRadius = 200*0.0616/2rectStar36View.clipsToBounds = truerectBlueView.addSubview(rectStar36View)///六圓圈第四排var rectStar41 = CGRect(x:200*0.0633 - 6.33 ,y:200*0.0538*7 - 5.38,width:200*0.0616,height:200*0.0616)let rectStar41View = UIView(frame: rectStar41)rectStar41View.backgroundColor = UIColor(red: 1, green: 1, blue: 1, alpha: 1.0) /* #ffffff */rectStar41View.layer.cornerRadius = 200*0.0616/2rectStar41View.clipsToBounds = truerectBlueView.addSubview(rectStar41View)var rectStar42 = CGRect(x:200*0.0633*3 - 6.33 ,y:200*0.0538*7 - 5.38,width:200*0.0616,height:200*0.0616)let rectStar42View = UIView(frame: rectStar42)rectStar42View.backgroundColor = UIColor(red: 1, green: 1, blue: 1, alpha: 1.0) /* #ffffff */rectStar42View.layer.cornerRadius = 200*0.0616/2rectStar42View.clipsToBounds = truerectBlueView.addSubview(rectStar42View)var rectStar43 = CGRect(x:200*0.0633*5 - 6.33 ,y:200*0.0538*7 - 5.38,width:200*0.0616,height:200*0.0616)let rectStar43View = UIView(frame: rectStar43)rectStar43View.backgroundColor = UIColor(red: 1, green: 1, blue: 1, alpha: 1.0) /* #ffffff */rectStar43View.layer.cornerRadius = 200*0.0616/2rectStar43View.clipsToBounds = truerectBlueView.addSubview(rectStar43View)var rectStar44 = CGRect(x:200*0.0633*7 - 6.33 ,y:200*0.0538*7 - 5.38,width:200*0.0616,height:200*0.0616)let rectStar44View = UIView(frame: rectStar44)rectStar44View.backgroundColor = UIColor(red: 1, green: 1, blue: 1, alpha: 1.0) /* #ffffff */rectStar44View.layer.cornerRadius = 200*0.0616/2rectStar44View.clipsToBounds = truerectBlueView.addSubview(rectStar44View)var rectStar45 = CGRect(x:200*0.0633*9 - 6.33 ,y:200*0.0538*7 - 5.38,width:200*0.0616,height:200*0.0616)let rectStar45View = UIView(frame: rectStar45)rectStar45View.backgroundColor = UIColor(red: 1, green: 1, blue: 1, alpha: 1.0) /* #ffffff */rectStar45View.layer.cornerRadius = 200*0.0616/2rectStar45View.clipsToBounds = truerectBlueView.addSubview(rectStar45View)var rectStar46 = CGRect(x:200*0.0633*11 - 6.33 ,y:200*0.0538*7 - 5.38,width:200*0.0616,height:200*0.0616)let rectStar46View = UIView(frame: rectStar46)rectStar46View.backgroundColor = UIColor(red: 1, green: 1, blue: 1, alpha: 1.0) /* #ffffff */rectStar46View.layer.cornerRadius = 200*0.0616/2rectStar46View.clipsToBounds = truerectBlueView.addSubview(rectStar46View)///六圓圈第五排var rectStar51 = CGRect(x:200*0.0633 - 6.33 ,y:200*0.0538*9 - 5.38,width:200*0.0616,height:200*0.0616)let rectStar51View = UIView(frame: rectStar51)rectStar51View.backgroundColor = UIColor(red: 1, green: 1, blue: 1, alpha: 1.0) /* #ffffff */rectStar51View.layer.cornerRadius = 200*0.0616/2rectStar51View.clipsToBounds = truerectBlueView.addSubview(rectStar51View)var rectStar52 = CGRect(x:200*0.0633*3 - 6.33 ,y:200*0.0538*9 - 5.38,width:200*0.0616,height:200*0.0616)let rectStar52View = UIView(frame: rectStar52)rectStar52View.backgroundColor = UIColor(red: 1, green: 1, blue: 1, alpha: 1.0) /* #ffffff */rectStar52View.layer.cornerRadius = 200*0.0616/2rectStar52View.clipsToBounds = truerectBlueView.addSubview(rectStar52View)var rectStar53 = CGRect(x:200*0.0633*5 - 6.33 ,y:200*0.0538*9 - 5.38,width:200*0.0616,height:200*0.0616)let rectStar53View = UIView(frame: rectStar53)rectStar53View.backgroundColor = UIColor(red: 1, green: 1, blue: 1, alpha: 1.0) /* #ffffff */rectStar53View.layer.cornerRadius = 200*0.0616/2rectStar53View.clipsToBounds = truerectBlueView.addSubview(rectStar53View)var rectStar54 = CGRect(x:200*0.0633*7 - 6.33 ,y:200*0.0538*9 - 5.38,width:200*0.0616,height:200*0.0616)let rectStar54View = UIView(frame: rectStar54)rectStar54View.backgroundColor = UIColor(red: 1, green: 1, blue: 1, alpha: 1.0) /* #ffffff */rectStar54View.layer.cornerRadius = 200*0.0616/2rectStar54View.clipsToBounds = truerectBlueView.addSubview(rectStar54View)var rectStar55 = CGRect(x:200*0.0633*9 - 6.33 ,y:200*0.0538*9 - 5.38,width:200*0.0616,height:200*0.0616)let rectStar55View = UIView(frame: rectStar55)rectStar55View.backgroundColor = UIColor(red: 1, green: 1, blue: 1, alpha: 1.0) /* #ffffff */rectStar55View.layer.cornerRadius = 200*0.0616/2rectStar55View.clipsToBounds = truerectBlueView.addSubview(rectStar55View)var rectStar56 = CGRect(x:200*0.0633*11 - 6.33 ,y:200*0.0538*9 - 5.38,width:200*0.0616,height:200*0.0616)let rectStar56View = UIView(frame: rectStar56)rectStar56View.backgroundColor = UIColor(red: 1, green: 1, blue: 1, alpha: 1.0) /* #ffffff */rectStar56View.layer.cornerRadius = 200*0.0616/2rectStar56View.clipsToBounds = truerectBlueView.addSubview(rectStar56View)//五圓圈第一排var circle1 = CGRect(x:200*0.0633*2 - 6.33 ,y:200*0.0538*2 - 5.38,width:200*0.0616,height:200*0.0616)let circle1View = UIView(frame: circle1)circle1View.backgroundColor = UIColor(red: 1, green: 1, blue: 1, alpha: 1.0) /* #ffffff */circle1View.layer.cornerRadius = 200*0.0616/2circle1View.clipsToBounds = truerectBlueView.addSubview(circle1View)var circle2 = CGRect(x:200*0.0633*4 - 6.33 ,y:200*0.0538*2 - 5.38,width:200*0.0616,height:200*0.0616)let circle2View = UIView(frame: circle2)circle2View.backgroundColor = UIColor(red: 1, green: 1, blue: 1, alpha: 1.0) /* #ffffff */circle2View.layer.cornerRadius = 200*0.0616/2circle2View.clipsToBounds = truerectBlueView.addSubview(circle2View)var circle3 = CGRect(x:200*0.0633*6 - 6.33 ,y:200*0.0538*2 - 5.38,width:200*0.0616,height:200*0.0616)let circle3View = UIView(frame: circle3)circle3View.backgroundColor = UIColor(red: 1, green: 1, blue: 1, alpha: 1.0) /* #ffffff */circle3View.layer.cornerRadius = 200*0.0616/2circle3View.clipsToBounds = truerectBlueView.addSubview(circle3View)var circle4 = CGRect(x:200*0.0633*8 - 6.33 ,y:200*0.0538*2 - 5.38,width:200*0.0616,height:200*0.0616)let circle4View = UIView(frame: circle4)circle4View.backgroundColor = UIColor(red: 1, green: 1, blue: 1, alpha: 1.0) /* #ffffff */circle4View.layer.cornerRadius = 200*0.0616/2circle4View.clipsToBounds = truerectBlueView.addSubview(circle4View)var circle5 = CGRect(x:200*0.0633*10 - 6.33 ,y:200*0.0538*2 - 5.38,width:200*0.0616,height:200*0.0616)let circle5View = UIView(frame: circle5)circle5View.backgroundColor = UIColor(red: 1, green: 1, blue: 1, alpha: 1.0) /* #ffffff */circle5View.layer.cornerRadius = 200*0.0616/2circle5View.clipsToBounds = truerectBlueView.addSubview(circle5View)//五圓圈第二排var circle21 = CGRect(x:200*0.0633*2 - 6.33 ,y:200*0.0538*4 - 5.38,width:200*0.0616,height:200*0.0616)let circle21View = UIView(frame: circle21)circle21View.backgroundColor = UIColor(red: 1, green: 1, blue: 1, alpha: 1.0) /* #ffffff */circle21View.layer.cornerRadius = 200*0.0616/2circle21View.clipsToBounds = truerectBlueView.addSubview(circle21View)var circle22 = CGRect(x:200*0.0633*4 - 6.33 ,y:200*0.0538*4 - 5.38,width:200*0.0616,height:200*0.0616)let circle22View = UIView(frame: circle22)circle22View.backgroundColor = UIColor(red: 1, green: 1, blue: 1, alpha: 1.0) /* #ffffff */circle22View.layer.cornerRadius = 200*0.0616/2circle22View.clipsToBounds = truerectBlueView.addSubview(circle22View)var circle23 = CGRect(x:200*0.0633*6 - 6.33 ,y:200*0.0538*4 - 5.38,width:200*0.0616,height:200*0.0616)let circle23View = UIView(frame: circle23)circle23View.backgroundColor = UIColor(red: 1, green: 1, blue: 1, alpha: 1.0) /* #ffffff */circle23View.layer.cornerRadius = 200*0.0616/2circle23View.clipsToBounds = truerectBlueView.addSubview(circle23View)var circle24 = CGRect(x:200*0.0633*8 - 6.33 ,y:200*0.0538*4 - 5.38,width:200*0.0616,height:200*0.0616)let circle24View = UIView(frame: circle24)circle24View.backgroundColor = UIColor(red: 1, green: 1, blue: 1, alpha: 1.0) /* #ffffff */circle24View.layer.cornerRadius = 200*0.0616/2circle24View.clipsToBounds = truerectBlueView.addSubview(circle24View)var circle25 = CGRect(x:200*0.0633*10 - 6.33 ,y:200*0.0538*4 - 5.38,width:200*0.0616,height:200*0.0616)let circle25View = UIView(frame: circle25)circle25View.backgroundColor = UIColor(red: 1, green: 1, blue: 1, alpha: 1.0) /* #ffffff */circle25View.layer.cornerRadius = 200*0.0616/2circle25View.clipsToBounds = truerectBlueView.addSubview(circle25View)//五圓圈第三排var circle31 = CGRect(x:200*0.0633*2 - 6.33 ,y:200*0.0538*6 - 5.38,width:200*0.0616,height:200*0.0616)let circle31View = UIView(frame: circle31)circle31View.backgroundColor = UIColor(red: 1, green: 1, blue: 1, alpha: 1.0) /* #ffffff */circle31View.layer.cornerRadius = 200*0.0616/2circle31View.clipsToBounds = truerectBlueView.addSubview(circle31View)var circle32 = CGRect(x:200*0.0633*4 - 6.33 ,y:200*0.0538*6 - 5.38,width:200*0.0616,height:200*0.0616)let circle32View = UIView(frame: circle32)circle32View.backgroundColor = UIColor(red: 1, green: 1, blue: 1, alpha: 1.0) /* #ffffff */circle32View.layer.cornerRadius = 200*0.0616/2circle32View.clipsToBounds = truerectBlueView.addSubview(circle32View)var circle33 = CGRect(x:200*0.0633*6 - 6.33 ,y:200*0.0538*6 - 5.38,width:200*0.0616,height:200*0.0616)let circle33View = UIView(frame: circle33)circle33View.backgroundColor = UIColor(red: 1, green: 1, blue: 1, alpha: 1.0) /* #ffffff */circle33View.layer.cornerRadius = 200*0.0616/2circle33View.clipsToBounds = truerectBlueView.addSubview(circle33View)var circle34 = CGRect(x:200*0.0633*8 - 6.33 ,y:200*0.0538*6 - 5.38,width:200*0.0616,height:200*0.0616)let circle34View = UIView(frame: circle34)circle34View.backgroundColor = UIColor(red: 1, green: 1, blue: 1, alpha: 1.0) /* #ffffff */circle34View.layer.cornerRadius = 200*0.0616/2circle34View.clipsToBounds = truerectBlueView.addSubview(circle34View)var circle35 = CGRect(x:200*0.0633*10 - 6.33 ,y:200*0.0538*6 - 5.38,width:200*0.0616,height:200*0.0616)let circle35View = UIView(frame: circle35)circle35View.backgroundColor = UIColor(red: 1, green: 1, blue: 1, alpha: 1.0) /* #ffffff */circle35View.layer.cornerRadius = 200*0.0616/2circle35View.clipsToBounds = truerectBlueView.addSubview(circle35View)//五圓圈第四排var circle41 = CGRect(x:200*0.0633*2 - 6.33 ,y:200*0.0538*8 - 5.38,width:200*0.0616,height:200*0.0616)let circle41View = UIView(frame: circle41)circle41View.backgroundColor = UIColor(red: 1, green: 1, blue: 1, alpha: 1.0) /* #ffffff */circle41View.layer.cornerRadius = 200*0.0616/2circle41View.clipsToBounds = truerectBlueView.addSubview(circle41View)var circle42 = CGRect(x:200*0.0633*4 - 6.33 ,y:200*0.0538*8 - 5.38,width:200*0.0616,height:200*0.0616)let circle42View = UIView(frame: circle42)circle42View.backgroundColor = UIColor(red: 1, green: 1, blue: 1, alpha: 1.0) /* #ffffff */circle42View.layer.cornerRadius = 200*0.0616/2circle42View.clipsToBounds = truerectBlueView.addSubview(circle42View)var circle43 = CGRect(x:200*0.0633*6 - 6.33 ,y:200*0.0538*8 - 5.38,width:200*0.0616,height:200*0.0616)let circle43View = UIView(frame: circle43)circle43View.backgroundColor = UIColor(red: 1, green: 1, blue: 1, alpha: 1.0) /* #ffffff */circle43View.layer.cornerRadius = 200*0.0616/2circle43View.clipsToBounds = truerectBlueView.addSubview(circle43View)var circle44 = CGRect(x:200*0.0633*8 - 6.33 ,y:200*0.0538*8 - 5.38,width:200*0.0616,height:200*0.0616)let circle44View = UIView(frame: circle44)circle44View.backgroundColor = UIColor(red: 1, green: 1, blue: 1, alpha: 1.0) /* #ffffff */circle44View.layer.cornerRadius = 200*0.0616/2circle44View.clipsToBounds = truerectBlueView.addSubview(circle44View)var circle45 = CGRect(x:200*0.0633*10 - 6.33 ,y:200*0.0538*8 - 5.38,width:200*0.0616,height:200*0.0616)let circle45View = UIView(frame: circle45)circle45View.backgroundColor = UIColor(red: 1, green: 1, blue: 1, alpha: 1.0) /* #ffffff */circle45View.layer.cornerRadius = 200*0.0616/2circle45View.clipsToBounds = truerectBlueView.addSubview(circle45View)backgroundView