summaryrefslogtreecommitdiffstats
path: root/src/widgets/sp-color-notebook.cpp
diff options
context:
space:
mode:
authorFelipe Corr??a da Silva Sanches <juca@members.fsf.org>2009-12-06 03:56:13 +0000
committerFelipe C. da S. Sanches <juca@members.fsf.org>2009-12-06 03:56:13 +0000
commit486a20c1cba4361ede1e8542df98eaf0be2b1e83 (patch)
tree72325178ecd44f9b1f835b0b3255090ec44f4070 /src/widgets/sp-color-notebook.cpp
parentmerging gsoc 2009 color management work by Felipe Sanches (a.k.a. JucaBlues) (diff)
downloadinkscape-486a20c1cba4361ede1e8542df98eaf0be2b1e83.tar.gz
inkscape-486a20c1cba4361ede1e8542df98eaf0be2b1e83.zip
added an icon to the color picker dialog to alert when there is too much ink in a color composition. (i.e. when the sum of color components is greater than 320%)
(bzr r8870)
Diffstat (limited to 'src/widgets/sp-color-notebook.cpp')
-rw-r--r--src/widgets/sp-color-notebook.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/widgets/sp-color-notebook.cpp b/src/widgets/sp-color-notebook.cpp
index be41f5f0f..1870c2960 100644
--- a/src/widgets/sp-color-notebook.cpp
+++ b/src/widgets/sp-color-notebook.cpp
@@ -348,6 +348,14 @@ void ColorNotebook::init()
gtk_widget_set_sensitive (_box_outofgamut, false);
gtk_box_pack_start(GTK_BOX(rgbabox), _box_outofgamut, FALSE, FALSE, 2);
+ _box_toomuchink = gtk_event_box_new ();
+ GtkWidget *toomuchink = gtk_image_new_from_icon_name ("too-much-ink-icon", GTK_ICON_SIZE_SMALL_TOOLBAR);
+ gtk_container_add (GTK_CONTAINER (_box_toomuchink), toomuchink);
+ GtkTooltips *tooltips_toomuchink = gtk_tooltips_new ();
+ gtk_tooltips_set_tip (tooltips_toomuchink, _box_toomuchink, _("Too much ink!"), "");
+ gtk_widget_set_sensitive (_box_toomuchink, false);
+ gtk_box_pack_start(GTK_BOX(rgbabox), _box_toomuchink, FALSE, FALSE, 2);
+
#endif //ENABLE_LCMS
/* Create RGBA entry and color preview */
@@ -520,6 +528,21 @@ void ColorNotebook::_updateRgbaEntry( const SPColor& color, gfloat alpha )
if ( target_profile )
gtk_widget_set_sensitive (_box_outofgamut, target_profile->GamutCheck(color));
}
+
+ /* update too-much-ink icon */
+ gtk_widget_set_sensitive (_box_toomuchink, false);
+ if (color.icc){
+ double ink_sum = 0;
+ for (unsigned int i=0; i<color.icc->colors.size(); i++){
+ ink_sum += color.icc->colors[i];
+ }
+
+ /* Some literature states that when the sum of paint values exceed 320%, it is considered to be a satured color,
+ which means the paper can get too wet due to an excessive ammount of ink. This may lead to several issues
+ such as misalignment and poor quality of printing in general.*/
+ if ( ink_sum > 3.2 )
+ gtk_widget_set_sensitive (_box_toomuchink, true);
+ }
#endif //ENABLE_LCMS
if ( !_updatingrgba )