How to divide 7 non-continuous result values into 5 legend categories?
You do not have to use shades of the same colour.  You can keep 7 colours if they have sufficient contrast between them.

The "Gradient" and "Indexed" colour schemes of ColorData may be be used to select the 7 colours.

Some examples include.

In Wolfram Language

BarLegend[{#, {0, 7}}, Range@7,
    LegendLabel -&gt; #,
    LegendLayout -&gt; "Row"] &amp; /@
  {"BrightBands", "DarkBands", "Rainbow", "LightTemperatureMap", "TemperatureMap", "ThermometerColors"} //
 Multicolumn[#, 3] &amp;



  


BarLegend[{#, {0, 7}}, Range@7,
    LegendLabel -&gt; Last@ColorData[#, "AlternateNames"] &lt;&gt; " (" &lt;&gt; ToString@# &lt;&gt; ")",
    LegendLayout -&gt; "Row"] &amp; /@
  {96, 109, 110, 111} //
 Multicolumn[#, 2] &amp;



  


The ColorFunctionScaling and ColorFunction options will need to be set to use the scheme.

BarChart[Range@7,
 ColorFunctionScaling -&gt; False,
 ColorFunction -&gt; ColorData[{"TemperatureMap", {0, 7}}]
 ]



  


For a large number of discrete values a "Gradient" colour scheme can be used without restricting the number of contours. 

For example

Plot[x, {x, 0, 41},
    ColorFunctionScaling -&gt; False,
    ColorFunction -&gt; ColorData[{#, {0, 41}}],
    PlotLabel -&gt; #,
    Filling -&gt; Axis,
    PlotLegends -&gt; Automatic,
    ImageSize -&gt; Medium
    ] &amp; /@ {"TemperatureMap", "ThermometerColors"} //
 Column



  


Hope this helps.