I want to create a gradient of N distinct colors ranging from a dark color to a light color, all visually equidistant apart.
Similar like in this answer but for Python instead of R (can only use standard lib though, not eg. numpy).
I'd like a function where I can give as arguments the dark color, e.g. RGB(103,0,13)
, and the light color, e.g. RGB(255,245,240)
, and the number of shades. Similar like the output from ColorBrewer (but there I can't define the two end colors and I am limited to maximum 9 shades).
edit: What I tried so far: convert the RGB values to HLS using colorsys.rgb_to_hls(r, g, b)
and interpolating the Hue between the dark and the light colors.