summaryrefslogtreecommitdiff
path: root/mate-panel/libpanel-util/panel-color.c
diff options
context:
space:
mode:
authorraveit65 <[email protected]>2024-01-28 02:53:56 +0100
committerraveit65 <[email protected]>2024-02-04 18:37:58 +0100
commite663fbaeba760003b4088e567af0883534891e59 (patch)
treefd7b6805cc5d0e022f526e6343bb2539aa12f54e /mate-panel/libpanel-util/panel-color.c
parent6a9848eb8388807d13c38cdaceabfc143f6640aa (diff)
downloadmate-panel-e663fbaeba760003b4088e567af0883534891e59.tar.bz2
mate-panel-e663fbaeba760003b4088e567af0883534891e59.tar.xz
Revert "Reduce scope of variables"
This reverts commit 96c7ebc6dc9e8b8327db04a9570054ee78743353.
Diffstat (limited to 'mate-panel/libpanel-util/panel-color.c')
-rw-r--r--mate-panel/libpanel-util/panel-color.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/mate-panel/libpanel-util/panel-color.c b/mate-panel/libpanel-util/panel-color.c
index 661e6fb5..f6148aaa 100644
--- a/mate-panel/libpanel-util/panel-color.c
+++ b/mate-panel/libpanel-util/panel-color.c
@@ -17,6 +17,7 @@ rgb_to_hls (gdouble *r, gdouble *g, gdouble *b)
gdouble green;
gdouble blue;
gdouble h, l, s;
+ gdouble delta;
red = *r;
green = *g;
@@ -49,8 +50,6 @@ rgb_to_hls (gdouble *r, gdouble *g, gdouble *b)
h = 0;
if (max != min) {
- gdouble delta;
-
if (l <= 0.5)
s = (max - min) / (max + min);
else
@@ -85,9 +84,11 @@ rgb_to_hls (gdouble *r, gdouble *g, gdouble *b)
static void
hls_to_rgb (gdouble *h, gdouble *l, gdouble *s)
{
+ gdouble hue;
gdouble lightness;
gdouble saturation;
gdouble m1, m2;
+ gdouble r, g, b;
lightness = *l;
saturation = *s;
@@ -103,9 +104,6 @@ hls_to_rgb (gdouble *h, gdouble *l, gdouble *s)
*l = lightness;
*s = lightness;
} else {
- gdouble hue;
- gdouble r, g, b;
-
hue = *h + 120;
while (hue > 360)
hue -= 360;