diff options
| author | Peter Moulder <peter.moulder@monash.edu> | 2006-03-13 06:51:37 +0000 |
|---|---|---|
| committer | pjrm <pjrm@users.sourceforge.net> | 2006-03-13 06:51:37 +0000 |
| commit | 196cddb400cfc98df0f159773ec18f40effd363c (patch) | |
| tree | 790b50b1e96dfbb8a4b197a89dfc088ae12aeb79 /src/style.cpp | |
| parent | CodingStyle: whitespace (diff) | |
| download | inkscape-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.cpp | 9 |
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; } |
