Refactored some code relating to colours, trivially simplified some calculations

This commit is contained in:
Maruno17
2022-08-13 23:59:24 +01:00
parent aa9b1a9e23
commit b1cde2db42
42 changed files with 294 additions and 250 deletions

View File

@@ -69,13 +69,13 @@ def pbDisplayMail(mail, _bearer = nil)
baseForLightBG = Color.new(80, 80, 88)
shadowForLightBG = Color.new(168, 168, 176)
if mail.message && mail.message != ""
isDark = isDarkBackground(sprites["card"].bitmap, Rect.new(48, 48, Graphics.width - 96, 32 * 7))
isDark = isDarkBackground(sprites["card"].bitmap, Rect.new(48, 48, Graphics.width - 96, 224))
drawTextEx(overlay, 48, 52, Graphics.width - 94, 7, mail.message,
(isDark) ? baseForDarkBG : baseForLightBG,
(isDark) ? shadowForDarkBG : shadowForLightBG)
end
if mail.sender && mail.sender != ""
isDark = isDarkBackground(sprites["card"].bitmap, Rect.new(336, 322, 144, 32 * 1))
isDark = isDarkBackground(sprites["card"].bitmap, Rect.new(336, 322, 144, 32))
drawTextEx(overlay, 336, 328, 144, 1, mail.sender,
(isDark) ? baseForDarkBG : baseForLightBG,
(isDark) ? shadowForDarkBG : shadowForLightBG)