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
Palettes specify a list of colors. Strictly this is always a specific list, though may of the implemented palettes can create a long list of colors. These are being used at present to choose colors as part of Heatmaps and contours. In these cases, the z-axis values can be a real number, and a sort of interpolation function is being used to get the specific palette color. There are some special cases introduced, for example OverflowColor, which allow warning of specific colors.
In my mind, it's much better instead to have
// ColorFunc associates each float64 value with a color.Color
type ColorFunc func(float64) color.Color
A ColorFunc could use a palette as its underlying color choice. It could use a "threshholded palette", where it uses a palette for some intermediate range and uses warning colors outside of that range. There are many other possible uses, for example, returning a third warning color when the value is NaN, or having a grayscale image with a specific range of float64 returned as red to highlight their locations. It's much more powerful to have a function rather than just a palette with linear indexing, it's more composable because the special cases are located with the choice of color and not the choice of plotter, and (to me at least) it's more conceptually aligned with what's happening.
The text was updated successfully, but these errors were encountered:
Palettes specify a list of colors. Strictly this is always a specific list, though may of the implemented palettes can create a long list of colors. These are being used at present to choose colors as part of Heatmaps and contours. In these cases, the z-axis values can be a real number, and a sort of interpolation function is being used to get the specific palette color. There are some special cases introduced, for example OverflowColor, which allow warning of specific colors.
In my mind, it's much better instead to have
A ColorFunc could use a palette as its underlying color choice. It could use a "threshholded palette", where it uses a palette for some intermediate range and uses warning colors outside of that range. There are many other possible uses, for example, returning a third warning color when the value is NaN, or having a grayscale image with a specific range of float64 returned as red to highlight their locations. It's much more powerful to have a function rather than just a palette with linear indexing, it's more composable because the special cases are located with the choice of color and not the choice of plotter, and (to me at least) it's more conceptually aligned with what's happening.
The text was updated successfully, but these errors were encountered: