Fix _lp_color_map() out-of-bounds value
Fix _lp_color_map() out-of-bounds value

Also fix custom LP_COLORMAP arrays.

Broken in commit 6961f998b83f491995ce731bd232c5170cf4be5f, the
LP_COLORMAP array is designed to be customized by overriding it in your
config. Since you can assign it with a different size, the
_lp_color_map() function was supposed to adjust its math to map the
scale of the source to the size of the array, but it did this backwards,
which made any arrays much larger or smaller than size 10 just not work
at all. My guess is not many users made a different size array, since in
the 4.5 years since we haven't gotten any bug reports on it.
A good way to test this is simply to assign an array like
    LP_COLORMAP=(1 2 3 4)
and calling _lp_color_map().

Secondly, the passed in value could be off the scale, and the function
would then just return nothing. This fix locks the passed in value to
the bounds of the scale, so it will always return something from the
array (even if the string at that array point is the empty string).
We had lots of bug reports on this one, specifically when the load
average would go off the high end of the scale.

Special thanks to the two co-authors who helped me find the LP_COLORMAP
array bug.

Co-authored-by: Tore Anderson <1ab64d898089821984d9dcaf974e3273aa99a236@fud.no>
Co-authored-by: Markus Gebert <8e31a8e5e4f3a7309d17b479512bb615d7fbd355@users.noreply.github.com>

laurentbardin/liquidprompt,jaesivsm/liquidprompt,milouse/liquidprompt,tsbarnes/liquidprompt,pkkolos/liquidprompt,nojhan/liquidprompt