kaandedeoglu / KDCircularProgress

A circular progress view with gradients written in Swift
MIT License
1.21k stars 217 forks source link

Not able to set solid color without passing in two colors #69

Closed Maxwell-Thom closed 7 years ago

Maxwell-Thom commented 7 years ago

if i attempt to set the progress bars color using the following:

self.downloadView.downloadProgressBar.set(colors: UIColor(red: 128.0, green: 211.0, blue: 64.0, alpha: 1.0))

The color gets set to white (as you've documented), but if i pass in two colors with very little difference i can get close to a solid color:

self.downloadView.downloadProgressBar.set(colors: UIColor(red: 129.0, green: 211.0, blue: 64.0, alpha: 1.0), .green)

is there another/better way to just set the color to 1 color without a gradient?

kaandedeoglu commented 7 years ago

You actually just set one color for a solid progress.

One problem I see is with your color construction. UIColor takes color values that are 0.0 and 1.0. So divide every value with 256 and you should be fine!

Maxwell-Thom commented 7 years ago

Ahhh duh! of course! Thank you for such a prompt reply!