Gtk2::C...lection(3)

πŸ“¦
version 1.24993 Β· 2 versions
, in fedora 43

πŸ’– 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) β€” of Gtk2::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 (0 is fully transparent, 65535 is 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 (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