[gimp] libgimpwidgets: make color chooser scales range to 100.0 instead of 255
- From: Øyvind Kolås <ok src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] libgimpwidgets: make color chooser scales range to 100.0 instead of 255
- Date: Fri, 30 Dec 2016 16:55:16 +0000 (UTC)
commit c9520bae6d6d80ba7bbe299052c0013f7e70df16
Author: Øyvind Kolås <pippin gimp org>
Date: Wed Dec 28 19:57:28 2016 +0100
libgimpwidgets: make color chooser scales range to 100.0 instead of 255
Still using perceptual TRC - making 50% middle gray. This for all of 8bit and
16bit integer, as well as for floating point precisions. Also added a decimal point, to make use of more
precision for both RGB and HSV entries.
libgimpwidgets/gimpcolorscales.c | 16 ++++++++--------
1 files changed, 8 insertions(+), 8 deletions(-)
---
diff --git a/libgimpwidgets/gimpcolorscales.c b/libgimpwidgets/gimpcolorscales.c
index 4eef817..721f141 100644
--- a/libgimpwidgets/gimpcolorscales.c
+++ b/libgimpwidgets/gimpcolorscales.c
@@ -131,7 +131,7 @@ gimp_color_scales_init (GimpColorScales *scales)
static const gdouble slider_initial_vals[] =
{ 0, 0, 0, 0, 0, 0, 0 };
static const gdouble slider_max_vals[] =
- { 360, 100, 100, 255, 255, 255, 100 };
+ { 360, 100, 100, 100, 100, 100, 100 };
static const gdouble slider_incs[] =
{ 30, 10, 10, 16, 16, 16, 10 };
@@ -187,7 +187,7 @@ gimp_color_scales_init (GimpColorScales *scales)
slider_initial_vals[i],
0.0, slider_max_vals[i],
1.0, slider_incs[i],
- 0,
+ 1,
gettext (enum_desc->value_help),
NULL);
@@ -310,9 +310,9 @@ gimp_color_scales_update_scales (GimpColorScales *scales,
values[GIMP_COLOR_SELECTOR_HUE] = ROUND (selector->hsv.h * 360.0);
values[GIMP_COLOR_SELECTOR_SATURATION] = ROUND (selector->hsv.s * 100.0);
values[GIMP_COLOR_SELECTOR_VALUE] = ROUND (selector->hsv.v * 100.0);
- values[GIMP_COLOR_SELECTOR_RED] = ROUND (selector->rgb.r * 255.0);
- values[GIMP_COLOR_SELECTOR_GREEN] = ROUND (selector->rgb.g * 255.0);
- values[GIMP_COLOR_SELECTOR_BLUE] = ROUND (selector->rgb.b * 255.0);
+ values[GIMP_COLOR_SELECTOR_RED] = ROUND (selector->rgb.r * 100.0);
+ values[GIMP_COLOR_SELECTOR_GREEN] = ROUND (selector->rgb.g * 100.0);
+ values[GIMP_COLOR_SELECTOR_BLUE] = ROUND (selector->rgb.b * 100.0);
values[GIMP_COLOR_SELECTOR_ALPHA] = ROUND (selector->rgb.a * 100.0);
for (i = 0; i < 7; i++)
@@ -384,15 +384,15 @@ gimp_color_scales_scale_update (GtkAdjustment *adjustment,
break;
case GIMP_COLOR_SELECTOR_RED:
- selector->rgb.r = value / 255.0;
+ selector->rgb.r = value / 100.0;
break;
case GIMP_COLOR_SELECTOR_GREEN:
- selector->rgb.g = value / 255.0;
+ selector->rgb.g = value / 100.0;
break;
case GIMP_COLOR_SELECTOR_BLUE:
- selector->rgb.b = value / 255.0;
+ selector->rgb.b = value / 100.0;
break;
case GIMP_COLOR_SELECTOR_ALPHA:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]