diff --git a/mcl_test_colors/init.lua b/mcl_test_colors/init.lua new file mode 100644 index 0000000..5103e7b --- /dev/null +++ b/mcl_test_colors/init.lua @@ -0,0 +1,41 @@ +local C = minetest.colorize + +local formspec = table.concat({ + "formspec_version[4]", + "size[9,9.5]", + "style_type[label;font_size=25;font=bold]", +}) + +local colors = { + "BLACK", + "DARK_BLUE", + "DARK_GREEN", + "DARK_AQUA", + "DARK_RED", + "DARK_PURPLE", + "GOLD", + "GRAY", + "DARK_GRAY", + "BLUE", + "GREEN", + "AQUA", + "RED", + "LIGHT_PURPLE", + "YELLOW", + "WHITE", +} + +local count = 0 +for _,name in pairs(colors) do + count = count + 1 + formspec = formspec.. + "label[0.4,".. 0.4 + 0.5 * count..";"..C(mcl_colors[name], "mcl_colors."..name).."]".. + "box[6,".. 0.2 + 0.5 * count..";2.5,0.5;"..mcl_colors.background[name].."]" +end + +minetest.register_chatcommand("colors", { + description = "Show a formspec featuring all color in mcl_colors", + func = function(playername) + minetest.show_formspec(playername, "mcl_test_colors:colors", formspec) + end, +}) \ No newline at end of file diff --git a/mcl_test_colors/mod.conf b/mcl_test_colors/mod.conf new file mode 100644 index 0000000..0520861 --- /dev/null +++ b/mcl_test_colors/mod.conf @@ -0,0 +1,3 @@ +name = mcl_test_colors +author = AFCMS +depends = mcl_colors \ No newline at end of file