Recognizing dark theme in GTK3

Hi Folks,

Definitely expected of Xojo’s GTK3 framework glue, but does anyone have a pointer to where we can look to determine if the Linux theme is dark? I have the icons for my TaskBar app set, but I can’t find any GTK3 docs on recognizing the light or dark state of the user’s theme.

After much additional searching, it seems that automatic detection is not something that the GTK3 designers put in place. Here’s a bit of code I found on a deep dive:

[code]gint textAvg, bgAvg;
textAvg = style->text[GTK_STATE_NORMAL].red / 256 +
style->text[GTK_STATE_NORMAL].green / 256 +
style->text[GTK_STATE_NORMAL].blue / 256;

bgAvg = style->bg[GTK_STATE_NORMAL].red / 256 +
        style->bg[GTK_STATE_NORMAL].green / 256 +
        style->bg[GTK_STATE_NORMAL].blue / 256;

if (textAvg > bgAvg)
	darkTheme = TRUE;[/code]

Does anyone have a way to pull the default style values in Xojo to get the RGB values from the GTK3 API?