From dc9d174085fb4b1010c9fd44a67637840236d283 Mon Sep 17 00:00:00 2001 From: "kepler155c@gmail.com" Date: Wed, 3 Jan 2018 02:43:17 -0500 Subject: [PATCH] shadow text color override --- sys/apis/ui.lua | 3 ++- sys/apis/util.lua | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/apis/ui.lua b/sys/apis/ui.lua index 5847ccb..3addce4 100644 --- a/sys/apis/ui.lua +++ b/sys/apis/ui.lua @@ -2659,6 +2659,7 @@ UI.TextEntry.defaults = { shadowText = '', focused = false, textColor = colors.white, + shadowTextColor = colors.gray, backgroundColor = colors.black, -- colors.lightGray, backgroundFocusColor = colors.black, --lightGray, height = 1, @@ -2717,7 +2718,7 @@ function UI.TextEntry:draw() text = _rep('*', #text) end else - tc = colors.gray + tc = self.shadowTextColor text = self.shadowText end diff --git a/sys/apis/util.lua b/sys/apis/util.lua index 13bc5c5..47e9296 100644 --- a/sys/apis/util.lua +++ b/sys/apis/util.lua @@ -457,6 +457,7 @@ end --[[ String functions ]] -- function Util.toBytes(n) + if not tonumber(n) then error('Util.toBytes: n must be a number', 2) end if n >= 1000000 or n <= -1000000 then return string.format('%sM', math.floor(n/1000000 * 10) / 10) elseif n >= 1000 or n <= -1000 then