Allow for toggling color rendering

New menu item in Screen submenu.
hasColorScreen enabled for SDL device.
This commit is contained in:
poire-z
2017-10-01 19:23:06 +02:00
committed by Frans de Jonge
parent f45188fb9d
commit 53f083f516
11 changed files with 101 additions and 20 deletions

View File

@@ -10,8 +10,10 @@ local PicDocument = Document:new{
}
function PicDocument:init()
self:updateColorRendering()
if not pic then pic = require("ffi/pic") end
pic.color = Screen:isColorEnabled()
-- pic.color needs to be true before opening document to allow toggling color
pic.color = Screen.isColorScreen()
local ok
ok, self._document = pcall(pic.openDocument, self.file)
if not ok then