summaryrefslogtreecommitdiff
path: root/eel/eel-gdk-extensions.c
diff options
context:
space:
mode:
Diffstat (limited to 'eel/eel-gdk-extensions.c')
-rw-r--r--eel/eel-gdk-extensions.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/eel/eel-gdk-extensions.c b/eel/eel-gdk-extensions.c
index 0a4d62c8..1bd367fb 100644
--- a/eel/eel-gdk-extensions.c
+++ b/eel/eel-gdk-extensions.c
@@ -342,6 +342,7 @@ eel_gdk_rgba_parse_with_white_default (GdkRGBA *color,
color->red = 1.0;
color->green = 1.0;
color->blue = 1.0;
+ color->alpha = 1.0;
}
}
@@ -422,9 +423,9 @@ eel_gdk_rgba_is_dark (const GdkRGBA *color)
{
int intensity;
- intensity = ((((int) (color->red) >> 8) * 77)
- + (((int) (color->green) >> 8) * 150)
- + (((int) (color->blue) >> 8) * 28)) >> 8;
+ intensity = (((guint) (color->red * 0xff) * 77)
+ + ((guint) (color->green * 0xff) * 150)
+ + ((guint) (color->blue * 0xff) * 28)) >> 8;
return intensity < 128;
}