-
Notifications
You must be signed in to change notification settings - Fork 485
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
RemoveColormap API function added #344
Conversation
any chance to get this into the master branch? (then I could put my submodules on the github master again instead of keeping my own repo) |
Hey @ToppDev -- so sorry I've let this go unattended for this long. I'm ready to get this merged. There's one issue, however. As it is currently implemented, the current I have two possible solutions:
I think I am leaning toward (2), but I'm curious to hear your thoughts. |
Hey, sorry for also coming back late at you. I also think your second solution sounds better. While the first solution is probably cleaner, it would affect a lot of code. It also would break the compatibility to e.g. IMPLOT_AUTO as you mentioned and even if we choose a different value, it would be not as intuitive for the user I guess. I will try implementing the second solution till next week and see how much code is affected by it |
591b976
to
b47c8ba
Compare
so I looked into the problem some more. Therefore I actually wondered if it is the task of the library to ensure, that if the user decided to store a colormap index, that the index keeps the same. I made a commit so that the Style Editor correctly decrements the What do you think about this? |
I think this would be a bad choice and would cause several headaches down the road. I am stilll in favor of (2) described above, or not supporting this particular feataure until we have a better alternative. As I imagine the typical need for RemoveColormap is to replace an existing colormap with new colors, what if we instead provided a mechanism to "update" a colormap or replace colors in an already existing colormap? |
Somewhat to this, I recently had the idea that it would be neat if a reversed colormap could be specificied by negating the value of a |
1 similar comment
Somewhat to this, I recently had the idea that it would be neat if a reversed colormap could be specificied by negating the value of a |
Sorry to also leave this unattended for so long. I do not really have time to continue this, as it become a bigger problem than I anticipated at the start. Thanks for your guidance though @epezent |
Following up on #341 I implemented the feature.
There are 2 issues I would like your input with:
IMPLOT_CMAP_COUNT_BUILT_IN
directly above theInitialize
function. However there might be a better place to put it, to fit into the library structure.RebuildTables
function at the end. That was kinda out of laziness from my side. If you prefer it, I can still implement avoid _RemoveTable(ImPlotColormap cmap)
function which only removes the needed entries.