summaryrefslogtreecommitdiffstats
path: root/src/style.cpp
diff options
context:
space:
mode:
authorPeter Moulder <peter.moulder@monash.edu>2006-03-13 06:51:37 +0000
committerpjrm <pjrm@users.sourceforge.net>2006-03-13 06:51:37 +0000
commit196cddb400cfc98df0f159773ec18f40effd363c (patch)
tree790b50b1e96dfbb8a4b197a89dfc088ae12aeb79 /src/style.cpp
parentCodingStyle: whitespace (diff)
downloadinkscape-196cddb400cfc98df0f159773ec18f40effd363c.tar.gz
inkscape-196cddb400cfc98df0f159773ec18f40effd363c.zip
(sp_style_write_ipaint): Pretty colour names: use sp_svg_write_color instead of #rrggbb.
style-test.cpp: Update unit tests accordingly. (bzr r238)
Diffstat (limited to 'src/style.cpp')
-rw-r--r--src/style.cpp9
1 files changed, 5 insertions, 4 deletions
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;
}