Gtk2::C...lection(3)
π Gtk2::C...lection β bestie, it's the color picker π
okay so this is the User Contributed Perl Documentation page for Gtk2::ColorSelection, which is just a lil Perl wrapper around GtkColorSelection. iykyk π
β¨ NAME β¨
Gtk2::ColorSelection β it's a wrapper for GtkColorSelection. that's it, that's the whole vibe π
πΈ HIERARCHY πΈ
the family tree, and yes she comes from a long line of icons:
Glib::Object
+----Glib::InitiallyUnowned
+----Gtk2::Object
+----Gtk2::Widget
+----Gtk2::Container
+----Gtk2::Box
+----Gtk2::VBox
+----Gtk2::ColorSelection
π¦ INTERFACES π¦
she also implements these, multi-talented fr fr:
Glib::Object::_Unregistered::AtkImplementorIface
Gtk2::Buildable
Gtk2::Orientable
β METHODS β
okay this is the main character section, let's go π«Ά
widget = Gtk2::ColorSelection->new
makes you a brand new color selection widget. slay. β¨
unsigned = $colorsel->get_current_alpha
reads back the current alpha value. it's an unsigned number bestie.
$colorsel->set_current_alpha ($alpha)
sets the current alpha.
$alpha(unsigned) β the alpha value you wanna set π
color = $colorsel->get_current_color
hands you back the current color as a Gtk2::Gdk::Color.
$colorsel->set_current_color ($color)
sets the current color.
$color(Gtk2::Gdk::Color) β the color to set π¨
boolean = $colorsel->get_has_opacity_control
tells you whether opacity control is on. boolean, so true/false energy.
$colorsel->set_has_opacity_control ($has_opacity)
turns the opacity control on or off.
$has_opacity(boolean) β do we want opacity control or not π
boolean = $colorsel->get_has_palette
asks if a palette is in use.
$colorsel->set_has_palette ($has_palette)
sets whether a palette should be used.
$has_palette(boolean) β palette yes or palette no π
boolean = $colorsel->is_adjusting
are we mid-adjustment? boolean says it all.
list = Gtk2::ColorSelection->palette_from_string ($string)
decodes a palette string and gives you back a list of Gtk2::Gdk::color's.
$string(string) β the string to decode π
(string) = Gtk::ColorSelection->palette_to_string (...)
encodes a palette as a string β super handy for persistent storage, bestie, so your palette doesn't ghost you on restart πΎ
...(list) β ofGtk2::Gdk::Color's for the palette
unsigned = $colorsel->get_previous_alpha
gives you the previous alpha. unsigned, obvi.
$colorsel->set_previous_alpha ($alpha)
sets the previous alpha.
$alpha(unsigned) β the previous alpha you want π
color = $colorsel->get_previous_color
returns the previous color as a Gtk2::Gdk::Color.
$colorsel->set_previous_color ($color)
sets the previous color.
$color(Gtk2::Gdk::Color) β the previous color π
π§ PROPERTIES π§
the properties, with all their flags, no cap:
'current-alpha'(Glib::UInt : default 65535 : readable / writable / private / static-nick / static-blurb) β the current opacity value (0is fully transparent,65535is fully opaque) π'current-color'(Gtk2::Gdk::Color : default undef : readable / writable / private / static-nick / static-blurb) β the current color, literally the whole point'has-opacity-control'(boolean : default false : readable / writable / private / static-nick / static-blurb) β whether the color selector should let you set opacity'has-palette'(boolean : default false : readable / writable / private / static-nick / static-blurb) β whether a palette should be used
π₯ SIGNALS π₯
color-changed(Gtk2::ColorSelection) β fires when the color changes, and honestly? iconic behavior π
π SEE ALSO π
go read these too, bestie, they're the whole friend group:
Gtk2, Glib::Object, Glib::InitiallyUnowned, Gtk2::Object, Gtk2::Widget, Gtk2::Container, Gtk2::Box, Gtk2::VBox
π COPYRIGHT π
Copyright (C) 2003-2011 by the gtk2-perl team.
This software is licensed under the LGPL. See Gtk2 for a full notice.
and that's the whole page, periodt π this was perl v5.42.0, dated 2025-07-25, straight out of the User Contributed Perl Documentation collection. mwah, go pick a cute color πβ¨
π¦ where this page comes from
- fedora 43: perl-Gtk2 1.24993-23.fc43 Β· LicenseRef-Callaway-LGPLv2+
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms