diff options
| author | Jon A. Cruz <jon@joncruz.org> | 2007-09-25 02:54:32 +0000 |
|---|---|---|
| committer | joncruz <joncruz@users.sourceforge.net> | 2007-09-25 02:54:32 +0000 |
| commit | ba9fad5667d32413d00b2b628c305bdb5bd129de (patch) | |
| tree | aa0bcfd18d50709f953e7c0d023b2ed3eb0e016d /src/desktop-style.cpp | |
| parent | Fixed const (diff) | |
| download | inkscape-ba9fad5667d32413d00b2b628c305bdb5bd129de.tar.gz inkscape-ba9fad5667d32413d00b2b628c305bdb5bd129de.zip | |
Initial support for icc color selection including CMYK
(bzr r3794)
Diffstat (limited to 'src/desktop-style.cpp')
| -rw-r--r-- | src/desktop-style.cpp | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/src/desktop-style.cpp b/src/desktop-style.cpp index b1dca7f17..236130173 100644 --- a/src/desktop-style.cpp +++ b/src/desktop-style.cpp @@ -40,6 +40,7 @@ #include "sp-path.h" #include "desktop-style.h" +#include "svg/svg-icc-color.h" /** * Set color on selection on desktop. @@ -55,7 +56,7 @@ sp_desktop_set_color(SPDesktop *desktop, ColorRGBA const &color, bool is_relativ guint32 rgba = SP_RGBA32_F_COMPOSE(color[0], color[1], color[2], color[3]); gchar b[64]; - sp_svg_write_color(b, 64, rgba); + sp_svg_write_color(b, sizeof(b), rgba); SPCSSAttr *css = sp_repr_css_attr_new(); if (fill) { sp_repr_css_set_property(css, "fill", b); @@ -424,6 +425,8 @@ objects_query_fillstroke (GSList *objects, SPStyle *style_res, bool const isfill bool paintImpossible = true; paint_res->set = TRUE; + SVGICCColor* iccColor = 0; + bool iccSeen = false; gfloat c[4]; c[0] = c[1] = c[2] = c[3] = 0.0; gint num = 0; @@ -502,9 +505,17 @@ objects_query_fillstroke (GSList *objects, SPStyle *style_res, bool const isfill prev[1] = d[1]; prev[2] = d[2]; paint_res->setColor(d[0], d[1], d[2]); + iccColor = paint->value.color.icc; + iccSeen = true; } else { if (same_color && (prev[0] != d[0] || prev[1] != d[1] || prev[2] != d[2])) same_color = false; + if ( iccSeen ) { + if(paint->value.color.icc) { + // TODO fix this + iccColor = 0; + } + } } // average color @@ -543,6 +554,14 @@ objects_query_fillstroke (GSList *objects, SPStyle *style_res, bool const isfill } else { style_res->stroke_opacity.value = SP_SCALE24_FROM_FLOAT (c[3]); } + + + if ( iccSeen && iccColor ) { + // TODO check for existing + SVGICCColor* tmp = new SVGICCColor(*iccColor); + paint_res->value.color.icc = tmp; + } + if (num > 1) { if (same_color) return QUERY_STYLE_MULTIPLE_SAME; |
