Changing the color of NSProgressIndicator?

前端 未结 5 920
终归单人心
终归单人心 2020-12-17 21:12

What is the best way to change the color of NSProgressIndicator, is there an easier way than just to subclass it and then draw the whole component by myself?

Basical

5条回答
  •  -上瘾入骨i
    2020-12-17 22:00

    Use "CIFalseColor" filter to get white color and more.

    let colorFilter = CIFilter(name: "CIFalseColor")!
    colorFilter.setDefaults()
    colorFilter.setValue(color1, forKey: "inputColor0")
    colorFilter.setValue(color2, forKey: "inputColor1")
    proggressBar?.contentFilters = [colorFilter]
    

提交回复
热议问题