Hi, how I query current color (color of the selected object), fill or stroke, on code? I.e. color of the box in left-bottom-corner "Fill:".
I have read the code (version 0.48.2) and tried this:
SPDesktop *_desktop = SP_ACTIVE_DESKTOP; guint32 color = sp_desktop_get_color(_desktop, true); printf("selected color: %6x\n",color);
But it is always returning 'ff0000'.
** I have found the place which writes text (but not the value) for the tooltip: ui/widget/selected-style.cpp:195 __color[i] = (i == SS_FILL)? (_("Flat color fill")) : (_("Flat color stroke"));
And value is on ui/widget/selected-style.cpp:979 g_snprintf (c_string, 64, "%06x/%.3g", color >> 8, SP_RGBA32_A_F(color));
But I do not see is this correct place at all for accessing it.
-Aapo Rantalainen
participants (1)
-
Aapo Rantalainen