summaryrefslogtreecommitdiffstats
path: root/src/widgets
diff options
context:
space:
mode:
authorFelipe Corr??a da Silva Sanches <juca@members.fsf.org>2009-12-07 03:19:44 +0000
committerFelipe C. da S. Sanches <juca@members.fsf.org>2009-12-07 03:19:44 +0000
commit335460908708e5a039392f6213d303551a0090f9 (patch)
tree9431f22f0f6e0eb6b75118f0f1b2b9e8670cf6de /src/widgets
parentAdded UI for threading pref in Filter Preferences for Gaussian Blur, default ... (diff)
downloadinkscape-335460908708e5a039392f6213d303551a0090f9.tar.gz
inkscape-335460908708e5a039392f6213d303551a0090f9.zip
This commit hooks device-cmyk handling to color pickers. Now we have basic initial support for SVG Color 1.2 uncalibrated device colors:
http://www.w3.org/TR/2009/WD-SVGColor12-20091001/#device Fixed bugs: - https://launchpad.net/bugs/444021 (bzr r8875)
Diffstat (limited to 'src/widgets')
-rw-r--r--src/widgets/sp-color-scales.cpp26
1 files changed, 21 insertions, 5 deletions
diff --git a/src/widgets/sp-color-scales.cpp b/src/widgets/sp-color-scales.cpp
index a09a3a2ed..e41b81e5c 100644
--- a/src/widgets/sp-color-scales.cpp
+++ b/src/widgets/sp-color-scales.cpp
@@ -11,6 +11,7 @@
#include "../dialogs/dialog-events.h"
#include "sp-color-scales.h"
#include "svg/svg-icc-color.h"
+#include "svg/svg-device-color.h"
#define CSC_CHANNEL_R (1 << 0)
#define CSC_CHANNEL_G (1 << 1)
@@ -231,6 +232,12 @@ void ColorScales::_recalcColor( gboolean changing )
case SP_COLOR_SCALES_MODE_CMYK:
{
_getCmykaFloatv( c );
+ color.device = new SVGDeviceColor();
+ color.device->type=DEVICE_CMYK;
+ color.device->colors.clear();
+ for (int i=0;i<4;i++){
+ color.device->colors.push_back(c[i]);
+ }
float rgb[3];
sp_color_cmyk_to_rgb_floatv( rgb, c[0], c[1], c[2], c[3] );
@@ -475,11 +482,20 @@ void ColorScales::setMode(SPColorScalesMode mode)
gtk_widget_show (_s[4]);
gtk_widget_show (_b[4]);
_updating = TRUE;
- sp_color_rgb_to_cmyk_floatv (c, rgba[0], rgba[1], rgba[2]);
- setScaled( _a[0], c[0] );
- setScaled( _a[1], c[1] );
- setScaled( _a[2], c[2] );
- setScaled( _a[3], c[3] );
+
+ if (_color.device && _color.device->type == DEVICE_CMYK){
+ setScaled( _a[0], _color.device->colors[0] );
+ setScaled( _a[1], _color.device->colors[1] );
+ setScaled( _a[2], _color.device->colors[2] );
+ setScaled( _a[3], _color.device->colors[3] );
+ } else {
+ //If we still dont have a device-color, convert from rbga
+ sp_color_rgb_to_cmyk_floatv (c, rgba[0], rgba[1], rgba[2]);
+ setScaled( _a[0], c[0] );
+ setScaled( _a[1], c[1] );
+ setScaled( _a[2], c[2] );
+ setScaled( _a[3], c[3] );
+ }
setScaled( _a[4], rgba[3] );
_updating = FALSE;
_updateSliders( CSC_CHANNELS_ALL );