diff --git a/docs/input/assets/casts/columns-plain.cast b/docs/input/assets/casts/columns-plain.cast new file mode 100644 index 000000000..c2a5a5b76 --- /dev/null +++ b/docs/input/assets/casts/columns-plain.cast @@ -0,0 +1,13 @@ +{"version": 2, "width": 122, "height": 24, "title": "columns (plain)", "env": {"TERM": "Spectre.Console"}} +[0, "o", "\u001B[31;40mItem 1\u001B[0m \u001B[32;40mItem 2\u001B[0m \u001B[34;40mItem 3\u001B[0m \r\n"] +[0.203, "o", "\u001B[31;40mItem 4\u001B[0m \u001B[32;40mItem 5\u001B[0m \u001B[34;40mItem 6\u001B[0m \r\n"] +[0.406, "o", "\u001B[31;40mItem 7\u001B[0m \u001B[32;40mItem 8\u001B[0m \u001B[34;40mItem 9\u001B[0m \r\n"] +[0.609, "o", "\u001B[31;40mItem 10\u001B[0m \u001B[32;40mItem 11\u001B[0m \u001B[34;40mItem 12\u001B[0m \r\n"] +[0.813, "o", "\u001B[31;40mItem 13\u001B[0m \u001B[32;40mItem 14\u001B[0m \u001B[34;40mItem 15\u001B[0m \r\n"] +[1.031, "o", "\u001B[31;40mItem 16\u001B[0m \u001B[32;40mItem 17\u001B[0m \u001B[34;40mItem 18\u001B[0m \r\n"] +[1.234, "o", "\u001B[31;40mItem 19\u001B[0m \u001B[32;40mItem 20\u001B[0m \u001B[34;40mItem 21\u001B[0m \r\n"] +[1.438, "o", "\u001B[31;40mItem 22\u001B[0m \u001B[32;40mItem 23\u001B[0m \u001B[34;40mItem 24\u001B[0m \r\n"] +[1.641, "o", "\u001B[31;40mItem 25\u001B[0m \u001B[32;40mItem 26\u001B[0m \u001B[34;40mItem 27\u001B[0m \r\n"] +[1.859, "o", "\u001B[31;40mItem 28\u001B[0m \u001B[32;40mItem 29\u001B[0m \u001B[34;40mItem 30\u001B[0m \r\n"] +[2.063, "o", "\u001B[31;40mItem 31\u001B[0m \u001B[32;40mItem 32\u001B[0m \u001B[34;40mItem 33\u001B[0m \r\n"] + diff --git a/docs/input/assets/casts/columns-rich.cast b/docs/input/assets/casts/columns-rich.cast new file mode 100644 index 000000000..5e1da9262 --- /dev/null +++ b/docs/input/assets/casts/columns-rich.cast @@ -0,0 +1,13 @@ +{"version": 2, "width": 122, "height": 24, "title": "columns (rich)", "env": {"TERM": "Spectre.Console"}} +[0, "o", "\u001B[38;5;9;48;5;0mItem 1\u001B[0m \u001B[38;5;2;48;5;0mItem 2\u001B[0m \u001B[38;5;12;48;5;0mItem 3\u001B[0m \r\n"] +[0.218, "o", "\u001B[38;5;9;48;5;0mItem 4\u001B[0m \u001B[38;5;2;48;5;0mItem 5\u001B[0m \u001B[38;5;12;48;5;0mItem 6\u001B[0m \r\n"] +[0.422, "o", "\u001B[38;5;9;48;5;0mItem 7\u001B[0m \u001B[38;5;2;48;5;0mItem 8\u001B[0m \u001B[38;5;12;48;5;0mItem 9\u001B[0m \r\n"] +[0.625, "o", "\u001B[38;5;9;48;5;0mItem 10\u001B[0m \u001B[38;5;2;48;5;0mItem 11\u001B[0m \u001B[38;5;12;48;5;0mItem 12\u001B[0m \r\n"] +[0.828, "o", "\u001B[38;5;9;48;5;0mItem 13\u001B[0m \u001B[38;5;2;48;5;0mItem 14\u001B[0m \u001B[38;5;12;48;5;0mItem 15\u001B[0m \r\n"] +[1.031, "o", "\u001B[38;5;9;48;5;0mItem 16\u001B[0m \u001B[38;5;2;48;5;0mItem 17\u001B[0m \u001B[38;5;12;48;5;0mItem 18\u001B[0m \r\n"] +[1.234, "o", "\u001B[38;5;9;48;5;0mItem 19\u001B[0m \u001B[38;5;2;48;5;0mItem 20\u001B[0m \u001B[38;5;12;48;5;0mItem 21\u001B[0m \r\n"] +[1.437, "o", "\u001B[38;5;9;48;5;0mItem 22\u001B[0m \u001B[38;5;2;48;5;0mItem 23\u001B[0m \u001B[38;5;12;48;5;0mItem 24\u001B[0m \r\n"] +[1.64, "o", "\u001B[38;5;9;48;5;0mItem 25\u001B[0m \u001B[38;5;2;48;5;0mItem 26\u001B[0m \u001B[38;5;12;48;5;0mItem 27\u001B[0m \r\n"] +[1.859, "o", "\u001B[38;5;9;48;5;0mItem 28\u001B[0m \u001B[38;5;2;48;5;0mItem 29\u001B[0m \u001B[38;5;12;48;5;0mItem 30\u001B[0m \r\n"] +[2.047, "o", "\u001B[38;5;9;48;5;0mItem 31\u001B[0m \u001B[38;5;2;48;5;0mItem 32\u001B[0m \u001B[38;5;12;48;5;0mItem 33\u001B[0m \r\n"] + diff --git a/resources/scripts/Generator/Commands/AsciiCast/Samples/ColumnsSample.cs b/resources/scripts/Generator/Commands/AsciiCast/Samples/ColumnsSample.cs new file mode 100644 index 000000000..424498373 --- /dev/null +++ b/resources/scripts/Generator/Commands/AsciiCast/Samples/ColumnsSample.cs @@ -0,0 +1,22 @@ +using System.Threading; +using Spectre.Console; + +namespace Generator.Commands.Samples +{ + public class ColumnsSample : BaseSample + { + public override void Run(IAnsiConsole console) + { + for (var i = 0; i <= 10; i++) + { + var n = 3 * i + 1; + console.Write(new Columns( + new Text($"Item {n}", new Style(Color.Red, Color.Black)), + new Text($"Item {n+1}", new Style(Color.Green, Color.Black)), + new Text($"Item {n+2}", new Style(Color.Blue, Color.Black)) + )); + Thread.Sleep(200); + } + } + } +} \ No newline at end of file