This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
3istee's profile picture

Make write() and print() accept colors

Started by 3istee, 25 December 2012 - 05:00 AM
3istee #1
Posted 25 December 2012 - 06:00 AM
I know it's easy to do for yourself,
but maybe it would be better if included by default.

If my suggestion is not clear,
what I mean is something like:
write(string, textColor, backgroundColor)
print(string, textColor, backgroundColor)

I used this to get the same result:

function write(s,color,bgcolor)
  local color = color or colors.white
  local bgcolor = bgcolor or colors.black
  term.setTextColor(color)
  term.setBackgroundColor(bgcolor)
  term.write(s)
  term.setTextColor(colors.white)
  term.setBackgroundColor(colors.black)
end
Cloudy #2
Posted 25 December 2012 - 06:27 AM
Nah. To make this yourself would be a small function.
Sebra #3
Posted 26 December 2012 - 03:17 AM
So use your function.
If you force it to all, all current programs would always write white on black.
Think better.