def METHOD_NAME(self, hist, percentile=90, width=200, height=50):
    # curate histogram
    ind = np.argsort(-hist)
    ind = ind[hist[ind] > np.percentile(hist, percentile)]
    hist = hist[ind] / hist[ind].sum()
    # draw palette
    nums = np.array(hist * width, dtype=int)
    array = np.vstack([
        np.tile(np.array(u), (v, 1)) for u, v in zip(self.rgb[ind], nums)
    ])
    array = np.tile(array[np.newaxis, :, :], (height, 1, 1))
    if array.shape[1] < width:
        array = np.concatenate(
            [array, np.zeros((height, width - array.shape[1], 3))], axis=1)
    return array