#24: Error with Gdk requirement from lgi and math.pow problem.
This commit is contained in:
parent
810aa72bbe
commit
a9795dbc7d
|
@ -5,7 +5,6 @@ local math = math
|
||||||
local floor = math.floor
|
local floor = math.floor
|
||||||
local max = math.max
|
local max = math.max
|
||||||
local min = math.min
|
local min = math.min
|
||||||
local pow = math.pow
|
|
||||||
local random = math.random
|
local random = math.random
|
||||||
local gcolor = require("gears.color")
|
local gcolor = require("gears.color")
|
||||||
local parse_color = gcolor.parse_color
|
local parse_color = gcolor.parse_color
|
||||||
|
@ -88,8 +87,7 @@ end
|
||||||
local function relative_luminance(color)
|
local function relative_luminance(color)
|
||||||
local r, g, b = hex2rgb(color)
|
local r, g, b = hex2rgb(color)
|
||||||
local function from_sRGB(u)
|
local function from_sRGB(u)
|
||||||
return u <= 0.0031308 and 25 * u / 323 or
|
return u <= 0.0031308 and 25 * u / 323 or ((200 * u + 11) / 211) ^ (12 / 5)
|
||||||
pow(((200 * u + 11) / 211), 12 / 5)
|
|
||||||
end
|
end
|
||||||
return 0.2126 * from_sRGB(r) + 0.7152 * from_sRGB(g) + 0.0722 * from_sRGB(b)
|
return 0.2126 * from_sRGB(r) + 0.7152 * from_sRGB(g) + 0.0722 * from_sRGB(b)
|
||||||
end
|
end
|
||||||
|
|
2
init.lua
2
init.lua
|
@ -54,7 +54,7 @@ local ipairs = ipairs
|
||||||
-- ============================================================
|
-- ============================================================
|
||||||
local lgi = require("lgi")
|
local lgi = require("lgi")
|
||||||
local cairo = lgi.cairo
|
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 get_default_root_window = gdk.get_default_root_window
|
||||||
local pixbuf_get_from_surface = gdk.pixbuf_get_from_surface
|
local pixbuf_get_from_surface = gdk.pixbuf_get_from_surface
|
||||||
local pixbuf_get_from_window = gdk.pixbuf_get_from_window
|
local pixbuf_get_from_window = gdk.pixbuf_get_from_window
|
||||||
|
|
Loading…
Reference in New Issue