'Generate a new palette as a subset of a given palette.
Given an input ``palette``, take ``n`` colors from it by dividing its
length into ``n`` (approximately) evenly spaced indices.
Args:
palette (list[str]) : a list of hex RGB color strings
n (int) : the size of the output palette to generate
Returns:
list [str] : a list of hex RGB color strings
Raises:
``ValueError`` if ``n > len(palette)``'

def linear_palette(self, palette, n):

    import math
    import numpy as np
    if (n > len(palette)):
        raise ValueError(("Requested    %(r)s    colors,    function    can    only    return    colors    up    to    the    base    palette's    length    (%(l)s)" % dict(r=n, l=len(palette))))
    return [palette[int(math.floor(i))] for i in np.linspace(0, (len(palette) - 1), num=n)]
