Gtk2::HSV(3)

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

πŸ’– Gtk2::HSV πŸ’–

okay bestie, so this is Gtk2::HSV β€” the wrapper for GtkHSV, aka the little color wheel widget that lets your users pick a hue, saturation and value like they're on the set of a makeup tutorial. it lives in the User Contributed Perl Documentation section of your manual, and yes, it's giving "I know exactly what color I want and it's not beige." 🎨✨


🌈 HIERARCHY 🌈

the family tree, and honestly the ancestry is long, like a royal bloodline:

Glib::Object
+----Glib::InitiallyUnowned
     +----Gtk2::Object
          +----Gtk2::Widget
               +----Gtk2::HSV

so Gtk2::HSV is a Gtk2::Widget, which is a Gtk2::Object, which is a Glib::InitiallyUnowned, which is a Glib::Object. generations of slay. πŸ‘‘


πŸ¦‹ INTERFACES πŸ¦‹

the vibes it also carries, on top of being itself:

  • Glib::Object::_Unregistered::AtkImplementorIface
  • Gtk2::Buildable

✨ METHODS ✨

widget = Gtk2::HSV->new

make a whole new HSV widget, fresh out the box, no notes. πŸ’…

(h, s, v) = $hsv->get_color

hand over the current color as three values β€” hue, saturation, value. three besties, one color. 🫢

$hsv->set_color ($h, $s, $v)

set the color, obviously. here's what you're feeding it:

  • $h (double)
  • $s (double)
  • $v (double)

(r, g, b) = Gtk2::hsv_to_rgb ($h, $s, $v)

glow-up time: convert hue/sat/value into red/green/blue. this one's a class method on the package, not a method on a widget, so call it like Gtk2::hsv_to_rgb(...). args:

  • $h (double)
  • $s (double)
  • $v (double)

boolean = $hsv->is_adjusting

is the widget mid-adjustment rn? true or false, no in-between. πŸ‘€

(size, ring_width) = $hsv->get_metrics

read out the widget's current measurements: how big it is and how thick the ring is. measuring tape out. πŸ“

$hsv->set_metrics ($size, $ring_width)

set those measurements yourself:

  • $size (integer)
  • $ring_width (integer)

(h, s, v) = Gtk2::rgb_to_hsv ($r, $g, $b)

the reverse transformation, the uno reverse card πŸƒ: red/green/blue go in, hue/sat/value come out. also a package-level function, so Gtk2::rgb_to_hsv(...). args:

  • $r (double)
  • $g (double)
  • $b (double)

πŸ”” SIGNALS πŸ””

  • changed (Gtk2::HSV) β€” fires when the color changes. the main character notification.
  • move (Gtk2::HSV, Gtk2::DirectionType) β€” fires on a directional move, and it hands you a Gtk2::DirectionType so you know which way they went.

πŸŽ€ ENUMS AND FLAGS πŸŽ€

enum Gtk2::DirectionType

six directions, all iconic, all here:

  • 'tab-forward' / GTK_DIR_TAB_FORWARD
  • 'tab-backward' / GTK_DIR_TAB_BACKWARD
  • 'up' / GTK_DIR_UP
  • 'down' / GTK_DIR_DOWN
  • 'left' / GTK_DIR_LEFT
  • 'right' / GTK_DIR_RIGHT

πŸ‘€ SEE ALSO πŸ‘€

go read these next, they're all connected, iykyk:

Gtk2, Glib::Object, Glib::InitiallyUnowned, Gtk2::Object, Gtk2::Widget


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 bestie!! this doc was generated by perl v5.42.0 on 2025-07-25 for Gtk2::HSV(3) β€” go pick a pretty color, you deserve it πŸ’–πŸŒΈβœ¨

πŸ“¦ where this page comes from