    /**
     * Calculate the luma of a color. Luma is weighted sum of gamma-adjusted
     * R'G'B' components of a color. The result is similar to qGray.
     * 
     * KColorUtils::darken(), KColorUtils::lighten() and KColorUtils::shade()
     * operate on the luma of a color.
     * 
     * @see http://en.wikipedia.org/wiki/Luma_(video)
     */
    KDEUI_EXPORT qreal luma(const QColor&);

    /**
     * Calculate the contrast between two colors, which is defined as the
     * difference in their luma components.
     *
     * @see KColorUtils::luma
     */
    KDEUI_EXPORT qreal contrast(const QColor&, const QColor&);

    /**
     * Adjust the luma of a color by changing its distance from white.
     *
     * @li amount == 1.0 gives white
     * @li amount == 0.5 results in a color whose luma is halfway between 1.0
     * and that of the original color
     * @li amount == 0.0 gives the original color
     * @li amount == -1.0 gives a color that is 'twice as far from white' as
     * the original color, that is luma(result) == 1.0 - 2*(1.0 - luma(color))
     *
     * @param amount factor by which to adjust the luma component of the color
     * @param chromaInverseGain (optional) factor by which to adjust the chroma
     * component of the color; 1.0 means no change, 0.0 maximizes chroma
     * @see KColorUtils::shade
     */
    KDEUI_EXPORT QColor lighten(const QColor&, qreal amount = 0.5, qreal chromaInverseGain = 1.0);

    /**
     * Adjust the luma of a color by changing its distance from black.
     *
     * @li amount == 1.0 gives black
     * @li amount == 0.5 results in a color whose luma is halfway between 0.0
     * and that of the original color
     * @li amount == 0.0 gives the original color
     * @li amount == -1.0 gives a color that is 'twice as far from black' as
     * the original color, that is luma(result) == 2*luma(color)
     *
     * @param amount factor by which to adjust the luma component of the color
     * @param chromaGain (optional) factor by which to adjust the chroma
     * component of the color; 1.0 means no change, 0.0 minimizes chroma
     * @see KColorUtils::shade
     */
    KDEUI_EXPORT QColor darken(const QColor&, qreal amount = 0.5, qreal chromaGain = 1.0);

    /**
     * Adjust the luma and chroma components of a color. The amount is added
     * to the corresponding component.
     *
     * @param lumaAmount amount by which to adjust the luma component of the
     * color
     * @param chromaAmount (optional) amount by which to adjust the chroma
     * component of the color
     */
    KDEUI_EXPORT QColor shade(const QColor&, qreal lumaAmount, qreal chromaAmount = 0.0);
