https://github.com/rx-j/ignite.console
A simple class to extend Console.Write, Console.WriteLine and Console.ReadLine with formatting, tags and converting.
https://github.com/rx-j/ignite.console
console-color csharp-console-styling csharp-library styling
Last synced: 2 months ago
JSON representation
A simple class to extend Console.Write, Console.WriteLine and Console.ReadLine with formatting, tags and converting.
- Host: GitHub
- URL: https://github.com/rx-j/ignite.console
- Owner: RX-J
- Created: 2024-04-04T12:03:43.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-08-01T20:43:13.000Z (10 months ago)
- Last Synced: 2025-03-29T15:16:10.814Z (2 months ago)
- Topics: console-color, csharp-console-styling, csharp-library, styling
- Language: C#
- Homepage:
- Size: 18.6 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# **Important: The ```Ignite.Console``` class requires the ```Ignite.Convert``` class from https://github.com/RX-J/Ignite.Convert/blob/main/Convert.cs**
To print a value to the console, call the ```Print``` function:
```cs
Ignite.Console.Print ("Hello World!"); // Writes "Hello World!" to the console
```### The Print, Printl, and Scan Functions Support These Tags:
| Tag | Explanation | Reverse Tag |
|-----------------------|-----------------------------------------------|------------------------|
| `````` | Writes text in **bold** letters | `````` |
| `````` | Writes fainted letters | `````` |
| `````` | Writes text in *italic* letters | `````` |
| `````` | Writes underlined text | `````` |
| `````` | Writes blinking text | `````` |
| `````` | Reverses the foreground and background colors | `````` |
| `````` | Writes the text invisible to the console | `````` |
| `````` | Writes text in ~~strikethrough~~ letters | `````` |### You Can Also Change the Foreground and Background Colors:
| Tag | Explanation | Reverse Tag |
|-----------------------|--------------------------------|---------------------|
| ``````| Creates a red foreground color | `````` |
| ``````| Creates a red background color | `````` |**Important: The reverse tags always reset the foreground or background color, ```no``` `````` ```or``` `````` are necessary.**
**The following foreground colors are supported by default:**
``````\
``````\
``````\
``````\
``````\
``````\
``````\
``````\
``````**The following background colors are supported by default:**
``````\
``````\
``````\
``````\
``````\
``````\
``````\
``````\
``````### Changing the Foreground and Background Colors Using HEX Color Codes:
``````\
``````**Short notations are allowed:**
``````\
``````# Using Extended Formatting with Positions
```cs
Ignite.Console.Print (Ignite.Console.Position.Centered, "Hello World!"); // This text will be centered in the console
```**Supported are the following positions:**\
```Left```\
```Centered```\
```Right```\
Left is the default allingment# Example Usage of the Print Function
```cs
Ignite.Console.Print ("This text is bold - this text italic - and this text red");
Ignite.Console.Print (Ignite.Console.Position.Centered, "This text is bold and centered");
```# Printl and Scan Functions
```Printl``` works like the ```Console.WriteLine``` function but also supports formatting.
```Scan``` works almost like the ```Console.ReadLine``` function but supports formatting and built-in converting.**Usage of the Printl function:**
```cs
Ignite.Console.Printl ("This text is bold - this text italic - and this text red");
// A new line will be generated between this text
Ignite.Console.Printl (Ignite.Console.Position.Centered, "This text is bold and centered");
``````cs
var name = Ignite.Console.Scan ("Please enter your name: ");
var age = Ignite.Console.Scan ("Please enter your age: ");
```# Simple New Lines
**All functions support simple new lines formatting, you can call it by using:**
```cs
Ignite.Console.Print (
"First line",
"Second Line",
"Third line",
"...");
```**This works for the ```Print```, ```Printl```, and ```Scan``` functions, tags and position alignments are also possible:**
```cs
Ignite.Console.Print (
Ignite.Console.Position.Centered,
"First line",
"Second Line",
"Third line",
"...");
```**A new line will be automatically placed between each new (,).**