I am aiming to change text color based on a variable using the following code:
if cnx[key][1] = "open" then
term.setTextColor(colors.green)
else
term.setTextColor(colors.red)
end
write(cnx[key][1])
term.setTextColor(colors.white)
I have had a look through the forums and have found similar errors, however they have all been related to incorrect capitlisation i.e. lightblue instead of lightBlue, or defining the color by string, i.e. "colors.green".
I have tested my code with the color number instead of color code and this works, however another part of the code will rely on a table of colors defined with their color code rather than number, so I would rather figure out why this does not work than translate everything to color numbers.
Any help or suggestions would be appreciated.
Cheers.