fl_color_chooser with alpha channel?

10 views
Skip to first unread message

Gonzalo Garramuño

unread,
May 4, 2023, 6:11:42 AM5/4/23
to fltkg...@googlegroups.com
Does anyone have one?  I want a widget like fl_color_chooser but that
allows picking/typing an alpha channel too.

--
Gonzalo Garramuño
ggar...@gmail.com

Matthias Melcher

unread,
May 4, 2023, 10:46:32 AM5/4/23
to fltk.general
Hmm, I have not compiled it in many years, but it may just work out of the box:
Flmm_ColorA_Chooser.cxx
Flmm_ColorA_Chooser.H
Flmm_ColorA_Button.cxx
Flmm_ColorA_Button.H

Gonzalo Garramuño

unread,
May 4, 2023, 5:44:17 PM5/4/23
to fltkg...@googlegroups.com

El 4/5/23 a las 11:46, 'Matthias Melcher' via fltk.general escribió:
> Hmm, I have not compiled it in many years, but it may just work out of
> the box:
>
Thank you Matthias.  It works fine, with a small change to the include
fl_draw.h to fl_draw.H.

--
Gonzalo Garramuño
ggar...@gmail.com

Greg Ercolano

unread,
May 4, 2023, 8:17:17 PM5/4/23
to fltkg...@googlegroups.com

On 5/4/23 14:44, Gonzalo Garramuño wrote:


El 4/5/23 a las 11:46, 'Matthias Melcher' via fltk.general escribió:
Hmm, I have not compiled it in many years, but it may just work out of the box:

Thank you Matthias.  It works fine, with a small change to the include fl_draw.h to fl_draw.H.


    I was able to get it to work too with 1.4.x; as gga says, just have to fix that fl_draw.h -> fl_draw.H.
    In case anyone's curious what it looks like:


    Apparently one can just call the function flmm_color_a_chooser() to open the
    chooser as a separate window dialog, and it blocks until the user picks something, e.g.

void show_chooser(Fl_Widget*w, void *data) {
    static double r=1,g=1,b=1,a=1;
    int ret;
    ret = flmm_color_a_chooser("Matt's Color Chooser",r,g,b,a);
    printf("Result: %d\n", ret);
    printf("    RGBA: %.2F %.2F %.2F %.2F\n", r,g,b,a);
}


Matthias Melcher

unread,
May 5, 2023, 5:33:52 AM5/5/23
to fltk.general


er...@seriss.com schrieb am Freitag, 5. Mai 2023 um 02:17:17 UTC+2:

   Apparently one can just call the function flmm_color_a_chooser() to open the chooser as a separate window dialog, and it blocks until the user picks something.

It was meant pretty much as a drop-in replacement for fl_color_chooser(), so the APPI is almost the same. 
Reply all
Reply to author
Forward
0 new messages