Color widget: add meaningful gradients for numerical variables
What's your use case? There are some widely accepted color conventions that would be useful as a basis for color gradients to visualize numerical variables. In particular, I'm thinking of:
- a transition from red for low numbers to green for high numbers. This makes it easy to interpret scales from bad/wrong to good/correct - for instance review ratings. There is a scale from green to red but in many typical situations this inverse transition doesn't make sense. It does make sense, however, in situations where high values correspond to dangerous or undesirable conditions, e.g., infection rates or strength of earthquakes.
- a transition from blue for low numbers to red for high numbers. This makes it easy to interpret scales from cold/cool to hot/warm, for instance when working with temperatures from weather data.
What's your proposed solution? Several possibilities:
- As with categorical data, make the scales user-configurable by allowing selection of "start color" and "end color" and perhaps points in between
- For each gradient, add the option to invert it (and add a blue-to-red gradient)
- Add some additional, meaningful gradients to the current hard-coded list.
Are there any alternative solutions? In some cases, variables can be discretized and assigned a custom (discretized) color range.
Current palettes are taken from https://colorcet.holoviz.org/, a collection of perceptually uniform palettes. (Actually, probably from https://colorcet.holoviz.org/user_guide/index.html.)
- A long time ago, Orange allowed the user could configure arbitrary gradients. It wasn't very useful (and used), so we removed it. Besides, choosing a start color and end color, and then simply interpolating between them (in which color space?! RGB? HSL?) will, in general, not result in a perceptually uniform palette. The perceived difference between colors may not match the difference in values the represent.
- When discussing your suggestion, we agreed that allowing to invert the existing gradients would make sense and (as far as I remember the code related to palettes) shouldn't be difficult to implement.
- As for additional hard-coded gradients - yes, in principle, for as long as they are justified and of similar quality as cet. We wouldn't like to have dozens and dozens of them.
Allowing to invert the existing gradients would already be a great improvement indeed. Don't know why I was asking for a blue-to-red gradient because I see the there are (more or less) three of them available already (or have they been added since 3.36?)
or have they been added since 3.36
No, they've been there from the beginning. :)