displayColors - a slightly more configurable showColors()
Posted: Sat Nov 02, 2019 4:11 am
So, showColors() is handy, but I sometimes wish it did a bit more. But I don't know that we want to keep adding options to the function in mudlet core.
Enter displayColors(options), a showColors() derivative I worked up based on what I learned while making showColors() sort based on color rather than just randomly. So, displayColors(options) takes a table of... well, options. You can replicate default showColors() behaviour using displayColors({columnSort = false, removeDupes = false}) . cols, search, and sort work the same as the arguments to the current showColors(), just as keys in the options table now.
Valid options are
All defaults:
displayColors({columnSort = false}) :
I made a test table called test_colors which has just extreme red, green, and blue in it to demonstrate custom color tables:
displayColors({color_table = test_colors})
For the following screenshot, the main window contains displayColors({columnSort = false, removeDupes = false}) which is essentially the same as showColors(), and I created the miniconsole using testMC = Geyser.MiniConsole:new({x="-600", y=0, width = 600, height = 600}), before displaying to it with displayColors({window = testMC})
And a new option, displayColors({justText = true})
Enter displayColors(options), a showColors() derivative I worked up based on what I learned while making showColors() sort based on color rather than just randomly. So, displayColors(options) takes a table of... well, options. You can replicate default showColors() behaviour using displayColors({columnSort = false, removeDupes = false}) . cols, search, and sort work the same as the arguments to the current showColors(), just as keys in the options table now.
Valid options are
So, some examples:
All defaults:
displayColors({columnSort = false}) :
I made a test table called test_colors which has just extreme red, green, and blue in it to demonstrate custom color tables:
displayColors({color_table = test_colors})
For the following screenshot, the main window contains displayColors({columnSort = false, removeDupes = false}) which is essentially the same as showColors(), and I created the miniconsole using testMC = Geyser.MiniConsole:new({x="-600", y=0, width = 600, height = 600}), before displaying to it with displayColors({window = testMC})
And a new option, displayColors({justText = true})