-
Notifications
You must be signed in to change notification settings - Fork 275
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Made fractal algorithms more flexible so that colors can be customized #578
Made fractal algorithms more flexible so that colors can be customized #578
Conversation
…ed to make a combobox
I haven't looked through the code in depth, but one idea could be to have the EffectData take a gradient parameter rather than an enum, so that the effect's API doesn't change if we later add support for a widget that can specify a custom gradient. |
I understand that, but in order to do that we would have to clearly define the public interface of the gradient type, but since this isn't done yet what if we use an enum, and we make the enum-typed property and the gradient type |
Would this prevent writing a unit test since the property is I'm not sure if this is a high enough priority that it needs to be squeezed in right away though - why not take the time to implement a gradient API that you're happy with making public? |
I was thinking that the feature would increase the popularity of the project and maybe bring more contributors, but yeah, we could wait to get it right first. I am almost happy with the methods in my gradient class; although it may need some refinements, like methods for adding new gradient stops and such, changing the collection type (to something to which elements can be added and automatically keeps them sorted), and adding some As for the testing, I think we could do Edit: I've now edited the class as I've described, in such a way that the API won't break if more operations or members are added. Also, the colors in the Julia fractal are now customizable, too. |
…ure, but doing this helped structure the code better
… as it allows us to use more library methods like `BinarySearch`
…ke the tests pass?" This reverts commit 22492f0.
There seems to be some bug that is making the tests fail, even though the fractals look visually OK. I'll be looking into it. Otherwise, issues have been taken care of. |
The problem was a comparison that was supposed to be greater or equal, but was only greater. I think it's ready for merging now. |
Thank you! I think the changes look good 👍 |
It's understandable (and very reasonable) that you want the tests to be deterministic and reproducible.
In any case, I've now made the changes so that everything is deterministic. |
Looks good! Thank you for working on this |
There isn't a gradient control for use in
SimpleEffectDialog
yet, and the gradient type that was used is still undocumented, and isinternal
withinPinta.Effects
. This is intentional, as we have to get it right before making it part of the public API.... but until then we could add a combobox so that the user can choose among a few pre-defined color schemes. What do you think?
Here's with the original colors (which is now the default gradient):
Here's with the same gradient stops but different colors:
Here's with the original colors but different stops: