summaryrefslogtreecommitdiffstats
path: root/src/svg/svg-color.cpp
diff options
context:
space:
mode:
authorbulia byak <buliabyak@gmail.com>2006-10-31 21:21:41 +0000
committerbuliabyak <buliabyak@users.sourceforge.net>2006-10-31 21:21:41 +0000
commitb9aac57805b343c602e06be66bc87ede91ad44de (patch)
tree73f42108a3faf67accb389e0c6c98280bd6c551e /src/svg/svg-color.cpp
parentfix off-by-one error: setting tprec to 6 was actually writing 7 digits (diff)
downloadinkscape-b9aac57805b343c602e06be66bc87ede91ad44de.tar.gz
inkscape-b9aac57805b343c602e06be66bc87ede91ad44de.zip
make svg numeric precision, minimum exponent, and the use of named colors (as well as shortened color triads like #ccc) configurable via prefs
(bzr r1877)
Diffstat (limited to 'src/svg/svg-color.cpp')
-rw-r--r--src/svg/svg-color.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/svg/svg-color.cpp b/src/svg/svg-color.cpp
index db2a89150..57003064a 100644
--- a/src/svg/svg-color.cpp
+++ b/src/svg/svg-color.cpp
@@ -17,6 +17,7 @@
# include "config.h"
#endif
+#include "prefs-utils.h"
#include "svg-color.h"
#include "svg-icc-color.h"
#include <cassert>
@@ -409,7 +410,7 @@ rgb24_to_css(char *const buf, unsigned const rgb24)
strcpy(buf, src);
}
- assert(sp_svg_read_color(buf, 0xff) == (rgb24 << 8));
+ // assert(sp_svg_read_color(buf, 0xff) == (rgb24 << 8));
}
/**
@@ -425,7 +426,11 @@ sp_svg_write_color(gchar *buf, unsigned const buflen, guint32 const rgba32)
g_assert(8 <= buflen);
unsigned const rgb24 = rgba32 >> 8;
- rgb24_to_css(buf, rgb24);
+ if (prefs_get_int_attribute("options.svgoutput", "usenamedcolors", 0)) {
+ rgb24_to_css(buf, rgb24);
+ } else {
+ g_snprintf(buf, buflen, "#%06x", rgb24);
+ }
}
static GHashTable *