1
0
Fork 0
mirror of https://github.com/ctruLua/ctruLua.git synced 2025-10-27 16:39:29 +00:00
This commit is contained in:
Firew0lf 2015-12-24 18:45:40 +01:00
commit bebfa8b72d
3 changed files with 17 additions and 14 deletions

View file

@ -1,16 +1,18 @@
local hex = require("ctr.gfx.color").hex
-- Colors based on the Monokai theme -- Colors based on the Monokai theme
return { return {
-- General -- General
["background"] = 0x272822FF, ["background"] = hex(0x272822FF),
["cursor"] = 0xF8F8F0FF, ["cursor"] = hex(0xF8F8F0FF),
["default"] = 0xF8F8F2FF, ["default"] = hex(0xF8F8F2FF),
-- Syntax -- Syntax
["comment"] = 0x75715EFF, ["comment"] = hex(0x75715EFF),
["string"] = 0xE6DB74FF, ["string"] = hex(0xE6DB74FF),
["constant.numeric"] = 0xAE81FFFF, ["constant.numeric"] = hex(0xAE81FFFF),
["constant.language"] = 0xAE81FFFF, ["constant.language"] = hex(0xAE81FFFF),
["keyword.control"] = 0xF92672FF, ["keyword.control"] = hex(0xF92672FF),
["keyword.operator"] = 0xF92672FF, ["keyword.operator"] = hex(0xF92672FF),
["support.function"] = 0x66D9EFFF ["support.function"] = hex(0x66D9EFFF)
} }

View file

@ -1,5 +1,6 @@
local hid = require("ctr.hid") local hid = require("ctr.hid")
local gfx = require("ctr.gfx") local gfx = require("ctr.gfx")
local hex = gfx.color.hex
-- Options -- Options
local keyWidth, keyHeight = 25, 25 local keyWidth, keyHeight = 25, 25
@ -62,14 +63,14 @@ return {
for column, key in pairs(rowKeys) do for column, key in pairs(rowKeys) do
local xKey, yKey = x + (column-1)*(keyWidth-1), y + (row-1)*(keyHeight-1) local xKey, yKey = x + (column-1)*(keyWidth-1), y + (row-1)*(keyHeight-1)
gfx.rectangle(xKey, yKey, keyWidth, keyHeight, 0, 0xFFFFFFFF) gfx.rectangle(xKey, yKey, keyWidth, keyHeight, 0, hex(0xFFFFFFFF))
gfx.rectangle(xKey + 1, yKey + 1, keyWidth - 2, keyHeight - 2, 0, 0x000000FF) gfx.rectangle(xKey + 1, yKey + 1, keyWidth - 2, keyHeight - 2, 0, hex(0x000000FF))
gfx.text(xKey + 2, yKey + 2, key) gfx.text(xKey + 2, yKey + 2, key)
if xTouch then if xTouch then
if xTouch > xKey and xTouch < xKey + keyWidth then if xTouch > xKey and xTouch < xKey + keyWidth then
if yTouch > yKey and yTouch < yKey + keyHeight then if yTouch > yKey and yTouch < yKey + keyHeight then
gfx.rectangle(xKey, yKey, keyWidth, keyHeight, 0, 0xDDFFFFFF) gfx.rectangle(xKey, yKey, keyWidth, keyHeight, 0, hex(0xDDFFFFFF))
local k = alias[key] or key local k = alias[key] or key
if sticky[k] and layout[sticky[k]] then if sticky[k] and layout[sticky[k]] then