RosettaCodeData/Task/Terminal-control-Coloured-text/Pluto/terminal-control-coloured-text.pluto
2025-08-11 18:05:26 -07:00

16 lines
777 B
Text

require "ansi"
local colors = {"Black", "Red", "Green", "Yellow", "Blue", "Magenta", "Cyan", "White"}
-- Display words using 'bright' colors
for i = 2, 8 do screen.print(colors[i], color[colors[i]]) end -- Red to White
os.sleep(3000) -- wait for 3 seconds
screen.setBack(color.white) -- set background color to white
screen.clear() -- clear screen to background color & home the cursor
-- display words again using 'blinking' colors
screen.setStyle("blink") -- blink on
for i = 1, 7 do screen.print(colors[i], color[colors[i]]) end -- Black to Cyan
os.sleep(3000) -- wait for 3 more seconds
screen.reset() -- reset all attributes
screen.clear() -- clear screen to background color & home the cursor