diff options
author | Matthias Clasen <mclasen@redhat.com> | 2020-07-25 00:29:42 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2020-07-25 11:56:05 -0400 |
commit | 706aa93ab5c7999a55bdbd08691cad361669627d (patch) | |
tree | 547ae11706adf2ed1bfec46e720b073fbeb2091f /gtk/gtkhsla.c | |
parent | 54deed9a5a318fd7f05747a05f66d66b144ad71a (diff) | |
download | gtk+-706aa93ab5c7999a55bdbd08691cad361669627d.tar.gz |
hsla: Just store floats
We are using floats for rgb, and we don't need more precision
for hsl colors either. We use hsl for computing color expressions
like shade(), lighter() and darker(), which are not precisely
specified anyway.
This commit updates the one test where the output changes a
tiny bit due to this.
Diffstat (limited to 'gtk/gtkhsla.c')
-rw-r--r-- | gtk/gtkhsla.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/gtk/gtkhsla.c b/gtk/gtkhsla.c index abb4aaf689..9692e3e59f 100644 --- a/gtk/gtkhsla.c +++ b/gtk/gtkhsla.c @@ -23,10 +23,10 @@ void _gtk_hsla_init (GtkHSLA *hsla, - double hue, - double saturation, - double lightness, - double alpha) + float hue, + float saturation, + float lightness, + float alpha) { g_return_if_fail (hsla != NULL); @@ -43,12 +43,12 @@ void _gtk_hsla_init_from_rgba (GtkHSLA *hsla, const GdkRGBA *rgba) { - double min; - double max; - double red; - double green; - double blue; - double delta; + float min; + float max; + float red; + float green; + float blue; + float delta; g_return_if_fail (hsla != NULL); g_return_if_fail (rgba != NULL); @@ -112,10 +112,10 @@ void _gdk_rgba_init_from_hsla (GdkRGBA *rgba, const GtkHSLA *hsla) { - double hue; - double lightness; - double saturation; - double m1, m2; + float hue; + float lightness; + float saturation; + float m1, m2; lightness = hsla->lightness; saturation = hsla->saturation; @@ -186,7 +186,7 @@ _gdk_rgba_init_from_hsla (GdkRGBA *rgba, void _gtk_hsla_shade (GtkHSLA *dest, const GtkHSLA *src, - double factor) + float factor) { g_return_if_fail (dest != NULL); g_return_if_fail (src != NULL); |