I know we should answer based on your requirements, but in this case, your requirements may be wrong.
Let me explain.
there are 20 levels of priority.
You can not have 20 levels of priority!
Here are some reasons.
Give priority to ways of giving categories to humans can detect and compare, and then perform certain actions according to this value of rank, urgency, etc.
Humans struggle if you have more than 6-8 categories. Of course, you can have subcategories but for particular purposes such as searches and classifications.
Imagine the priorities translated into words.
- Very high.
- Very high.
- Not so high
- Low to medium
- Down up
- Lower average
- Lower than the previous one …
I have just 10 and it is not logical at all.
2) Adjacent colors
Yes, humans can perceive many colors … But when they compare them.
You can have two shades of green one next to each other and see if one is "lighter" than the others.
But suppose you have to scroll a little. Now you have another similar green … But I'm sure you will not know if it's clearer, darker or equal to the previous one.
3) Color names
Case similar to "1". I can hardly name colors
- Brown … do you know that brown is a dark orange? What a night?
4) Colors – Lighter
"Lighter" is a delicate adjective.
Here are some circles with two lighter greens on each side … But different lighter. We are more yellowish. In painting, this shift is used to represent a lighter more "correct at the level of perception".
Points 3 and 4 complicate the classification because the color is a three-dimensional model. And the priorities are one-dimensional.
using shades of a single color
Suppose you use only one shade of red.
Here is a uniform gradient bar with a small bar 10% wide on each side. A pure red and the other pure white.
You can barely see the bar on the left but you can see a lot better the bar on the right.
Human perception of light is logarithmic and nonlinear. You notice the difference between #FFF vs #FEE better than # F00 vs # E00.
But combine that with point 2 and you can not see many of these differences.
- Light red
- Just light red
1) See Dave Haigh's proposal for just using 4-6 colors.
2) You have alternatives for other sub-levels of "priorities" such as position. The most important are more important than the lowest ones.
Is this square lighter, darker or the same as the top one?
Coxy commented on something interesting. Red-orange-yellow is a sort of well-established sequence. But if you have for some reason a green and blue color, it's probably hard to say which one has a lower priority.
Probably make a yellowish green can help instead of dark green.
Here are some other options for color schemes.
The latter is probably better for some types of color blindness.
Published a little later: An interesting example of how colors are not the clearest priority example is that inclusive DEFCON has priority 4 and 5 mixed colors. Sometimes 4 is blue and 5 green and sometimes it is the reverse.