
# 
# This file has been automatically generated by RaQt_maker V0.0.5.
# To modify and regenerate it, see the source code available here: 
#         https://github.com/yguillemot/RaQt_maker
# 

use NativeCall;
use Qt::QtWidgets::QtHelpers:ver<0.0.5>:auth<cpan:YGUILLEMO>:api<2>;
use Qt::QtWidgets::QtWrappers:ver<0.0.5>:auth<cpan:YGUILLEMO>:api<2>;
use Qt::QtWidgets::Qt:ver<0.0.5>:auth<cpan:YGUILLEMO>:api<2>;
use Qt::QtWidgets::QtBase:ver<0.0.5>:auth<cpan:YGUILLEMO>:api<2>;



class QColor:ver<0.0.5>:auth<cpan:YGUILLEMO>:api<2>
    is QtBase
    is export {

    multi sub ctor(QtBase $this, Qt::GlobalColor $color) {
        $this.address = QWQColorCtor_2($color);
        $this.ownedByRaku = True;
    }

    multi sub ctor(QtBase $this, Int $r, Int $g, Int $b, Int $a = 255) {
        $this.address = QWQColorCtor_3($r, $g, $b, $a);
        $this.ownedByRaku = True;
    }

    multi sub ctor(QtBase $this, NativeCall::Types::Pointer $p, Bool :$obr = False) {
        # Get access to a preexisting Qt object
        $this.address = $p;
        $this.ownedByRaku = $obr;
    }

    multi sub ctor(|capture) {
        note "QtWidgets ", ::?CLASS.^name,
             " ctor called with unsupported args";
        die "Bad args";
    }

    submethod new(|capture) {
        my QColor $rObj = self.bless;
        ctor($rObj, |capture);
        return $rObj;
    }

    submethod DESTROY {
        if self.ownedByRaku {
            QWQColorDtor(self.address);
            self.ownedByRaku = False;
        }
    }

    method alpha( --> Int)
    {
        my $result = QWQColoralpha(self.address);
        return $result;
    }

    method red( --> Int)
    {
        my $result = QWQColorred(self.address);
        return $result;
    }

    method green( --> Int)
    {
        my $result = QWQColorgreen(self.address);
        return $result;
    }

    method blue( --> Int)
    {
        my $result = QWQColorblue(self.address);
        return $result;
    }

}


sub QWQColorCtor_2(int32)
    returns Pointer is native(&libwrapper) { * }

sub QWQColorCtor_3(int32, int32, int32, int32)
    returns Pointer is native(&libwrapper) { * }

sub QWQColorDtor(Pointer)
    is native(&libwrapper) { * }

sub QWQColoralpha(Pointer)
    returns int32 is native(&libwrapper) { * }

sub QWQColorred(Pointer)
    returns int32 is native(&libwrapper) { * }

sub QWQColorgreen(Pointer)
    returns int32 is native(&libwrapper) { * }

sub QWQColorblue(Pointer)
    returns int32 is native(&libwrapper) { * }

