From a9795dbc7dcd01fa56bc6b0b8e977b0d8e4c3b62 Mon Sep 17 00:00:00 2001 From: Antonin Fischer Date: Thu, 3 Jun 2021 09:47:09 +0200 Subject: [PATCH] #24: Error with Gdk requirement from lgi and math.pow problem. --- colors.lua | 4 +--- init.lua | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) 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