From 997de2726c0e3ec5031e072a61b68c509384082f Mon Sep 17 00:00:00 2001 From: Arvydas Sidorenko Date: Tue, 12 Jun 2012 10:13:46 +0200 Subject: [PATCH] Ported lib/gears to lua 5.2 Tested with lua 5.1: all good Signed-off-by: Arvydas Sidorenko Signed-off-by: Uli Schlachter --- lib/gears/color.lua.in | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/gears/color.lua.in b/lib/gears/color.lua.in index f2d21bb7..2f238715 100644 --- a/lib/gears/color.lua.in +++ b/lib/gears/color.lua.in @@ -160,7 +160,7 @@ function color.create_radial_pattern(arg) end --- Mapping of all supported color types. New entries can be added. -local types = { +color.types = { solid = color.create_solid_pattern, png = color.create_png_pattern, linear = color.create_linear_pattern, @@ -184,15 +184,15 @@ local types = { function color.create_pattern(col) if type(col) == "string" then local t = string.match(col, "[^:]+") - if types[t] then + if color.types[t] then local pos = string.len(t) local arg = string.sub(col, pos + 2) - return types[t](arg) + return color.types[t](arg) end elseif type(col) == "table" then local t = col.type - if types[t] then - return types[t](col) + if color.types[t] then + return color.types[t](col) end end return color.create_solid_pattern(col)