You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Have you thought about providing custom domains for the presets, similar to how d3-color does it, unless there's a different way of doing this with colorgrad-rs? Something along the lines of...
// map t from range [a, b] to range [0, 1]fnnorm(t:f64,a:f64,b:f64) -> f64{(t-a)*(1.0 / (b-a))}let grad = colorgrad::rainbow();// domain is from -100 to 100.
grad.at(norm(0.0, -100.0,100.0));// domain is from 0 to 50.
grad.at(norm(0.0,0.0,50.0));
As there is a domain that is used internally, I wonder if you'd be open to an API to allow it to be configured. It would be helpful from an API perspective, where you have a gradient stored and used in lots of place. The current options as you say is to either interpolate the values on each call, or create a proxy to it.
👋 Thanks for the library.
Have you thought about providing custom domains for the presets, similar to how d3-color does it, unless there's a different way of doing this with colorgrad-rs? Something along the lines of...
The text was updated successfully, but these errors were encountered: