Jump to content




Colors Help


2 replies to this topic

#1 Zenon

  • Members
  • 50 posts

Posted 19 July 2015 - 07:30 PM

Hi all! I was just wondering if anybody knew how to set a color up to equal input?
Example:
input = read()
term.setTextColor(color.input)
^That^ doesnt seem to work, so I was wondering if there was another way of doing that instead of the following:
input = read()
if input == "red" then
term.setTextColor(colors.red)
end

Thanks in advance!

#2 KingofGamesYami

  • Members
  • 3,002 posts
  • LocationUnited States of America

Posted 19 July 2015 - 08:06 PM

local input = read()
if colors[ input ] then
  term.setTextColor( colors[ input ] )
end


#3 Zenon

  • Members
  • 50 posts

Posted 19 July 2015 - 08:09 PM

View PostKingofGamesYami, on 19 July 2015 - 08:06 PM, said:

local input = read()
if colors[ input ] then
  term.setTextColor( colors[ input ] )
end
Thanks a Bunch! You saved me a lot of writing haha





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users