$drawable is used for the depth and the display (Gtk2::Gdk::Display) for the GC. The GC can then be used with any drawable of the same depth on that display.

$values is a hashref containing some of the following keys,

foreground          Gtk2::Gdk::Color
background          Gtk2::Gdk::Color
font                Gtk2::Gdk::Font
function            Gtk2::Gdk::Function enum
fill                Gtk2::Gdk::Fill enum
tile                Gtk2::Gdk::Pixmap
stipple             Gtk2::Gdk::Pixmap
clip_mask           Gtk2::Gdk::Pixmap
subwindow_mode      Gtk2::Gdk::SubwindowMode enum
ts_x_origin         integer
ts_y_origin         integer
clip_x_origin       integer
clip_y_origin       integer
graphics_exposures  boolean integer 1 or 0
line_width          integer
line_style          Gtk2::Gdk::LineStyle enum
cap_style           Gtk2::Gdk::CapStyle enum
join_style          Gtk2::Gdk::JoinStyle enum

Keys not given get default values. For the foreground and background colour objects only the pixel field is used; the red, green and blue are ignored. For example

my $pixel = 0x123456;
my $color = Gtk2::Gdk::Color->new (0,0,0, $pixel);
my $gc = Gtk2::Gdk::GC->new_with_values
  ($win, { foreground => $color,
           line_style => 'on_off_dash' });

In the foreground and background colour objects returned only the pixel fields are set; the red, green and blue fields are garbage.