gboolean go_xml_node_get_gocolor (xmlNodePtr node, char const *name, GOColor *res) { xmlChar *color; int r, g, b; color = xmlGetProp (node, CC2XML (name)); if (color == NULL) return FALSE; if (sscanf (CXML2C (color), "%X:%X:%X", &r, &g, &b) == 3) { r >>= 8; g >>= 8; b >>= 8; *res = GO_COLOR_FROM_RGBA (r,g,b,0xff); xmlFree (color); return TRUE; }
} GOColorPaletteClass; #define COLOR_PREVIEW_WIDTH 12 #define COLOR_PREVIEW_HEIGHT 12 #define CCW_KEY "GOColorPalette::ccw" enum { COLOR_CHANGED, DISPLAY_CUSTOM_DIALOG, LAST_SIGNAL }; static GONamedColor const default_color_set [] = { /* xgettext: See https://bugzilla.gnome.org/attachment.cgi?id=222905 */ { GO_COLOR_FROM_RGBA (0x00, 0x00, 0x00, 0xff), N_("black")}, { GO_COLOR_FROM_RGBA (0x99, 0x33, 0x00, 0xff), N_("light brown")}, { GO_COLOR_FROM_RGBA (0x33, 0x33, 0x00, 0xff), N_("brown gold")}, { GO_COLOR_FROM_RGBA (0x00, 0x33, 0x00, 0xff), N_("dark green #2")}, { GO_COLOR_FROM_RGBA (0x00, 0x33, 0x66, 0xff), N_("navy")}, { GO_COLOR_FROM_RGBA (0x00, 0x00, 0x80, 0xff), N_("dark blue")}, { GO_COLOR_FROM_RGBA (0x33, 0x33, 0x99, 0xff), N_("purple #2")}, { GO_COLOR_FROM_RGBA (0x33, 0x33, 0x33, 0xff), N_("very dark gray")}, { GO_COLOR_FROM_RGBA (0x80, 0x00, 0x00, 0xff), N_("dark red")}, { GO_COLOR_FROM_RGBA (0xFF, 0x66, 0x00, 0xff), N_("red-orange")}, { GO_COLOR_FROM_RGBA (0x80, 0x80, 0x00, 0xff), N_("gold")}, { GO_COLOR_FROM_RGBA (0x00, 0x80, 0x00, 0xff), N_("dark green")}, { GO_COLOR_FROM_RGBA (0x00, 0x80, 0x80, 0xff), N_("dull blue")}, { GO_COLOR_FROM_RGBA (0x00, 0x00, 0xFF, 0xff), N_("blue")}, { GO_COLOR_FROM_RGBA (0x66, 0x66, 0x99, 0xff), N_("dull purple")},
GnmColor * gnm_color_new_rgba8 (guint8 red, guint8 green, guint8 blue, guint8 alpha) { return gnm_color_new_go (GO_COLOR_FROM_RGBA (red, green, blue, alpha)); }