/*
 * Interface wrapper code.
 *
 * Generated by SIP 4.19.3
 */

#include "sipAPIKGuiAddons.h"

#include <kcolorutils.h>

#include <qcolor.h>
#include <qpainter.h>


extern "C" {static PyObject *meth_KColorUtils_overlayColors(PyObject *, PyObject *);}
static PyObject *meth_KColorUtils_overlayColors(PyObject *, PyObject *sipArgs)
{
    PyObject *sipParseErr = NULL;

    {
        const  ::QColor* a0;
        int a0State = 0;
        const  ::QColor* a1;
        int a1State = 0;
         ::QPainter::CompositionMode a2 = QPainter::CompositionMode_SourceOver;

        if (sipParseArgs(&sipParseErr, sipArgs, "J1J1|E", sipType_QColor, &a0, &a0State, sipType_QColor, &a1, &a1State, sipType_QPainter_CompositionMode, &a2))
        {
             ::QColor*sipRes;

            sipRes = new  ::QColor( ::KColorUtils::overlayColors(*a0,*a1,a2));
            sipReleaseType(const_cast< ::QColor *>(a0),sipType_QColor,a0State);
            sipReleaseType(const_cast< ::QColor *>(a1),sipType_QColor,a1State);

            return sipConvertFromNewType(sipRes,sipType_QColor,NULL);
        }
    }

    /* Raise an exception if the arguments couldn't be parsed. */
    sipNoFunction(sipParseErr, sipName_overlayColors, NULL);

    return NULL;
}


extern "C" {static PyObject *meth_KColorUtils_mix(PyObject *, PyObject *);}
static PyObject *meth_KColorUtils_mix(PyObject *, PyObject *sipArgs)
{
    PyObject *sipParseErr = NULL;

    {
        const  ::QColor* a0;
        int a0State = 0;
        const  ::QColor* a1;
        int a1State = 0;
        double a2 = 0.5;

        if (sipParseArgs(&sipParseErr, sipArgs, "J1J1|d", sipType_QColor, &a0, &a0State, sipType_QColor, &a1, &a1State, &a2))
        {
             ::QColor*sipRes;

            sipRes = new  ::QColor( ::KColorUtils::mix(*a0,*a1,a2));
            sipReleaseType(const_cast< ::QColor *>(a0),sipType_QColor,a0State);
            sipReleaseType(const_cast< ::QColor *>(a1),sipType_QColor,a1State);

            return sipConvertFromNewType(sipRes,sipType_QColor,NULL);
        }
    }

    /* Raise an exception if the arguments couldn't be parsed. */
    sipNoFunction(sipParseErr, sipName_mix, NULL);

    return NULL;
}


extern "C" {static PyObject *meth_KColorUtils_tint(PyObject *, PyObject *);}
static PyObject *meth_KColorUtils_tint(PyObject *, PyObject *sipArgs)
{
    PyObject *sipParseErr = NULL;

    {
        const  ::QColor* a0;
        int a0State = 0;
        const  ::QColor* a1;
        int a1State = 0;
        double a2 = 0.3;

        if (sipParseArgs(&sipParseErr, sipArgs, "J1J1|d", sipType_QColor, &a0, &a0State, sipType_QColor, &a1, &a1State, &a2))
        {
             ::QColor*sipRes;

            sipRes = new  ::QColor( ::KColorUtils::tint(*a0,*a1,a2));
            sipReleaseType(const_cast< ::QColor *>(a0),sipType_QColor,a0State);
            sipReleaseType(const_cast< ::QColor *>(a1),sipType_QColor,a1State);

            return sipConvertFromNewType(sipRes,sipType_QColor,NULL);
        }
    }

    /* Raise an exception if the arguments couldn't be parsed. */
    sipNoFunction(sipParseErr, sipName_tint, NULL);

    return NULL;
}


extern "C" {static PyObject *meth_KColorUtils_shade(PyObject *, PyObject *);}
static PyObject *meth_KColorUtils_shade(PyObject *, PyObject *sipArgs)
{
    PyObject *sipParseErr = NULL;

    {
        const  ::QColor* a0;
        int a0State = 0;
        double a1;
        double a2 = 0;

        if (sipParseArgs(&sipParseErr, sipArgs, "J1d|d", sipType_QColor, &a0, &a0State, &a1, &a2))
        {
             ::QColor*sipRes;

            sipRes = new  ::QColor( ::KColorUtils::shade(*a0,a1,a2));
            sipReleaseType(const_cast< ::QColor *>(a0),sipType_QColor,a0State);

            return sipConvertFromNewType(sipRes,sipType_QColor,NULL);
        }
    }

    /* Raise an exception if the arguments couldn't be parsed. */
    sipNoFunction(sipParseErr, sipName_shade, NULL);

    return NULL;
}


extern "C" {static PyObject *meth_KColorUtils_darken(PyObject *, PyObject *);}
static PyObject *meth_KColorUtils_darken(PyObject *, PyObject *sipArgs)
{
    PyObject *sipParseErr = NULL;

    {
        const  ::QColor* a0;
        int a0State = 0;
        double a1 = 0.5;
        double a2 = 1;

        if (sipParseArgs(&sipParseErr, sipArgs, "J1|dd", sipType_QColor, &a0, &a0State, &a1, &a2))
        {
             ::QColor*sipRes;

            sipRes = new  ::QColor( ::KColorUtils::darken(*a0,a1,a2));
            sipReleaseType(const_cast< ::QColor *>(a0),sipType_QColor,a0State);

            return sipConvertFromNewType(sipRes,sipType_QColor,NULL);
        }
    }

    /* Raise an exception if the arguments couldn't be parsed. */
    sipNoFunction(sipParseErr, sipName_darken, NULL);

    return NULL;
}


extern "C" {static PyObject *meth_KColorUtils_lighten(PyObject *, PyObject *);}
static PyObject *meth_KColorUtils_lighten(PyObject *, PyObject *sipArgs)
{
    PyObject *sipParseErr = NULL;

    {
        const  ::QColor* a0;
        int a0State = 0;
        double a1 = 0.5;
        double a2 = 1;

        if (sipParseArgs(&sipParseErr, sipArgs, "J1|dd", sipType_QColor, &a0, &a0State, &a1, &a2))
        {
             ::QColor*sipRes;

            sipRes = new  ::QColor( ::KColorUtils::lighten(*a0,a1,a2));
            sipReleaseType(const_cast< ::QColor *>(a0),sipType_QColor,a0State);

            return sipConvertFromNewType(sipRes,sipType_QColor,NULL);
        }
    }

    /* Raise an exception if the arguments couldn't be parsed. */
    sipNoFunction(sipParseErr, sipName_lighten, NULL);

    return NULL;
}


extern "C" {static PyObject *meth_KColorUtils_contrastRatio(PyObject *, PyObject *);}
static PyObject *meth_KColorUtils_contrastRatio(PyObject *, PyObject *sipArgs)
{
    PyObject *sipParseErr = NULL;

    {
        const  ::QColor* a0;
        int a0State = 0;
        const  ::QColor* a1;
        int a1State = 0;

        if (sipParseArgs(&sipParseErr, sipArgs, "J1J1", sipType_QColor, &a0, &a0State, sipType_QColor, &a1, &a1State))
        {
             ::qreal sipRes;

            sipRes =  ::KColorUtils::contrastRatio(*a0,*a1);
            sipReleaseType(const_cast< ::QColor *>(a0),sipType_QColor,a0State);
            sipReleaseType(const_cast< ::QColor *>(a1),sipType_QColor,a1State);

            return PyFloat_FromDouble(sipRes);
        }
    }

    /* Raise an exception if the arguments couldn't be parsed. */
    sipNoFunction(sipParseErr, sipName_contrastRatio, NULL);

    return NULL;
}


extern "C" {static PyObject *meth_KColorUtils_getHcy(PyObject *, PyObject *);}
static PyObject *meth_KColorUtils_getHcy(PyObject *, PyObject *sipArgs)
{
    PyObject *sipParseErr = NULL;

    {
        const  ::QColor* a0;
        int a0State = 0;
        double a1;
        double a2;
        double a3;
        double a4;

        if (sipParseArgs(&sipParseErr, sipArgs, "J1", sipType_QColor, &a0, &a0State))
        {
             ::KColorUtils::getHcy(*a0,&a1,&a2,&a3,&a4);
            sipReleaseType(const_cast< ::QColor *>(a0),sipType_QColor,a0State);

            return sipBuildResult(0,"(dddd)",a1,a2,a3,a4);
        }
    }

    /* Raise an exception if the arguments couldn't be parsed. */
    sipNoFunction(sipParseErr, sipName_getHcy, NULL);

    return NULL;
}


extern "C" {static PyObject *meth_KColorUtils_luma(PyObject *, PyObject *);}
static PyObject *meth_KColorUtils_luma(PyObject *, PyObject *sipArgs)
{
    PyObject *sipParseErr = NULL;

    {
        const  ::QColor* a0;
        int a0State = 0;

        if (sipParseArgs(&sipParseErr, sipArgs, "J1", sipType_QColor, &a0, &a0State))
        {
             ::qreal sipRes;

            sipRes =  ::KColorUtils::luma(*a0);
            sipReleaseType(const_cast< ::QColor *>(a0),sipType_QColor,a0State);

            return PyFloat_FromDouble(sipRes);
        }
    }

    /* Raise an exception if the arguments couldn't be parsed. */
    sipNoFunction(sipParseErr, sipName_luma, NULL);

    return NULL;
}


static PyMethodDef methods_KColorUtils[] = {
    {SIP_MLNAME_CAST(sipName_contrastRatio), meth_KColorUtils_contrastRatio, METH_VARARGS, NULL},
    {SIP_MLNAME_CAST(sipName_darken), meth_KColorUtils_darken, METH_VARARGS, NULL},
    {SIP_MLNAME_CAST(sipName_getHcy), meth_KColorUtils_getHcy, METH_VARARGS, NULL},
    {SIP_MLNAME_CAST(sipName_lighten), meth_KColorUtils_lighten, METH_VARARGS, NULL},
    {SIP_MLNAME_CAST(sipName_luma), meth_KColorUtils_luma, METH_VARARGS, NULL},
    {SIP_MLNAME_CAST(sipName_mix), meth_KColorUtils_mix, METH_VARARGS, NULL},
    {SIP_MLNAME_CAST(sipName_overlayColors), meth_KColorUtils_overlayColors, METH_VARARGS, NULL},
    {SIP_MLNAME_CAST(sipName_shade), meth_KColorUtils_shade, METH_VARARGS, NULL},
    {SIP_MLNAME_CAST(sipName_tint), meth_KColorUtils_tint, METH_VARARGS, NULL}
};


static pyqt5ClassPluginDef plugin_KColorUtils = {
    0,
    0,
    0,
    0
};


sipClassTypeDef sipTypeDef_KGuiAddons_KColorUtils = {
    {
        -1,
        0,
        0,
        SIP_TYPE_SUPER_INIT|SIP_TYPE_NAMESPACE,
        sipNameNr_KColorUtils,
        {0},
        &plugin_KColorUtils
    },
    {
        sipNameNr_KColorUtils,
        {0, 0, 1},
        9, methods_KColorUtils,
        0, 0,
        0, 0,
        {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
    },
    0,
    -1,
    -1,
    0,
    0,
    0,
    0,
    0,
#if PY_MAJOR_VERSION >= 3
    0,
    0,
#else
    0,
    0,
    0,
    0,
#endif
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0
};
