yannickl/YLProgressBar

Any way to specify gradient colors that don't compress?

Closed this issue · 4 comments

For instance, i have a progress bar that i want to go from blue to yellow to red. I specify _progressBar.progressTintColors = @[[UIColor bluecolor], [UIColor yellowColor], [UIColor redColor]] and then set it to 50%.

I get this:

|-blue.yellow.red-----------|

When I'd really like it to be:

|-blue.....yellow------------|

So the gradient colors are more of an indication of where the progress bar is at... you wouldn't see red at 50%, only blue to yellow. at 75% you'd see blue, yellow, and half of the gradient of yellow to red.

Does that make sense? Wondering if that's possible with the current codebase and if so, how would I achieve it?

Hi Mark,

Unfortunately this is the "normal" behaviour.

I had already thought about adding this feature, but I never took the time to do it yet. I'll add this feature asap.

Thank you

Thanks @yannickl. I wound up looking at a different component that does this, however, I like that this one is a lot more comprehensive. I've already submitted some pull requests to fix a few things and add some features to the other component. https://www.cocoacontrols.com/controls/amgprogressview

Oh nice! I just looked at the commit and it looks great! I'll try it out and let you know how t goes!

Thank you for the compliment. 👍

Please close the issue if everything is ok.