2023-05-14 21:16:58 +01:00
|
|
|
local stdio = require("@lune/stdio")
|
|
|
|
|
2023-02-06 05:13:12 +00:00
|
|
|
local COLORS_VALID =
|
|
|
|
{ "reset", "black", "red", "green", "yellow", "blue", "purple", "cyan", "white" }
|
|
|
|
local COLORS_INVALID = { "", "gray", "grass", "red?", "super red", " ", "none" }
|
|
|
|
|
|
|
|
for _, color in COLORS_VALID do
|
|
|
|
stdio.color(color :: any)
|
|
|
|
stdio.color("reset")
|
|
|
|
end
|
|
|
|
|
|
|
|
for _, color in COLORS_INVALID do
|
|
|
|
if pcall(stdio.color, color :: any) then
|
|
|
|
stdio.color("reset")
|
|
|
|
error(string.format("Setting color should have failed for color '%s' but succeeded", color))
|
|
|
|
end
|
|
|
|
end
|