From fa5bc20127eb4466f63988ff0fa5d47f6af81da4 Mon Sep 17 00:00:00 2001 From: TC1061 <35246631+TC1061@users.noreply.github.com> Date: Tue, 24 Apr 2018 23:33:51 +0500 Subject: [PATCH 1/3] Fixed theme bug In theme.color all colors were in 0-1 while love2d uses 0-255 so all widgets were absolutely black. Now they are visible at black background. --- theme.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/theme.lua b/theme.lua index 7981c21..3ed94e0 100644 --- a/theme.lua +++ b/theme.lua @@ -6,9 +6,9 @@ local theme = {} theme.cornerRadius = 4 theme.color = { - normal = {bg = { 0.25, 0.25, 0.25}, fg = {0.73,0.73,0.73}}, - hovered = {bg = { 0.19,0.6,0.73}, fg = {1,1,1}}, - active = {bg = {1,0.6, 0}, fg = {1,1,1}} + normal = {bg = { 64, 64, 64}, fg = {186,186,186}}, + hovered = {bg = { 48,186,186}, fg = {255,255,255}}, + active = {bg = {255,153, 0}, fg = {255,255,255}} } From b4cb844318d39e24f34acc1b263588ca5438626a Mon Sep 17 00:00:00 2001 From: TC1061 <35246631+TC1061@users.noreply.github.com> Date: Tue, 24 Apr 2018 23:41:55 +0500 Subject: [PATCH 2/3] Update theme.lua --- theme.lua | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/theme.lua b/theme.lua index 3ed94e0..0ca646d 100644 --- a/theme.lua +++ b/theme.lua @@ -5,11 +5,19 @@ local BASE = (...):match('(.-)[^%.]+$') local theme = {} theme.cornerRadius = 4 -theme.color = { - normal = {bg = { 64, 64, 64}, fg = {186,186,186}}, - hovered = {bg = { 48,186,186}, fg = {255,255,255}}, - active = {bg = {255,153, 0}, fg = {255,255,255}} -} +if love._version_major==0 and love._version_minor<=10 then + theme.color = { + normal = {bg = { 64, 64, 64}, fg = {186,186,186}}, + hovered = {bg = { 48,186,186}, fg = {255,255,255}}, + active = {bg = {255,153, 0}, fg = {255,255,255}} + } +else + theme.color = { + normal = {bg = { 0.25, 0.25, 0.25}, fg = {0.73,0.73,0.73}}, + hovered = {bg = { 0.19,0.6,0.73}, fg = {1,1,1}}, + active = {bg = {1,0.6, 0}, fg = {1,1,1}} + } +end -- HELPER From 0f27a7c84cc1cea3c64bba569518558ec4886439 Mon Sep 17 00:00:00 2001 From: TC1061 <35246631+TC1061@users.noreply.github.com> Date: Tue, 24 Apr 2018 23:52:30 +0500 Subject: [PATCH 3/3] Update theme.lua --- theme.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/theme.lua b/theme.lua index 0ca646d..970979a 100644 --- a/theme.lua +++ b/theme.lua @@ -6,12 +6,14 @@ local theme = {} theme.cornerRadius = 4 if love._version_major==0 and love._version_minor<=10 then + -- love2d 0.10.x or older theme.color = { normal = {bg = { 64, 64, 64}, fg = {186,186,186}}, hovered = {bg = { 48,186,186}, fg = {255,255,255}}, active = {bg = {255,153, 0}, fg = {255,255,255}} } else + -- love2d 0.11.x or newer theme.color = { normal = {bg = { 0.25, 0.25, 0.25}, fg = {0.73,0.73,0.73}}, hovered = {bg = { 0.19,0.6,0.73}, fg = {1,1,1}},