here is a basic alpha try, I have not included the actual key events in the listen function, you need to do that and sort out the code, just an example as I am in a hurry
local function addcol(colour,side)
side=side or 'back'
rs.setBundledOutput(side,colors.combine(rs.getBundledOutput(side),colour))
end
local function remcol(colour,side)
side=side or 'back'
rs.setBundledOutput(side,colors.subtract(rs.getBundledOutput(side),colour))
end
local function togglecol(colour,side)
side=side or 'back'
if colors.test(rs.getBundledOutput(side),colour) then
remcol(colour,side)
else
addcol(colour,side)
end
end
local sSide='left'
local tMenu=setmetatable({},{__index=tOptions;__call=function(tMe,param1,param2) togglecol(tColours[param1][param2],sSide) end})
local tOptions={{'one','six'},{'two',seven'},{'three','eight'},{'four','nine'},{'five'},{'all on','all off'}}
local tColours={{colors.red,colors.white},{colors.orange,colors.magenta},{colors.blue,colors.lightBlue},{colors.yellow,colors.purple},{colors.black},{colors.combine(colors.red,colors.white,colors.orange,colors.magenta,colors.blue,colors.lightBlue,colors.yellow,colors.purple,colors.black),0}}
local function display()
for row=1,#tOptions do
for num=1,#tOptions[row] do
if sy==row and sx==num then
term.setCursorPos(num*5,row)
write('['..tMenu[row][num]..']')
else
term.setCursorPos(num*5+1,row)
write(tMenu[row][num])
end
end
end
end
local function listen()
local evt={os.pullEvent()}
if evt[1]=='key' then
if evt[2]==uparrow and sy>1 then sy=sy-1
elseif evt[2]==leftarrow and sx>1 then sx=sx-1
elseif evt[2]==rightarrow and sx<#tOptions[sy] then sx=sx+1
elseif evt[2]==downarrow and sy<#tOptions then sy=sy+1
elseif evt[2]==return then tMenu(sy,sx)
end
end
end
local sx=1
local sy=1
while true do
display()
listen()
end