'**SUMMARY**
This method returns the visual representation (swatches) of the palette in an image. The palette
is orientated either horizontally or vertically, and each color is given an area
proportional to the number of pixels that have that color in the image. The palette
is arranged as it is returned from the clustering algorithm. When size is left
to its default value, the palette size will match the size of the
orientation, and then be 10% of the other dimension. E.g. if our image is 640X480 the horizontal
palette will be (640x48) likewise the vertical palette will be (480x64)
If a Hue palette is used this method will return a grayscale palette.
**PARAMETERS**
* *bins* - an integer number of bins into which to divide the colors in the image.
* *hue* - if hue is true we do only cluster on the image hue values.
* *size* - The size of the generated palette as a (width,height) tuple, if left default we select
a size based on the image so it can be nicely displayed with the
image.
* *horizontal* - If true we orientate our palette horizontally, otherwise vertically.
**RETURNS**
A palette swatch image.
**EXAMPLE**
>>> p = img1.drawPaletteColors()
>>> img2 = img1.sideBySide(p,side="bottom")
>>> img2.show()
**NOTES**
The hue calculations should be siginificantly faster than the generic RGB calculation as
it works in a one dimensional space. Sometimes the underlying scipy method freaks out
about k-means initialization with the following warning:
.. Warning::
One of the clusters is empty. Re-run kmean with a different initialization.
This shouldn\'t be a real problem.
**SEE ALSO**
:py:meth:`rePalette`
:py:meth:`drawPaletteColors`
:py:meth:`palettize`
:py:meth:`getPalette`
:py:meth:`binarizeFromPalette`
:py:meth:`findBlobsFromPalette`'

def drawPaletteColors(self, size=((-1), (-1)), horizontal=True, bins=10, hue=False):

    self._generatePalette(bins, hue)
    retVal = None
    if (not hue):
        if horizontal:
            if ((size[0] == (-1)) or (size[1] == (-1))):
                size = (int(self.width), int((self.height * 0.1)))
            pal = cv.CreateImage(size, cv.IPL_DEPTH_8U, 3)
            cv.Zero(pal)
            idxL = 0
            idxH = 0
            for i in range(0, bins):
                idxH = np.clip((idxH + (self._mPalettePercentages[i] * float(size[0]))), 0, (size[0] - 1))
                roi = (int(idxL), 0, int((idxH - idxL)), size[1])
                cv.SetImageROI(pal, roi)
                color = np.array((float(self._mPalette[i][2]), float(self._mPalette[i][1]), float(self._mPalette[i][0])))
                cv.AddS(pal, color, pal)
                cv.ResetImageROI(pal)
                idxL = idxH
            retVal = Image(pal)
        else:
            if ((size[0] == (-1)) or (size[1] == (-1))):
                size = (int((self.width * 0.1)), int(self.height))
            pal = cv.CreateImage(size, cv.IPL_DEPTH_8U, 3)
            cv.Zero(pal)
            idxL = 0
            idxH = 0
            for i in range(0, bins):
                idxH = np.clip((idxH + (self._mPalettePercentages[i] * size[1])), 0, (size[1] - 1))
                roi = (0, int(idxL), size[0], int((idxH - idxL)))
                cv.SetImageROI(pal, roi)
                color = np.array((float(self._mPalette[i][2]), float(self._mPalette[i][1]), float(self._mPalette[i][0])))
                cv.AddS(pal, color, pal)
                cv.ResetImageROI(pal)
                idxL = idxH
            retVal = Image(pal)
    elif horizontal:
        if ((size[0] == (-1)) or (size[1] == (-1))):
            size = (int(self.width), int((self.height * 0.1)))
        pal = cv.CreateImage(size, cv.IPL_DEPTH_8U, 1)
        cv.Zero(pal)
        idxL = 0
        idxH = 0
        for i in range(0, bins):
            idxH = np.clip((idxH + (self._mPalettePercentages[i] * float(size[0]))), 0, (size[0] - 1))
            roi = (int(idxL), 0, int((idxH - idxL)), size[1])
            cv.SetImageROI(pal, roi)
            cv.AddS(pal, float(self._mPalette[i]), pal)
            cv.ResetImageROI(pal)
            idxL = idxH
        retVal = Image(pal)
    else:
        if ((size[0] == (-1)) or (size[1] == (-1))):
            size = (int((self.width * 0.1)), int(self.height))
        pal = cv.CreateImage(size, cv.IPL_DEPTH_8U, 1)
        cv.Zero(pal)
        idxL = 0
        idxH = 0
        for i in range(0, bins):
            idxH = np.clip((idxH + (self._mPalettePercentages[i] * size[1])), 0, (size[1] - 1))
            roi = (0, int(idxL), size[0], int((idxH - idxL)))
            cv.SetImageROI(pal, roi)
            cv.AddS(pal, float(self._mPalette[i]), pal)
            cv.ResetImageROI(pal)
            idxL = idxH
        retVal = Image(pal)
    return retVal
