[gimp] app: undeprecate GimpLevelsTool
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] app: undeprecate GimpLevelsTool
- Date: Sun, 20 May 2018 19:40:46 +0000 (UTC)
commit cdb68d2351c1a1dc551f287b6087730e972b167e
Author: Michael Natterer <mitch gimp org>
Date: Tue May 8 23:32:48 2018 +0200
app: undeprecate GimpLevelsTool
by using some semi-smart luminance magic to get a distinct color for
the alpha curve.
app/tools/gimpcurvestool.c | 25 +++++++++++++++++++------
1 files changed, 19 insertions(+), 6 deletions(-)
---
diff --git a/app/tools/gimpcurvestool.c b/app/tools/gimpcurvestool.c
index 8c3d05d..b54c506 100644
--- a/app/tools/gimpcurvestool.c
+++ b/app/tools/gimpcurvestool.c
@@ -912,21 +912,34 @@ curves_get_channel_color (GtkWidget *widget,
{ 0.5, 0.5, 0.5, 1.0 }
};
+ GdkRGBA rgba;
+
if (channel == GIMP_HISTOGRAM_VALUE)
return FALSE;
if (channel == GIMP_HISTOGRAM_ALPHA)
{
- GtkStyle *style = gtk_widget_get_style (widget);
+ GtkStyleContext *style = gtk_widget_get_style_context (widget);
+ gdouble lum;
+
+ gtk_style_context_get_color (style, gtk_style_context_get_state (style),
+ &rgba);
+
+ lum = GIMP_RGB_LUMINANCE (rgba.red, rgba.green, rgba.blue);
+
+ if (lum > 0.5)
+ {
+ gimp_rgba_set (color, lum - 0.3, lum - 0.3, lum - 0.3, 1.0);
+ }
+ else
+ {
+ gimp_rgba_set (color, lum + 0.3, lum + 0.3, lum + 0.3, 1.0);
+ }
- gimp_rgba_set (color,
- style->text_aa[GTK_STATE_NORMAL].red / 65535.0,
- style->text_aa[GTK_STATE_NORMAL].green / 65535.0,
- style->text_aa[GTK_STATE_NORMAL].blue / 65535.0,
- 1.0);
return TRUE;
}
*color = channel_colors[channel];
+
return TRUE;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]