/* Copyright (C) 2012 The gtkmm Development Team
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, see <https://www.gnu.org/licenses/>.
 */

#include <gtk/gtk.h>

namespace Gtk
{

Gdk::RGBA ColorChooser::get_rgba() const
{
  GdkRGBA crgba;
  gtk_color_chooser_get_rgba(const_cast<GtkColorChooser*>(gobj()), &crgba);
  return Glib::wrap(&crgba, true);
}

void ColorChooser::add_palette(Orientation orientation, int colors_per_line, const std::vector<Gdk::RGBA>& colors)
{
  gtk_color_chooser_add_palette(gobj(), (GtkOrientation)orientation, colors_per_line, colors.size(),
    Glib::ArrayHandler<Gdk::RGBA, Gdk::RGBATraits>::vector_to_array(colors).data() );
}

} //namespace Gtk
