summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJon A. Cruz <jon@joncruz.org>2006-04-03 08:43:23 +0000
committerjoncruz <joncruz@users.sourceforge.net>2006-04-03 08:43:23 +0000
commit00dac529e81b5142ec1cd6de9eaa7bafc2585f6d (patch)
tree9c604231b7825d4e1a440181fbdbc0b01f5ed266 /src
parentCodingStyle: whitespace (diff)
downloadinkscape-00dac529e81b5142ec1cd6de9eaa7bafc2585f6d.tar.gz
inkscape-00dac529e81b5142ec1cd6de9eaa7bafc2585f6d.zip
initial parsing of icc-color()
(bzr r418)
Diffstat (limited to 'src')
-rw-r--r--src/style.cpp33
1 files changed, 32 insertions, 1 deletions
diff --git a/src/style.cpp b/src/style.cpp
index 3693c5d2b..20ae8fa93 100644
--- a/src/style.cpp
+++ b/src/style.cpp
@@ -2914,7 +2914,38 @@ sp_style_read_ipaint(SPIPaint *paint, gchar const *str, SPStyle *style, SPDocume
++str;
}
if (strneq(str, "icc-color(", 10)) {
- /* fixme: Parse icc-color to paint->iccColor here. */
+ str += 10;
+
+ SVGICCColor* tmp = new SVGICCColor();
+ while ( *str && *str != ' ' && *str!= ',' && *str != ')' ) {
+ tmp->colorProfile += *str++;
+ }
+ while ( g_ascii_isspace(*str) || *str == ',' ) {
+ ++str;
+ }
+
+ while ( *str && *str != ')' ) {
+ if ( g_ascii_isdigit(*str) || *str == '.' ) {
+ gchar* endPtr = 0;
+ gdouble dbl = g_ascii_strtod( str, &endPtr );
+ if ( !errno ) {
+ tmp->colors.push_back( dbl );
+ str = endPtr;
+ } else {
+ delete tmp;
+ tmp = 0;
+ break;
+ }
+
+ while ( tmp && g_ascii_isspace(*str) || *str == ',' ) {
+ ++str;
+ }
+ } else {
+ break;
+ }
+
+ }
+ paint->iccColor = tmp;
}
}
}