Once a style is retrieved, a color hex value from the style can be converted to a GdkColor with
gboolean gdk_color_parse (const gchar *spec,
GdkColor *color);
The GdkColor is
struct GdkColor
{
gulong pixel;
gushort red;
gushort green;
gushort blue;
};
The red, green and blue values can be divided by 65535 to get a percentage value that can then be applied to a cairo_set_source_rgba(cr, 1.0, 1.0, 1.0, 1.0) call, as in
cairo_set_source_rgba(cr, color.red/65535, color.green/65535, color.blue/65535, 1.0);
The actual colors to use should be computed from the style either when the _init() function is called (if the style is available then) or from the _expose() call. Appropriate defaults (re: white) should be used if the expected style setting is not found or is not set.
This can be tested with the pigtk app using the -T argument which will load the data/gtkrc file.