Commit 0a80b63b authored by Matthias Clasen's avatar Matthias Clasen Committed by Matthias Clasen

Change the ranges for Saturation and Value to be 0-100 instead of 0-255,

Wed Nov  5 21:02:26 2003  Matthias Clasen  <maclas@gmx.de>

	* gtk/gtkcolorsel.c (update_color):
	(make_label_spinbutton):
	(adjustment_changed): Change the ranges for Saturation and
	Value to be 0-100 instead of 0-255, since these axes of HSV
	are usually expressed in percent.  (#121519, Gregory Merchan)
Wed Nov  5 21:02:26 2003  Matthias Clasen  <maclas@gmx.de>

	* gtk/gtkcolorsel.c (update_color):
	(make_label_spinbutton):
	(adjustment_changed): Change the ranges for Saturation and
	Value to be 0-100 instead of 0-255, since these axes of HSV
	are usually expressed in percent.  (#121519, Gregory Merchan)
parent c6e019fb
Wed Nov 5 21:02:26 2003 Matthias Clasen <maclas@gmx.de>
* gtk/gtkcolorsel.c (update_color):
(make_label_spinbutton):
(adjustment_changed): Change the ranges for Saturation and
Value to be 0-100 instead of 0-255, since these axes of HSV
are usually expressed in percent. (#121519, Gregory Merchan)
Wed Nov 5 08:51:48 GMT 2003 Tony Gale <gale@gtk.org>
* docs/faq/gtk-faq.sgml: More 2.x updates
......
Wed Nov 5 21:02:26 2003 Matthias Clasen <maclas@gmx.de>
* gtk/gtkcolorsel.c (update_color):
(make_label_spinbutton):
(adjustment_changed): Change the ranges for Saturation and
Value to be 0-100 instead of 0-255, since these axes of HSV
are usually expressed in percent. (#121519, Gregory Merchan)
Wed Nov 5 08:51:48 GMT 2003 Tony Gale <gale@gtk.org>
* docs/faq/gtk-faq.sgml: More 2.x updates
......
Wed Nov 5 21:02:26 2003 Matthias Clasen <maclas@gmx.de>
* gtk/gtkcolorsel.c (update_color):
(make_label_spinbutton):
(adjustment_changed): Change the ranges for Saturation and
Value to be 0-100 instead of 0-255, since these axes of HSV
are usually expressed in percent. (#121519, Gregory Merchan)
Wed Nov 5 08:51:48 GMT 2003 Tony Gale <gale@gtk.org>
* docs/faq/gtk-faq.sgml: More 2.x updates
......
Wed Nov 5 21:02:26 2003 Matthias Clasen <maclas@gmx.de>
* gtk/gtkcolorsel.c (update_color):
(make_label_spinbutton):
(adjustment_changed): Change the ranges for Saturation and
Value to be 0-100 instead of 0-255, since these axes of HSV
are usually expressed in percent. (#121519, Gregory Merchan)
Wed Nov 5 08:51:48 GMT 2003 Tony Gale <gale@gtk.org>
* docs/faq/gtk-faq.sgml: More 2.x updates
......
Wed Nov 5 21:02:26 2003 Matthias Clasen <maclas@gmx.de>
* gtk/gtkcolorsel.c (update_color):
(make_label_spinbutton):
(adjustment_changed): Change the ranges for Saturation and
Value to be 0-100 instead of 0-255, since these axes of HSV
are usually expressed in percent. (#121519, Gregory Merchan)
Wed Nov 5 08:51:48 GMT 2003 Tony Gale <gale@gtk.org>
* docs/faq/gtk-faq.sgml: More 2.x updates
......
......@@ -1445,7 +1445,7 @@ adjustment_changed (GtkAdjustment *adjustment,
{
case COLORSEL_SATURATION:
case COLORSEL_VALUE:
priv->color[GPOINTER_TO_INT (data)] = adjustment->value / 255;
priv->color[GPOINTER_TO_INT (data)] = adjustment->value / 100;
gtk_hsv_to_rgb (priv->color[COLORSEL_HUE],
priv->color[COLORSEL_SATURATION],
priv->color[COLORSEL_VALUE],
......@@ -1523,6 +1523,11 @@ make_label_spinbutton (GtkColorSelection *colorsel,
{
adjust = GTK_ADJUSTMENT (gtk_adjustment_new (0.0, 0.0, 360.0, 1.0, 1.0, 1.0));
}
else if (channel_type == COLORSEL_SATURATION ||
channel_type == COLORSEL_VALUE)
{
adjust = GTK_ADJUSTMENT (gtk_adjustment_new (0.0, 0.0, 100.0, 1.0, 1.0, 1.0));
}
else
{
adjust = GTK_ADJUSTMENT (gtk_adjustment_new (0.0, 0.0, 255.0, 1.0, 1.0, 1.0));
......@@ -1599,10 +1604,10 @@ update_color (GtkColorSelection *colorsel)
scale_round (priv->color[COLORSEL_HUE], 360));
gtk_adjustment_set_value (gtk_spin_button_get_adjustment
(GTK_SPIN_BUTTON (priv->sat_spinbutton)),
scale_round (priv->color[COLORSEL_SATURATION], 255));
scale_round (priv->color[COLORSEL_SATURATION], 100));
gtk_adjustment_set_value (gtk_spin_button_get_adjustment
(GTK_SPIN_BUTTON (priv->val_spinbutton)),
scale_round (priv->color[COLORSEL_VALUE], 255));
scale_round (priv->color[COLORSEL_VALUE], 100));
gtk_adjustment_set_value (gtk_spin_button_get_adjustment
(GTK_SPIN_BUTTON (priv->red_spinbutton)),
scale_round (priv->color[COLORSEL_RED], 255));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment