'**SUMMARY**
Generate a grayscale or binary mask image based either on a hue or an RGB triplet that can be used
like an alpha channel. In the resulting mask, the hue/rgb_color will be treated as transparent (black).
When a hue is used the mask is treated like an 8bit alpha channel.
When an RGB triplet is used the result is a binary mask.
rgb_thresh is a distance measure between a given a pixel and the mask value that we will
add to the mask. For example, if rgb_color=(0,255,0) and rgb_thresh=5 then any pixel
winthin five color values of the rgb_color will be added to the mask (e.g. (0,250,0),(5,255,0)....)
Invert flips the mask values.
**PARAMETERS**
* *hue* - a hue used to generate the alpha mask.
* *hue_lb* - the upper value  of a range of hue values to use.
* *hue_ub* - the lower value  of a range of hue values to use.
**RETURNS**
A grayscale alpha mask as a SimpleCV Image.
>>> img = Image("lenna")
>>> mask = img.createAlphaMask(hue_lb=50,hue_ub=70)
>>> mask.show()
**SEE ALSO**
:py:meth:`createBinaryMask`
:py:meth:`createAlphaMask`
:py:meth:`applyBinaryMask`
:py:meth:`blit`
:py:meth:`threshold`'

def createAlphaMask(self, hue=60, hue_lb=None, hue_ub=None):

    if ((hue < 0) or (hue > 180)):
        logger.warning('Invalid    hue    color,    valid    hue    range    is    0    to    180.')
    if (self._colorSpace != ColorSpace.HSV):
        hsv = self.toHSV()
    else:
        hsv = self
    h = hsv.getEmpty(1)
    s = hsv.getEmpty(1)
    retVal = hsv.getEmpty(1)
    mask = hsv.getEmpty(1)
    cv.Split(hsv.getBitmap(), h, None, s, None)
    hlut = np.zeros((256, 1), dtype=uint8)
    if ((hue_lb is not None) and (hue_ub is not None)):
        hlut[hue_lb:hue_ub] = 255
    else:
        hlut[hue] = 255
    cv.LUT(h, mask, cv.fromarray(hlut))
    cv.Copy(s, retVal, mask)
    return Image(retVal)
