From 196cddb400cfc98df0f159773ec18f40effd363c Mon Sep 17 00:00:00 2001 From: Peter Moulder Date: Mon, 13 Mar 2006 06:51:37 +0000 Subject: (sp_style_write_ipaint): Pretty colour names: use sp_svg_write_color instead of #rrggbb. style-test.cpp: Update unit tests accordingly. (bzr r238) --- src/style.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/style.cpp') diff --git a/src/style.cpp b/src/style.cpp index 3baa1678b..3ed6f335f 100644 --- a/src/style.cpp +++ b/src/style.cpp @@ -3325,12 +3325,13 @@ sp_style_write_ipaint(gchar *b, gint const len, gchar const *const key, return g_snprintf(b, len, "%s:currentColor;", key); } else { switch (paint->type) { - case SP_PAINT_TYPE_COLOR: - return g_snprintf(b, len, "%s:#%06x;", key, sp_color_get_rgba32_falpha(&paint->value.color, 0.0) >> 8); - break; + case SP_PAINT_TYPE_COLOR: { + char color_buf[8]; + sp_svg_write_color(color_buf, sizeof(color_buf), sp_color_get_rgba32_ualpha(&paint->value.color, 0)); + return g_snprintf(b, len, "%s:%s;", key, color_buf); + } case SP_PAINT_TYPE_PAINTSERVER: return g_snprintf(b, len, "%s:url(%s);", key, paint->value.paint.uri); - break; default: break; } -- cgit v1.2.3