Skip to content
Permalink
Browse files

Merge branch 'master' of https://github.com/Firew0lf/ctruLua

  • Loading branch information...
Firew0lf committed Dec 24, 2015
2 parents 5c4da69 + 716c42b commit bebfa8b72de4c110188810ebe780010380ce7108
Showing with 17 additions and 14 deletions.
  1. +12 −10 sdcard/3ds/ctruLua/editor/color.lua
  2. +4 −3 sdcard/3ds/ctruLua/libs/keyboard.lua
  3. +1 −1 source/main.c
@@ -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)
}
@@ -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
@@ -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
@@ -52,6 +52,6 @@ int main() {

// Unload Lua
lua_close(L);

return 0;
}

0 comments on commit bebfa8b

Please sign in to comment.
You can’t perform that action at this time.