#include <gtk/gtk.h>
#include <gdk/gdk.h>

void main() {
    GdkRGBA rgba = {0};
    gtk_init(NULL, NULL);
    GtkColorChooser* dialog = (GtkColorChooser*)gtk_color_chooser_dialog_new("", NULL);
    // first color on palette
    gdk_rgba_parse(&rgba, "rgb(239,41,41)");
    // select first palette swatch
    gtk_color_chooser_set_rgba(dialog, &rgba);
    // free palette
    gtk_color_chooser_add_palette(dialog, GTK_ORIENTATION_HORIZONTAL, 1, 1, &rgba);
    // BUG: tries to deselect freed palette swatch
    gtk_color_chooser_set_rgba(dialog, &rgba);
}
