diff options
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; } |
