colourfulmoon 0.0.1
Paint you terminal!
To use this package, run the following command in your project's root directory:
Manual usage
Put the following dependency into your project's dependences section:
This package provides sub packages which can be used individually:
colourfulmoon:example - Example of ColourfulMoon use
ColourfulMoon
Paint your text simple!
Usage
There are 2 different ways to use ColourfulMoon.
- Just call the functions:
writeln(Bold(Underline("Text")));
This is a bad way - it is hard to read this code.
- Use std.stdio style:
"Text".Bold.Underline.writeln;
So, just use second way.
Functions
- Reset. Resets styles.
- Bold. Makes text bold.
- Underline. Underlines text.
- Blink. Make text blinked.
- Reverse. Reverses Foreground <-> Background.
- Foreground Colour text face to given R, G, B.
- Backround Colour text background to given R, G, B.
Understanding operation order
All functions (except Reset) are applying right-to-left.
"Text".Bold.Underline.Reverse.Blink.writeln;
// <-------------------------------
As first, text become blinked, then reversed, then underlined, then bolded.
Foreground and Background doesn't rewritable! You can't do something like this:
"text".Foreground(0, 0, 0).Bold.Foreground(156, 156, 156).writeln;
// Text has colour 156,156,156, not 0,0,0.
To reset style of text - use Reset:
"text".Foreground(0, 0, 0).Bold.Reset.Foreground(156, 156, 156).writeln;
// <-----------------------------------------------------
// ---------->
// Reset works from left-to-right. Now text has 0,0,0 colour.
Example
Aviable in ./example
.
TODO
- [ ] Speed up code by use of Ranges or something like this
- [ ] Windows support
- [ ] Test on BSD, OS X, etc.
- Registered by Azbuka
- 0.0.1 released 8 years ago
- azbukagh/ColourfulMoon
- MIT
- 2016 Azbuka-slovensko
- Authors:
- Sub packages:
- colourfulmoon:example
- Dependencies:
- none
- Versions:
-
1.0.2 2016-Aug-11 1.0.1 2016-May-05 1.0.0 2016-Apr-12 0.1.0 2016-Apr-10 0.0.1 2016-Feb-13 - Download Stats:
-
-
0 downloads today
-
0 downloads this week
-
0 downloads this month
-
1368 downloads total
-
- Score:
- 0.7
- Short URL:
- colourfulmoon.dub.pm