Skip to content

Commit

Permalink
Fixed keyboard and editor colors
Browse files Browse the repository at this point in the history
  • Loading branch information
Reuh committed Dec 24, 2015
1 parent 2e782ed commit 716c42b
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 14 deletions.
22 changes: 12 additions & 10 deletions sdcard/3ds/ctruLua/editor/color.lua
@@ -1,16 +1,18 @@
local hex = require("ctr.gfx.color").hex

-- Colors based on the Monokai theme
return {
-- General
["background"] = 0x272822FF,
["cursor"] = 0xF8F8F0FF,
["default"] = 0xF8F8F2FF,
["background"] = hex(0x272822FF),
["cursor"] = hex(0xF8F8F0FF),
["default"] = hex(0xF8F8F2FF),

-- Syntax
["comment"] = 0x75715EFF,
["string"] = 0xE6DB74FF,
["constant.numeric"] = 0xAE81FFFF,
["constant.language"] = 0xAE81FFFF,
["keyword.control"] = 0xF92672FF,
["keyword.operator"] = 0xF92672FF,
["support.function"] = 0x66D9EFFF
["comment"] = hex(0x75715EFF),
["string"] = hex(0xE6DB74FF),
["constant.numeric"] = hex(0xAE81FFFF),
["constant.language"] = hex(0xAE81FFFF),
["keyword.control"] = hex(0xF92672FF),
["keyword.operator"] = hex(0xF92672FF),
["support.function"] = hex(0x66D9EFFF)
}
7 changes: 4 additions & 3 deletions sdcard/3ds/ctruLua/libs/keyboard.lua
@@ -1,5 +1,6 @@
local hid = require("ctr.hid")
local gfx = require("ctr.gfx")
local hex = gfx.color.hex

-- Options
local keyWidth, keyHeight = 25, 25
Expand Down Expand Up @@ -62,14 +63,14 @@ return {
for column, key in pairs(rowKeys) do
local xKey, yKey = x + (column-1)*(keyWidth-1), y + (row-1)*(keyHeight-1)

gfx.rectangle(xKey, yKey, keyWidth, keyHeight, 0, 0xFFFFFFFF)
gfx.rectangle(xKey + 1, yKey + 1, keyWidth - 2, keyHeight - 2, 0, 0x000000FF)
gfx.rectangle(xKey, yKey, keyWidth, keyHeight, 0, hex(0xFFFFFFFF))
gfx.rectangle(xKey + 1, yKey + 1, keyWidth - 2, keyHeight - 2, 0, hex(0x000000FF))
gfx.text(xKey + 2, yKey + 2, key)

if xTouch then
if xTouch > xKey and xTouch < xKey + keyWidth 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
if sticky[k] and layout[sticky[k]] then
Expand Down
2 changes: 1 addition & 1 deletion source/main.c
Expand Up @@ -52,6 +52,6 @@ int main() {

// Unload Lua
lua_close(L);

return 0;
}

0 comments on commit 716c42b

Please sign in to comment.