Skip to content

Gdk::RGBA: Add constructor taking doubles r,g,b,a

Daniel Boles requested to merge wip/dboles/rgba-construct-doubles-4 into master

#40

commit fa758097aae26f026cc232897d50a935611afeff
Author: Daniel Boles <dboles.src@gmail.com>
Date:   Sun Dec 16 20:17:03 2018 +0000

    Gdk::RGBA: Add constructor taking doubles r,g,b,a
    
    Enable constructing `Gdk::RGBA`s directly with the desired components as
    fractions, sparing the user from having to do a verbose and error-prone
    2-step 'construction' and also making it far nicer to declare e.g. a
    `std::vector<Gdk::RGBA>` to be used as a palette of colours in an app.
    
    notes:
    
     * I first delegated to `RGBA()` then did `set_rgba()`, but Kjell and I
       agreed initialising directly was better than redundantly reassigning.
    
     * GdkRGBA only has 4 fields, but we included a trailing `,` in RGBA()
       initialising them to 0, which is meaningless, I just do that here too

commit ca99aaf9cfcdbda9cf8189546a83192045048dd1
Author: Daniel Boles <dboles.src@gmail.com>
Date:   Sat Dec 8 13:17:26 2018 +0000

    Gdk::RGBA: Delegate constructors instead of repeat
    
    Instead of repeating the same stanza as RGBA(), just delegate to/call it

Merge request reports