diff --git a/colors.lua b/colors.lua index 9e04d02..a8418d0 100644 --- a/colors.lua +++ b/colors.lua @@ -5,7 +5,6 @@ local math = math local floor = math.floor local max = math.max local min = math.min -local pow = math.pow local random = math.random local gcolor = require("gears.color") local parse_color = gcolor.parse_color @@ -88,8 +87,7 @@ end local function relative_luminance(color) local r, g, b = hex2rgb(color) local function from_sRGB(u) - return u <= 0.0031308 and 25 * u / 323 or - pow(((200 * u + 11) / 211), 12 / 5) + return u <= 0.0031308 and 25 * u / 323 or ((200 * u + 11) / 211) ^ (12 / 5) end return 0.2126 * from_sRGB(r) + 0.7152 * from_sRGB(g) + 0.0722 * from_sRGB(b) end diff --git a/init.lua b/init.lua index e0ac651..7f5745c 100644 --- a/init.lua +++ b/init.lua @@ -54,7 +54,7 @@ local ipairs = ipairs -- ============================================================ local lgi = require("lgi") local cairo = lgi.cairo -local gdk = lgi.Gdk +local gdk = lgi.require('Gdk', '3.0') local get_default_root_window = gdk.get_default_root_window local pixbuf_get_from_surface = gdk.pixbuf_get_from_surface local pixbuf_get_from_window = gdk.pixbuf_get_from_window